Select a Random word from a group of words.

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
travel88
Newbie
Posts: 15
Joined: Sun May 20, 2007 11:42 am

Select a Random word from a group of words.

Post by travel88 » Thu May 31, 2007 3:16 pm

Hi,
I need to select a Random word from a group of predefined words.

For eg:-
apple ,orange,grapes, banana

From the above I need to display any random word.

Please give the syntax to do so...


Thanks

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu May 31, 2007 4:14 pm

This sounds like a very similar topic to one discussed here very recently. Might want to check out the search feature. But, try this:

Code: Select all

Let>WordList=apple;orange;grapes;banana

Separate>WordList,;,Words

Random>Words_Count,WordNum
Let>WordNum=WordNum+1

Let>TheWord=Words_%WordNum%
MessageModal>Random Word From List: %TheWord%
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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