forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Javascript VDS interpreter
Goto page 1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Other Product Support/Announcements
View previous topic :: View next topic  
Author Message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Jul 02, 2006 7:44 pm    Post subject: Javascript VDS interpreter Reply with quote

Just because I was bored, I created a little javascript interpreter which can execute VDS code in about every web browser. For now, only 4 of 5 functions are implemented, but I can add more in just a few hours. The same counts for commands. To control the flow of a script, labels, goto/gosub, exit/stop, if-elsif-else-end, while-wend and repeat-until commands can be used.

If I continue to develop this, would you guys think I can publish it at VDSWORLD or should I keep it private?

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Tue Jul 04, 2006 6:46 am    Post subject: Reply with quote

Be sure to check with Emmanuel about this first.

-Garrett
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Jul 04, 2006 7:05 pm    Post subject: Reply with quote

I did, but the only thing he said was something like "hmmm, nice" Rolling Eyes
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1562

PostPosted: Wed Jul 05, 2006 5:25 am    Post subject: Reply with quote

I would think it would be a nice addition to vds, simply because VDS can now be used 'cross platform' via the internet.
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Sat Jul 08, 2006 5:42 pm    Post subject: Reply with quote

I agree with PG. Looking forward to seeing what it can do.
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Jul 08, 2006 5:47 pm    Post subject: Reply with quote

I'll add some little commands like "list" and a few functions and will upload an example after that Smile
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Jul 09, 2006 9:30 am    Post subject: Reply with quote

You can download the ZIP file which comes with this post to get the (compressed) VDS interpreter. The only difference with VDS is that ALL variables start with a single %, even if you use long variable names. I don't know if I'm going to change that, but I thought it would be a little better this way Smile Also, you can use any list name you want instead of only 1 to 40 or so.

Code:
Supported functions
-------------------
@fadd(<number>, <number>)
@ask(<text>)
@count(<list>)
@diff(<number>, <number>)
@equal(<value>, <value>)
@input(<text>, <default value>)
@item(<list>, <index number>)
@text(<list>)
@unequal(<value>, <value>)

Supported commands
------------------
exit
info <text>
gosub <label>
goto <label>
if <statement>
elsif <statement>
else
end
list create, <list>
list close, <list>
list add, <list>, <value>
stop
while <statement>
wend
repeat
until <statement>


Two examples are included, one which you can use for debugging or which can work together with javascript, and one which can use <script type="Visual Dialogscript"> HTML tags.

The interpreter might be a little slow, but the javascript code could be converted to real java bytecode which speeds things up a lot!



interpreter.zip
 Description:

Download
 Filename:  interpreter.zip
 Filesize:  4.31 KB
 Downloaded:  2498 Time(s)


_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Mon Jul 10, 2006 6:27 pm    Post subject: Reply with quote

very cool! just playing with it, it has a lot of potential. Keep it going! Very Happy
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Jul 16, 2006 2:27 pm    Post subject: Reply with quote

Hey, that's cool!! I like it, keep working on it Very Happy
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon Jul 24, 2006 3:33 pm    Post subject: Reply with quote

Hi All,
I think it is very cool. I have tried it and it works pretty good. It still has some maturing to do before it is a viable alternative. I have discussed this with Skit and I am looking forward to the new commands/functions he is currently working on Wink Keep up the good work Skit.

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Mon Jul 24, 2006 8:15 pm    Post subject: Reply with quote

Becareful guys. I know Skit has mentioned this to ED, but ED I guess
didn't really say anything in reply to this. But that doesn't mean he
approves or disapproves. I'd still recommend that you keep this among
a closed group here until you do finallly get some sort of final response
from ED on it.

-Garrett
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Oct 22, 2006 12:19 pm    Post subject: Reply with quote

A little while ago, I lost the sourcecode of this project. I decompiled the compressed version which came with this post and am posting it as an attachment to this post, to prevent myself from loosing it AGAIN... Smile

I do not have much spare time, but I am planning to add more functions to this script. Also, I want to make it possible to run it on three ways: on a server, in a webbrowser and as standalone on client PCs. This way, you can run one script on every thinkable platform without needing to change it. But like I said, I don't know when I have some time to work on this.

I do have tested this code on Windows, Linux ánd Novell NetWare machines. Only for specified actions like file handling and creating dialogs, each platform has its own methods which need to be implemented one by one.



interpreter.zip
 Description:

Download
 Filename:  interpreter.zip
 Filesize:  5.99 KB
 Downloaded:  2431 Time(s)


_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Oct 26, 2006 7:14 pm    Post subject: Reply with quote

New update, this is what I got so far. I still have to do a little more input checking (like "is parameter 1 for function @sum() really an integer?") and maybe some functions don't act exactly like their VDS equivalents.

Functions

Code:
Conditional

   Done:
      - both
      - equal
      - greater
      - not
      - null
      - numeric
      - unequal
      - zero

Maths

   Done:
      - abs
      - diff
      - div
      - fadd
      - fdiv
      - fmul
      - fsub
      - pred
      - prod
      - succ
      - sum
   Todo:
      - fabs
      - fatn
      - fcos
      - fexp
      - fint
      - fln
      - format
      - frac
      - fsin
      - fsqt
      - hex
      - mod
      - random

Windows

   Done:
      - ask
      - input
      - query
      - msgbox

Lists

   Done:
      - count
      - item
      - text
      - match

Strings

   Done:
      - asc
      - chr
      - cr
      - len
      - lf
      - lower
      - pos
      - strins
      - substr
      - trim
      - upper
   Todo:
      - fill
      - strdel

Default

   Done:
      - error handling
   Todo:
      - datetime


Functions

Code:
Lists

   Done:
      - list add
      - list create
      - list clear
      - list close
      - list delete NOTE: slightly different from VDS version
      - list insert NOTE: same function as "list put"
      - list put    NOTE: slightly different from VDS version
   Todo:
      - list append
      - list assign

Windows

   Done:
      - info
   Todo:
      - dialog
      - warn

Script execution

   Done:
      - exit
      - gosub
      - goto
      - stop
   Todo:
      - error
      - option
      - timer
      - (wait [event])

Conditional

   Done:
      - if
      - elsif
      - else
      - end

Loops

   Done:
      - repeat
      - until
      - while
      - wend

Default

   Done:
      - error handling


Please note that lists DO NOT use "@index" and "list seek". I might add it when I start working on the "dialog" commands, but until that day I think it is only confusing to use an index if it isn't even visible.

Another feature added, is that you can use as much parameters as you like with some maths functions like "@fadd" and "@diff". The same goes for "@both".



Interpreter.zip
 Description:

Download
 Filename:  Interpreter.zip
 Filesize:  8.05 KB
 Downloaded:  2393 Time(s)


_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Thu Oct 26, 2006 8:25 pm    Post subject: Reply with quote

Very nice.. Looking forward to more additions!! Keep up the great work!
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Oct 28, 2006 3:25 pm    Post subject: Reply with quote

I guess I have a little too much free time this weekend. Razz

New addition to the interpreter script: the D of VDS is now supported! You can create dialogs just like how you would do it with VDS itself. Please note that due to the usage of this script in a browser window, closing a window by pressing the red X will close it right away, even before the :Close label is called. Also, styles are not supported yet.

The ZIP file with this post comes with an example of a few basic functions you can perform with the interpreter. If you want to see how to use multiple dialogs, try the code below Smile

Code:
dialog create,Test 1,10,10,200,300
dialog add,button,button1,10,10,180,280,Close me

dialog create,Test 2,10,244,200,300
dialog add,button,button2,10,10,180,280,Close me

:Evloop
wait event
goto @event()

:Button1button
dialog select,1
dialog close
goto Evloop

:Button2button
dialog select,2
dialog close
goto Evloop

:Close
goto Evloop


Note that the "dialog show" command is not used. This is because of a javascript limitation. On the other hand, this gives the ability to use the current browser window as a "host" for a VDS dialog. That way, you can add elements to the browser window in which the VDS interpreter is loaded, without having to open a new window like with the following example:

Code:
dialog add,edit,edit1,10,10,180,25,First name
dialog add,edit,edit2,40,10,180,25,Last name
dialog add,button,button1,70,10,180,25,Submit

:Evloop
wait event
goto @event()

:Button1button
info Hello @dlgtext(edit1) @dlgtext(edit2)
goto Evloop


Have fun! Smile



Interpreter.zip
 Description:

Download
 Filename:  Interpreter.zip
 Filesize:  10.81 KB
 Downloaded:  2443 Time(s)


_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Other Product Support/Announcements All times are GMT
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group