error in reading url
[1/5] from: mlist:wgs:ch at: 26-Nov-2001 21:53
Hi,
I'm new to rebol, and I'm trying to do some scripts to learn the language.
In one of my scripts, when I try to read an url inside a "func" I got a
error message:
---------------------------
** Script Error: Invalid path value: lines
** Where: open-proto
** Near: sub-port: system/words/open/lines compose [
scheme: (to-lit-word subproto)
host: either all [port/proxy/type = 'generic generic bp]
[port/proxy/host] [port/proxy/host: none port/host]
user: port/user
pass: port/pass
port-id: either all [port/proxy/type = 'generic generic bp]
[port/proxy/port-id] [port/port-id]
]
port/sub-port:
----------------------------------------
If I do the "read" outside of "func", it works well.
Do you have an idea ?
Thanx
Jul
[2/5] from: hallvard:ystad:helpinhand at: 26-Nov-2001 22:19
I'd love to finally be the helpeur, not the helpee, and this is something I work with
for the time being, but I'm afraid I can't help you much without seing the func code.
I'll be happy to look into it, though.
~H
Dixit Julien Bailly (21.53 26.11.2001):
[3/5] from: mlist:wgs:ch at: 26-Nov-2001 22:34
Ok, here's the script so far:
thanks to try :)
JUL
---------------------------------
REBOL [
Title: "SiteSearch"
Date: 26-Nov-2001
Author: "Julien Bailly"
Version: 1.0.0
]
foundurls: []
startsearch: does [
read make url! siteUrl/text
]
gui: layout [
backdrop effect [gradient 1x1 40.0.210 0.40.100]
across
vh1 "Search in Site v1.0.0" gold return
label right "Site to search in:" tab siteUrl: field return
label "Word to search for" tab word: field return
search: button "Search" [startsearch] return
label yellow "the key word has been found in the following pages:" return
urls: text-list 400x300 data foundurls [tell value openurl] return
open: button red white yellow "Open selection" [openurl] return
txt "© Julien Bailly 2001" 200.200.200
]
view gui
----------------------------------------
-----Message d'origine-----
De : [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]De la part de
Hallvard Ystad
Envoyé : lundi, 26. novembre 2001 22:19
À : [rebol-list--rebol--com]
Objet : [REBOL] Re: error in reading url
I'd love to finally be the helpeur, not the helpee, and this is something I
work with for the time being, but I'm afraid I can't help you much without
seing the func code. I'll be happy to look into it, though.
~H
Dixit Julien Bailly (21.53 26.11.2001):
[4/5] from: hallvard:ystad:helpinhand at: 27-Nov-2001 9:37
Sorry for the delai, I got distracted and then went to bed.
The problem is you redefine the word 'open, which is used to open a port when retrieving
a URL. You don't seem to use the word anywhere else, so change the line
open: button red white yellow "Open selection" [openurl] return
to either
open-it: button red white yellow "Open selection" [openurl] return
or
button red white yellow "Open selection" [openurl] return
If you want to make sure you don't make a similar mistake again, consider putting 'protect-system
in top of your script. You will then get an error (I think?) if your code redefines anything
of the sort.
~H
Dixit Julien Bailly (22.34 26.11.2001):
[5/5] from: mlist::wgs::ch at: 27-Nov-2001 13:30
Thank you :)
It works fine now.