Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
mack97
Posted - 10/11/2000 : 8:55:00 PM Hi,
I would like to compare string variables in
IF Keyword. (Large E and small e)
In default, Origin script mode doesn't
discriminate between E and e.
Let me know how to make letter case-
sensitive in origin script mode.
3 L A T E S T R E P L I E S (Newest First)
greg
Posted - 10/12/2000 : 8:49:00 PM Origin 6.0 SR4 and Origin 6.1 users can use new string switch( ) capabilities for more control. For example:
GetString "Enter a string";// result in %B switch(%B) { CASE "a": type -a You entered an a.; /* case sensitive */ break; case "b": CASE "c": // case and default can both be either upper or lower cases type -a You entered a 'b' or 'c'; break; #comments can be added as such also case "A": type -a You entered an A.; /* case sensitive */ break; case "A" "B" "F" to "Z": type "You entered A or B or between F and Z"; break; case 1 2 5 to 7: type You entered 1 or 2 or between 5 and 7; break; default: type "No match, this is the default case."; break; }
Note that the lexical order is:
AaBbCc...
so 'b' and 'B' would both be found by
case "A" to "C":
[This message has been edited by Greg (edited 10-12-2000).]
Jose
Posted - 10/11/2000 : 8:25:00 PM I don't find a solution for this, even not using the Asc() function, that should return the ASCII code for the character inside the brackets. It happens that
Asc(E) = Asc(e) = 69
It is really case-insensitive!
j.
Hideo Fujii
Posted - 10/11/2000 : 1:36:00 PM Hi,
Case-insensitive is the basic design of LabTalk as Jose pointed out, though I found that string serach with %[] notation CAN find a string as is in a case-sensitive way. See the sample below:
%a="E"; %b="e"; if(%[%a,'E']==e) type lower; else type CAPITAL; ; ==> CAPITAL if(%[%b,'E']==e) type lower; else type CAPITAL; ; ==> lower