Windows Server 2000/2003 Thread, Learning Scripting in Technical; Do you have any programming knowledge at all?
Without meaning to sound annoying... could be worth while learning the basis ...
24th February 2010, 10:47 AM #16
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.
24th February 2010, 10:58 AM #17
[ame=http://en.wikipedia.org/wiki/Pseudocode]Pseudocode - Wikipedia, the free encyclopedia[/ame]
24th February 2010, 11:00 AM #18
I meant to attach that, haha! Yes, Wikipedia and pseudocode was a great help :-)
24th February 2010, 09:27 PM #19
- Rep Power
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!
24th February 2010, 09:39 PM #20
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
24th February 2010, 09:51 PM #21
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)
24th February 2010, 09:58 PM #22
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
By speckled in forum Scripts
Last Post: 22nd November 2009, 09:09 AM
By mac_shinobi in forum Mac
Last Post: 22nd August 2008, 10:30 AM
By stu in forum How do you do....it?
Last Post: 26th June 2008, 07:47 PM
By dave.81 in forum How do you do....it?
Last Post: 23rd April 2008, 01:50 PM
By FN-GM in forum Scripts
Last Post: 10th August 2007, 11:31 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)