Case insensitive IF> ?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1354
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Case insensitive IF> ?

Post by Dorian (MJT support) » Tue Jan 21, 2003 7:03 am

Hi Guys,

Is there a way to instruct IF> to be case insensitive?

Right now I'm having to use

IF>state=Colorado,colorado
IF>state=colorado,colorado

.. which is a bit of a pain for long lists.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Jan 21, 2003 11:30 pm

Hi,

Best way to do it is like this:

//add these two lines to top of script
VBSTART
VBEVAL
..
..
VBEval>UCase("%state%"),state
.. then you can do
If>state=COLORADO,colorado

So you have converted whatever the user has entered to uppercase.
MJT Net Support
[email protected]

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1354
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Wed Jan 22, 2003 2:09 am

Excellent! That's just the ticket! Thank you. :D

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1354
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Tue Mar 18, 2003 10:55 pm

I can't seem to get this working.

I tried :

//first 2 lines of script
VBSTART
VBEVAL

//then later
VBEval>UCase("%state%"),state

If>state=COLORADO,colorado

Which seems to give me a compilation error.

So I came up with this, which doesn't seem to work either, but doesn't give an error :


let>state=asdfg
VBSTART
state=Ucase("%state%")
VBEND
message>state

This just returns "asdfgh" in lower case.

What am I doing wrong? Apologies for being a muppet, but this is the first time I've tried integrating vbscript into a macro.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Mar 18, 2003 11:04 pm

I'm not surprised you can't get that to work - look at it a bit more closely:
Horoscopes2000 wrote:VBSTART
VBEVAL

//then later
VBEval>UCase("%state%"),state

If>state=COLORADO,colorado
1) VBEND ends a VB Block. VBEval is to evaluate VBScript functions.
2) You haven't declared 'state'

This works fine:


VBSTART
VBEND

Let>state=something
VBEval>UCase("%state%"),state
MessageModal>state
MJT Net Support
[email protected]

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1354
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Tue Mar 18, 2003 11:55 pm

Thank you, that worked perfectly. I appreciate your help.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts