Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ VBscript ➜ continue in vbscript

continue in vbscript

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Faolong   USA  (28 posts)  Bio
Date Thu 07 Nov 2002 11:53 PM (UTC)
Message
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...
Top

Posted by Faolong   USA  (28 posts)  Bio
Date Reply #1 on Thu 07 Nov 2002 11:57 PM (UTC)
Message
and oh yeah... what's the equivalent of prototypes???
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #2 on Fri 08 Nov 2002 12:35 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Faolong   USA  (28 posts)  Bio
Date Reply #3 on Fri 08 Nov 2002 12:56 AM (UTC)
Message
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...
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #4 on Fri 08 Nov 2002 02:03 AM (UTC)
Message
Not sure how to do COM objects in Jscript, but there is probably a way.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Shadowfyr   USA  (1,790 posts)  Bio
Date Reply #5 on Fri 08 Nov 2002 02:53 AM (UTC)
Message
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
Top

Posted by Faolong   USA  (28 posts)  Bio
Date Reply #6 on Fri 08 Nov 2002 04:11 AM (UTC)
Message
yeah... i have played around with activexobjects before but tell me if it has ".Execute" does it inherit that like it does in vbscript???
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #7 on Fri 08 Nov 2002 04:44 AM (UTC)

Amended on Fri 08 Nov 2002 04:45 AM (UTC) by Nick Gammon

Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


28,368 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.