Jump to content

Mod Tool/Scripting: Difference between revisions

m
mNo edit summary
Line 90: Line 90:


As the information is a string you need to convert it back to what it was meant originally e.g. with cBool and cInt. For more conversion see [http://www.w3schools.com/vbscript/vbscript_ref_functions.asp HERE]
As the information is a string you need to convert it back to what it was meant originally e.g. with cBool and cInt. For more conversion see [http://www.w3schools.com/vbscript/vbscript_ref_functions.asp HERE]


=====Arrays=====
=====Arrays=====
Line 101: Line 102:
To create dynamic arrays (where the amount of elements can by changed) use '''''redim''''' at all times or '''''Array''''' declaration at the beginning. ReDim clears an array. Use '''''preserve''''' to keep the old values.
To create dynamic arrays (where the amount of elements can by changed) use '''''redim''''' at all times or '''''Array''''' declaration at the beginning. ReDim clears an array. Use '''''preserve''''' to keep the old values.


  MyArr  = Array(true,false)
  ReDim MyArr (1)
  MyArr2 = Array("A","B")
  MyArr(0) = true
MyArr(1) = false
  MyArr2   = Array("A","B")
   
   
  ReDim Preserve MyArr (2)
  ReDim Preserve MyArr (2)
  ReDim Preserve MyArr2(2)
  ReDim Preserve MyArr2(2)
   
   
  MyArr(2) = true
  MyArr(2) = "C"
  MyArr (2) = true
  MyArr2(2) = "C"


[...]
[...]
8,452

edits