A
A
Artyom2019-01-31 12:53:45
VBScript
Artyom, 2019-01-31 12:53:45

How to assign a random value to a variable from a given list in vbs?

I have a list for example:
January
February
March
April
May
June
July
August
September
October
November
December
How do I make the variable here = a random month from the list?
Is it possible to do this in vbs?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Emil Revencu, 2019-01-31
@fishmen

Randomize
z=array("January","February","March","April","May","June","July","August","September","October","November","December")
index=int(rnd*12)
if index>11 then index=11
wscript.echo z(index)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question