The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 check for alphanumeric?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

thuang

USA
Posts

Posted - 08/31/2005 :  8:01:40 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Mike Buess

USA
3037 Posts

Posted - 08/31/2005 :  8:24:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

thuang

USA
Posts

Posted - 08/31/2005 :  8:43:09 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000