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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 check for alphanumeric?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000