Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing variables to strings

Status
Not open for further replies.

KilideoCapit

Programmer
Sep 16, 2003
3
US
hey, i need to take the variable "c" and make it "c$". is there a way to do that?
 
When you use the STR$() command Qbasic automaticaly puts a space before (and after?) the number so, unless you want the space, use c$ = RTRIM$(LTRIM$(STR$(c)))

If a man says something in the forest and no woman hears it is he still wrong?
 
Hi

Just a FYI

The space as qbasicking describes is reserved for the sign of the number. A space if it is positive or a "-" if it is negative. There is no space after the number.



David Paulson

 
Thanks for clearing that up, I didn't think that there was a space after, but it was late I didn't feel like checking it.

So then all you need is c$ = LTRIM$(STR$(c))

If a man says something in the forest and no woman hears it is he still wrong?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top