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
 Origin Forum
 How to make letter case-sensitive ?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

mack97

Korea
3 Posts

Posted - 10/11/2000 :  8:55:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

Hideo Fujii

USA
1582 Posts

Posted - 10/11/2000 :  1:36:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Hope it help you.

--Hideo

Go to Top of Page

Jose

Netherlands
93 Posts

Posted - 10/11/2000 :  8:25:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.

Go to Top of Page

greg

USA
1380 Posts

Posted - 10/12/2000 :  8:49:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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).]

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