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.
Case insensitive IF> ?
Moderators: JRL, Dorian (MJT support)
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
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.
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]
[email protected]
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
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.
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.
I'm not surprised you can't get that to work - look at it a bit more closely:
2) You haven't declared 'state'
This works fine:
VBSTART
VBEND
Let>state=something
VBEval>UCase("%state%"),state
MessageModal>state
1) VBEND ends a VB Block. VBEval is to evaluate VBScript functions.Horoscopes2000 wrote:VBSTART
VBEVAL
//then later
VBEval>UCase("%state%"),state
If>state=COLORADO,colorado
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]
[email protected]
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am