continue in vbscript

Posted by Faolong on Thu 07 Nov 2002 11:53 PM — 8 posts, 35,760 views.

USA #0
ahhh... just changing my whole script from jscript to vbscript and i was wondering what the equivalent of continue is in jscript for vbscript... i am using continue in for loops to kind of "skip" the step and go to the next step (if you know what i mean).... and i think Exit For is not what i am looking for because that just breaks the whole loop...
USA #1
and oh yeah... what's the equivalent of prototypes???
Australia Forum Administrator #2
Looks like there is no equivalent to continue, better make an if.

No equivalent for prototypes.

Why change to VBscript? If you write plugins they can be in any language. One instance of MUSHclient can have plugins in different languages.
USA #3
hmmm i want to implement a database of items and their attribs in ms access into my script... it was one of the last things i wanted to do and now that i am at the end of the script and you have given an example of how to do it, it seems like a good time to do it... but then i can't seem to find "db.Execute (....)" for jscript and i really don't want to do a plugin in vbscript for it... i am trying to do it all in one plugin so it's all centralize... i even thought of doing it in .cvs file before but an access db seems a little bit more pleasing... and i also want to do like input boxes which jscript doesn't have (can live without it though) but if you tell me what the equivalent of db.Execute for jscript is... then it's all good...
Australia Forum Administrator #4
Not sure how to do COM objects in Jscript, but there is probably a way.
USA #5
Try..

var handle = new ActiveXObject("ObjectName");

Basically the same as in VB, but using 'new' instead of 'CreateObject'. Imho it would have been less confusing if vbscript had used 'new' as well, but... lol
USA #6
yeah... i have played around with activexobjects before but tell me if it has ".Execute" does it inherit that like it does in vbscript???
Australia Forum Administrator #7
Yes, I just got this snippet to work in the Immediate window (in Jscript):



var handle = new ActiveXObject("ADODB.Connection");

handle.open ("Provider=Microsoft.Jet.OLEDB.4.0;" +
             "Data Source=" +
             "C:\\program files\\mushclient\\worlds\\mushclient_db.mdb;" +
             "Jet OLEDB:Engine Type=5;");

handle.execute ("create table nick (field int not null identity)");

delete handle;


The double backslashes are so that the backslash makes it through to the string.