Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Additions to VBScript at Runtime

Status
Not open for further replies.

BHo15

Technical User
Jan 20, 2014
4
US
VERY new to VBScript (so please be patient with my ignorance).

I am looking for a way to update my script with information gleaned from the user (Inputbox) at runtime. In otherwords, on the first run of the script, the user will input some preferences, and I want the script to remember these for subsequent runs.

What is the syntax to have the script update itself?

Thanks,
Brad
 
What is the syntax to have the script update itself?

Ermm what????? [shakes off terrified shudder merely at the thought of it]

Use a separate datafile and write and read the values to and from it. You could use XML, INI file format, Comma|Colon|Bar seperated key value pairs etc. etc.




Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Thanks for the vote of confidence. :)

I actually thought of writing to a separate file, but figured their must be a way to just store variables in the script itself after the first run.

Guess I was off base on that huh?

Brad
 
You can but it's not the best idea, simply because writing the values into the script itself is recursive, and when you keep editable data and script code seperate, you lose the risk of 'breaking' the entire script if anything happens during the data save and damages the file.





Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top