Do you have any programming knowledge at all?
Without meaning to sound annoying... could be worth while learning the basis of things like variables, constants, functions, loops, conditional statements & data types first... it may make it easier to understand what is going on rather than diving in - the best site i found at uni was learning pseudocode... i found it easier to then 'visualise' the code if that makes any sense.
[ame=http://en.wikipedia.org/wiki/Pseudocode]Pseudocode - Wikipedia, the free encyclopedia[/ame]
I meant to attach that, haha! Yes, Wikipedia and pseudocode was a great help :-)
i did a years worth of vb whilst at college so i have an idea about variables constants, loops etc but its well worth me having a look over them again and having a look at that site.
Cheers for that!
not to side track as I have used constants but what is the point of them ie
As apposed to
const strShareOne = "HP_Colour"
MapPath "\\server\" & strShareOne
Obviously am making the commands up but just to give you an idea
Unless someone can post back a good example of when and why you would use constants whether in vbscript, vb .net or whatever
There's 2 reasons really - the first is about the fact that it's something that you might want to use loads of times and you don't want to have to change the value throughout the script. The second is the fact that you're saying that the value can't be changed - this avoids making errors where you accidentally change something.
Take an example, you're writing a script which is going to connect printers on a server. Let's suppose the server is called server1. You could list all your printers as "\\server1\printer1" "\\server1\printer2" etc but then when you get a new server you have to change all those references. If you have const sServer="\\server1\" at the beginning and then lines like mapprinter sSever & "printer1" then all you have to do is update the const value at the start.
It can also make scripts more readable - you don't get bogged down in long string literals but you have a meaningful name (although that's also true for using variable names)
I did something like that for a printer script I did on here somewhere where I used const values for the share names as the print server was only one server so I made the share names const values.
Originally Posted by srochford
Thanks for the clarification