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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

string / var check

Status
Not open for further replies.

qbasicking

Programmer
Aug 19, 2001
628
US
When righting my scripting language i came to with trouble with the + command.
I had to figure out a way to figure out to add the two like a variable or merge them like a string.

Thats where i came up with this. To see if a string is holding a number in it a$ = "6" try this

IF var$ = STR$(VAL(var$)) THEN

if var$ = "6" then they will be the same
if var$ = "hello" then STR$(VAL(var$)) will equal ".41234 E2" - i dunno - i guessed there
 
Sorry, that was supposed to be classified as a Tip, and I guessed on what decimal it would turn out to be, i know it works
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top