T O P I C R E V I E W |
thuang |
Posted - 08/31/2005 : 8:01:40 PM Origin Version (Select Help-->About Origin): 7.5 Operating System: windows xp
hi, in c++ visual there was a way to tell if a variable was an alphanumeric. like u could say if (x==alphanumeric) then blah blh blah. i don't remember the exact syntax. but is there something like that in origin? a way to check if a variable is a number?
because what i'm trying to do is see if what someone entered after a getn is a number or not. and if not, then i could loop it so they would have to reenter a value. thanks |
2 L A T E S T R E P L I E S (Newest First) |
thuang |
Posted - 08/31/2005 : 8:43:09 PM hmmm, so the 0/0 is sort of like NULL, thanks. but then is there a way for labtalk to tell the difference between whether if a variable became a string or a number? oh, i just looked around and it seems if you enter letters instead of numbers for getn, the variable gets assigned a "--" like just like if you left it blank. ok thanks, that clears up everything |
Mike Buess |
Posted - 08/31/2005 : 8:24:40 PM Try this in 7.5 SR5...
Help > Programming > Origin C Language Reference > Global Functions > Mathematical > is_numeric
If you're really talking about the LabTalk getn dialog just check to see if the return variable has a value...
for(i=1;i>0;) { getn (value) x (Title); if(x!=0/0) break; };
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 08/31/2005 8:31:23 PM |