[REBOL] http request

2000-04-14 Thread Markus . Zmija

I would like to analyse a dynamic web page by a rebol script. to read the
web page  I have to call a cgi-script which uses the 'POST' method.
But I don't how to set the required arguments in the ENV$ variable of the
http request .

I think I have to modify the http settings defined in system/schemes/http,
but there is no documentation in the rebol user-manual how to do this.

can anybody help me?

Markus Zmija




[REBOL] Parse Re:

2000-04-14 Thread lmecir


- Puvodní zpráva -
Od: [EMAIL PROTECTED]
Komu: [EMAIL PROTECTED]
Odesláno: 13. dubna 2000 18:11
Predmet: [REBOL] Parse


 How would I parse such that

 ThisIsTheLine


 would result in:

 This Is The Line.


 Larry


Hi, here is my version:

char: [skip]
capit: charset "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
non-cap: complement capit
word: [char any non-cap]
parsed: copy []
parse/case "ThisIsTheLine" [any[copy wrd word (append parsed
wrd)]]
 parsed
== ["This" "Is" "The" "Line"]

Regards,
Ladislav





[REBOL] Removing lines... Re:(2)

2000-04-14 Thread stefan . falk

Hi,
Uhm.. yeah, but where's the attachment? =)

//Best Regards
Stefan Falk


 -Original Message-
 From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
 Sent: Thursday, April 13, 2000 5:55 PM
 To:   [EMAIL PROTECTED]
 Subject:  [REBOL] Removing lines... Re:
 
 Hi Stefan:
   I have attached a file called "remove.r". It has
 two functions that were provided to me by other members
 of the mailing list. Perhaps there are others that
 would find it useful. The first one is the one that I
 was looking for. It will replace text between two markers,
 so that it has the effect of rewriting a record in a simple
 database.
 I hope you find this helpful.
 Regards
 Tim
 At 10:55 AM 4/13/00 +0200, you wrote:
 Hi list,
 I've read a textfile with read/linesis there an easy way to remove a
 line from the data?
 
 it goes something like:
 
 data: read/lines %blaah.txt
 
 if find data "plupp" [remove the line] --- of course there oughta be
 some
 easy code there.. ;)
 
 Best Regards
 Stefan Falk
 
 




[REBOL] Parse Re:(2)

2000-04-14 Thread bhawley

Hi all!

Larry asked:
  How would I parse such that
  
  ThisIsTheLine
  
  
  would result in:
  
  This Is The Line.
 

Using parse, try this ...

the-line: "ThisIsTheLine"
big-alpha: charset [#"A" - #"Z"]
tmp: none
parse/all/case the-line [
skip  ; Skip the first character
any [to big-alpha tmp: skip (insert tmp " ")]
to end  ; Not really needed here
]
print the-line


Andrew answered:
 I know, it doesn't use 'parse, but this way was more obvious...
 
 [
 REBOL [
  ]
 
 Line: "ThisIsTheLine"
 
 Split: function [Line [string!]] [Result] [
  Result: make string! 0
  foreach C Line [
   if any [
C == #"A"
C == #"B"
C == #"C"
C == #"D"
C == #"E"
C == #"F"
C == #"G"
C == #"H"
C == #"I"
C == #"J"
C == #"K"
C == #"L"
C == #"M"
C == #"N"
C == #"O"
C == #"P"
C == #"Q"
C == #"R"
C == #"S"
C == #"T"
C == #"U"
C == #"V"
C == #"W"
C == #"X"
C == #"Y"
C == #"Z"
] [
if not empty? Result [
 append Result " "
 ]
]
   append Result C
   ]
  Result
  ]
 
 print Split Line
 
 ]
 
  do %line.r
 This Is The Line

Procedurally, try this ...

the-line: "ThisIsTheLine"
tmp: next the-line
forall tmp [
if find/case "ABCDEFGHIJKLMNOPQRSTUVWXYZ" first tmp [
tmp: insert tmp " "
]
]
print the-line

... or this (faster) ...

the-line: "ThisIsTheLine"
big-alpha: charset [#"A" - #"Z"]
tmp: the-line
while [tmp: find/case next tmp big-alpha] [tmp: insert tmp " "]
print the-line


Do these help?
--
Brian Hawley




[REBOL] hash

2000-04-14 Thread FSubr

hi,
is there anybody who can explain me hash value.
what it is used for, how it works etc.

thanks
filip subr





[REBOL] Books and such Re:(2)

2000-04-14 Thread porterpa

The URL you give provides an "Access Denied" error.

From: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [REBOL] Books and such Re:
Date: Fri, 14 Apr 2000 0:16:28 +

Snip...
In the meantime, download the REBOL dictionary and user's guide in .pdf
format from The BeOS Journal at http://www.beosjournal.com/rebol/
rebolpdf.zip

Enjoy.

-Ryan


 Are there any books or other printed material for Rebol?
 Something that can help someone with minimal programming experience?


__
Get Your Private, Free Email at http://www.hotmail.com




[REBOL] AW: [REBOL] Books and such Re:(2)

2000-04-14 Thread Markus . Zmija

it is a direct link to the document! 
please try:  http://www.beosjournal.com/rebol/rebolpdf.zip

 -Ursprüngliche Nachricht-
 Von:  [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
 Gesendet am:  Freitag, 14. April 2000 09:57
 An:   [EMAIL PROTECTED]
 Betreff:  [REBOL] Books and such Re:(2)
 
 The URL you give provides an "Access Denied" error.
 
 From: [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [REBOL] Books and such Re:
 Date: Fri, 14 Apr 2000 0:16:28 +
 
 Snip...
 In the meantime, download the REBOL dictionary and user's guide in .pdf
 format from The BeOS Journal at http://www.beosjournal.com/rebol/
 rebolpdf.zip
 
 Enjoy.
 
 -Ryan
 
 
  Are there any books or other printed material for Rebol?
  Something that can help someone with minimal programming experience?
 
 
 __
 Get Your Private, Free Email at http://www.hotmail.com




[REBOL] http request Re:

2000-04-14 Thread kracik

Hi,

If I understand correctly, you want to retrieve a dynamic web page with
HTTP POST method. REBOL's built-in HTTP protocol uses GET method only,
so you should not modify it. But you can build and send a simple POST
request with TCP protocol. There is an example http-post.r at rebol.org.

There's another possibility. Many CGI scripts accept both GET and POST
methods, and detects automatically which one it is. So you can look at
form field names of the HTML form that leads to the script, encode the
names and values in the URL in your browser and try it.

-- 
Michal Kracik

[EMAIL PROTECTED] wrote:
 
 I would like to analyse a dynamic web page by a rebol script. to read the
 web page  I have to call a cgi-script which uses the 'POST' method.
 But I don't how to set the required arguments in the ENV$ variable of the
 http request .
 
 I think I have to modify the http settings defined in system/schemes/http,
 but there is no documentation in the rebol user-manual how to do this.
 
 can anybody help me?
 
 Markus Zmija




[REBOL] 'open bugs?

2000-04-14 Thread Petr . Krenzelok

Hi,

my friend wanted me to write some small script and I am having some
troubles with 'open function

1)
- my-file: open %/G/non-existant-file.exe
- insert my-file "ahoy"
- close my-file

How's that open opens new file without usage of /new refinement?

2) I have rebol.exe on some path and once my loop get's to rebol.exe, it
fails:

- ble: open %/G/Work/REBOL/REBOL.exe
** Access Error: Cannot open /G/Work/REBOL/REBOL.exe.
** Where: ble: open %/G/Work/REBOL/REBOL.exe

I looked at serve console and noone has REBOL.exe on above path opened
(as noone except my office folks has access to it). Is it some special
case rebol refuses open it's own executable? :-)

Well, maybe I am just missing something 

btw: I hope open/exclusive will come in some of future REBOL versions
...

-pekr-




[REBOL] 'open bugs? Re:

2000-04-14 Thread jimg

Hi Petr,

Open opens for reading and writing by default. When a program is executing, 
there is a handle open to it for loading resources/overlays. So, if you try 
to open it for write, it fails. However, you can open it for reading only 
by using open/read. Hope this clears it up for you!

  - jim

At 05:27 AM 4/14/2000, you wrote:
Hi,

my friend wanted me to write some small script and I am having some
troubles with 'open function

1)
- my-file: open %/G/non-existant-file.exe
- insert my-file "ahoy"
- close my-file

How's that open opens new file without usage of /new refinement?

2) I have rebol.exe on some path and once my loop get's to rebol.exe, it
fails:

- ble: open %/G/Work/REBOL/REBOL.exe
** Access Error: Cannot open /G/Work/REBOL/REBOL.exe.
** Where: ble: open %/G/Work/REBOL/REBOL.exe

I looked at serve console and noone has REBOL.exe on above path opened
(as noone except my office folks has access to it). Is it some special
case rebol refuses open it's own executable? :-)

Well, maybe I am just missing something 

btw: I hope open/exclusive will come in some of future REBOL versions
...

-pekr-





[REBOL] 'open bugs? Re:(2)

2000-04-14 Thread Petr . Krenzelok



[EMAIL PROTECTED] wrote:

 Hi Petr,

 Open opens for reading and writing by default. When a program is executing,
 there is a handle open to it for loading resources/overlays. So, if you try
 to open it for write, it fails. However, you can open it for reading only
 by using open/read. Hope this clears it up for you!

Aha, so before trying to open possibly non existant file I have to check it's
existence by 'exists?, right? Well, what's /new refinement good for then?

-pekr-



   - jim

 At 05:27 AM 4/14/2000, you wrote:
 Hi,
 
 my friend wanted me to write some small script and I am having some
 troubles with 'open function
 
 1)
 - my-file: open %/G/non-existant-file.exe
 - insert my-file "ahoy"
 - close my-file
 
 How's that open opens new file without usage of /new refinement?
 
 2) I have rebol.exe on some path and once my loop get's to rebol.exe, it
 fails:
 
 - ble: open %/G/Work/REBOL/REBOL.exe
 ** Access Error: Cannot open /G/Work/REBOL/REBOL.exe.
 ** Where: ble: open %/G/Work/REBOL/REBOL.exe
 
 I looked at serve console and noone has REBOL.exe on above path opened
 (as noone except my office folks has access to it). Is it some special
 case rebol refuses open it's own executable? :-)
 
 Well, maybe I am just missing something 
 
 btw: I hope open/exclusive will come in some of future REBOL versions
 ...
 
 -pekr-




[REBOL] Removing lines... Re:(3)

2000-04-14 Thread tjohnson

At 09:43 AM 4/14/00 +0200, you wrote:
Hi,
Uhm.. yeah, but where's the attachment? =)

//Best Regards
Stefan Falk


 -Original Message-
 From:[EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
 Sent:Thursday, April 13, 2000 5:55 PM
 To:  [EMAIL PROTECTED]
 Subject: [REBOL] Removing lines... Re:
 
 Hi Stefan:
  I have attached a file called "remove.r". It has
 two functions that were provided to me by other members
 of the mailing list. Perhaps there are others that
 would find it useful. The first one is the one that I
 was looking for. It will replace text between two markers,
 so that it has the effect of rewriting a record in a simple
 database.
 I hope you find this helpful.
 Regards
 Tim
 At 10:55 AM 4/13/00 +0200, you wrote:
 Hi list,
 I've read a textfile with read/linesis there an easy way to remove a
 line from the data?
 
 it goes something like:
 
 data: read/lines %blaah.txt
 
 if find data "plupp" [remove the line] --- of course there oughta be
 some
 easy code there.. ;)
 
 Best Regards
 Stefan Falk
 
 



REBOL
[
  Title:  "Test File Insertion"
  Date:   9-Feb-2000
  Author: "Tim Johnson via Ladislav and others"
  Email:  [EMAIL PROTECTED]
  File:   %Remove.r
  Purpose:{To test removing text from a block}
]
remove-text: func
  [fp1[file!] ins_series[series!] begin_marker[string!] end_marker[string!]]
[
  ;insert_txt: ["first new line" "second new line" "third new line"]
  fp: open/lines fp1
  remove_flag: false
  lines-done:  0
  while[not tail? fp];test for end of block
  [
if find first fp begin_marker   ;"begin insert here"
  [remove_flag: true]  ;prepare to insert but pointer must move to next
either remove_flag ;we will now remove nodes from fp
[
  either find first fp end_marker ;"end insert here" ; check for end marker
  [
remove_flag: false  ; turn flag off
foreach txt ins_series  ; insert the new series
  [fp: insert fp txt]
fp: next fp ; and proceed read/write
  ]
  [ {else}
either zero? lines-done  ; begin insertion
[
  lines-done: 1
  fp: next fp
]
[{else} remove fp]
  ]
]
[{else} fp: next fp]
  ]
  update fp
  close fp
]
insert_txt: ["first new line" "second new line" "third new line"]
begin_marker: "begin insert here"
end_marker: "end insert here"
nfile: "test.txt"
file_name:  make file! nfile
print file_name
remove-text file_name insert_txt begin_marker end_marker

;file begins here
;!--begin insert here--
;original line one
;original line two
;original line three
;!--end insert here--
;file ends here
replace-text: func [
fp [file!] "text file with lines to be updated"
rp [file!] "text file holding lines to be inserted"
][
fp: open/lines fp
rp: read/lines rp
lines_removed:  0
lines_inserted: 0
while [ not tail? fp ] [
if find first fp "begin replace here" [
print "found"
fp: next fp
lines_inserted: lines_inserted + length? rp
fp: insert fp rp
while [all [
not tail? fp
not find first fp "end replace here"
]][
lines_removed: lines_removed + 1
remove fp
]
break
]
fp: next fp
]
print [lines_removed "lines removed"]
print [lines_inserted "lines inserted"]
update fp
close fp
]







[REBOL] Dumb Question Re:

2000-04-14 Thread icimjs

At 06:33 PM 4/14/00 -0400, you wrote:
I installed Rebol on a Slackware system in its own directory under
/usr/local/src. I made a link to it from /usr/local/bin.
At the command line, I typed 'export REBEL_HOME=/usr/local/src/rebol'


Perhaps replacing

export REBEL_HOME=/usr/local/src/rebol

by 

export REBOL_HOME=/usr/local/src/rebol

will help (note the capital O instead of the second capital E)?





;- Elan  [: - )]