select case

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
grizlyadams
Newbie
Posts: 3
Joined: Tue Feb 03, 2009 9:05 pm

select case

Post by grizlyadams » Tue Feb 03, 2009 9:15 pm

Is there something similar to "select case" in macro scheduler ro do i need to use nested "ifs"?

Basically I have one of 7 scenarios i want o check on and make a selection (set a variable) depending on which of the 7 is true.

cheers

Griz

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Feb 03, 2009 10:36 pm

I'm not sure what you're looking for.

This example will determine the case of each character in a string.
The line Let>changedvalue={upper(%value%)} demostrates how to set text to upper case. Change "upper" to "lower" to set text to lower case.

Code: Select all


Let>testtext=QwErTy
Length>testtext,textlen
Let>kk=0
Let>answer=
Repeat>kk
  Add>kk,1
  MidStr>testtext,KK,1,value
  Let>changedvalue={upper(%value%)}
  If>%changedvalue%=%value%
    Concat>answer,%value% is upper case%CRLF%
  Else
    Concat>answer,%value% is lower case%CRLF%
  EndIf
Until>kk,%textlen%

MDL>answer

grizlyadams
Newbie
Posts: 3
Joined: Tue Feb 03, 2009 9:05 pm

Post by grizlyadams » Tue Feb 03, 2009 10:43 pm

Hi JRL - thanks for your reply - but that's not what I'm after. What I was looking for is something like this

http://www.vbtutor.net/lesson8.html

cheers

-Griz

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Feb 03, 2009 10:49 pm

Now I get it... We've discussed this before.

http://www.mjtnet.com/forum/viewtopic.php?t=3631

grizlyadams
Newbie
Posts: 3
Joined: Tue Feb 03, 2009 9:05 pm

Post by grizlyadams » Tue Feb 03, 2009 10:56 pm

thanks for that - I did search for it, honest :(

cheers

-Griz

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Feb 03, 2009 11:14 pm

No problem... glad I could help.

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