Giuseppe:

> 1) How do I have multiple scripts and start only one ?

My guess is that REBOL's do finds and executes the code in the first script 
tag that says the language is REBOL.

That means no direct way of executing the nth script.....But with read and 
load/markup, you could easily write a do-nth function that would do that:

>> do-nth http://www.rebol.net/hidden-script.html 1
You just ran the hidden REBOL script!
== none
>> do-nth http://www.rebol.net/hidden-script.html 2
only  1 script(s) found


Here's a sketch for do-nth -- but note that the test for the matching scrip 
tag needs a pile of error trapping.

do-nth: func [
    target-page [url!]
    target-script [integer!]
    /local
     counter
     items
][
 counter: 0
 items: load/markup read target-page
 for nn 1 length? items 1[
    if items/:nn = <script language=rebol> [
         counter: counter + 1
         if counter = target-script [
             do load pick items nn + 1
             break
         ]
    ]
 ]
 if counter <> target-script [
    print ["only " counter "script(s) found"]
    ]
] ;; func


>  2) How could I have a button inside a web page which starts a script
>  locally, even passing some parameters ?

One way would be to have some Javascript attached to the button...I'm 
assuming Javascript can start REBOL sessions.

Sunanda.
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to