What is the deal with VBArray and wildcard? Ive been searching the forums, and most people who post scripts have something like that in their script, even the people using jscript (which I use, coming from C). Can anyone give me the run-down on VBArray and wildcards? Thanks.
What is this VBArray(wildcards).toArray() that I see everywhere?
Posted by Phatj on Sun 23 Feb 2003 02:35 PM — 3 posts, 13,119 views.
Oh and one more question... can anyone refer me to a help file on using delays with Jscript... or just post some help here? Thanks.
The arrays sent to scripts, like arrays of wildcards, are the "variant" data type which is really a Microsoft-specific data type. It is a multi-purpose data type, where there is a byte that says what it is (eg. number, string, date, array etc.) and then the data itself.
It matches up well with VBscript which also uses variant data type internally, thus in VBscript you don't need to do the toArray.
However JScript (Java script) which is not really a proprietary Microsoft product, does not directly understand variant arrays, so you need to do the toArray function that converts from a VB array to a Jscript array.
As for delays, there are many, many posts about that. You want to make your script delay for a second? You don't want to do that directly, because it would hang the client. Search for posts about things like:
world.DoAfter (5, "go north");
This would send "go north" after 5 seconds.
It matches up well with VBscript which also uses variant data type internally, thus in VBscript you don't need to do the toArray.
However JScript (Java script) which is not really a proprietary Microsoft product, does not directly understand variant arrays, so you need to do the toArray function that converts from a VB array to a Jscript array.
As for delays, there are many, many posts about that. You want to make your script delay for a second? You don't want to do that directly, because it would hang the client. Search for posts about things like:
world.DoAfter (5, "go north");
This would send "go north" after 5 seconds.