[REBOL] Multipart emails Re:(2)

2000-03-08 Thread dimial

 
 I did some work for a multipart/form-data decoder; it needs some
 work for more generic MIME handling, but if you are interested...
 
 Ciao,
 /Gabriele./


Gabriele, can this decoder handle form-posted data?
If yes (or if you think it could, with some changes) can I please have it?
(I need to use forms to post files)


Dimitris Lambadas
MAGNET INTERNET SERVICES
8, G. Palama Str.
GR-546 22 Thessaloniki
Tel.-Fax : ++3031-260252
e-mail: [EMAIL PROTECTED]






[REBOL] security-requester a risk?

2000-03-08 Thread VoToNi

When rebol asks for lowering security, it makes "yes" the default.
a occasionaly return gives free way.
i think "no" should be the default, at least as an %user.r-option?

Volker



[REBOL] communicate with program with stdin/stdout - end markers?

2000-03-08 Thread VoToNi

I want to communicate with another program with stdin/stdout.
i need a way to detect the end of a message,
and i want to use the normal print/input.
since a data-string can contain my end-marker,
i have to mask it out.
Can this protocoll-stuff be used to generate a filter
for the normal stdin/stdout to do this? and how?

Volker



[REBOL] Freenet Protocol help needed, was closing port within protocol Re:(2)

2000-03-08 Thread ingo

Hi Gabriele,

I didn't get it to work, I get an error, when I try to open 
the listen port

Trace:  system/words/open (path)
Trace:  tcp://:0 (url)
opening: tcp://:0
** Access Error: Trace:  "Error opening socket" (string)
Trace:  :arg1 (get-word)
Error opening socket listen port.
** Where: read freenet://localhost:1797/Hi

I _think_ I've made the changes right ...

Oh, and by the way, yes I am interested to know how to
use 'copy refinements (if ever I get it to run ... :-)


thank you,

Ingo

Those were the words of [EMAIL PROTECTED]:
 Hello [EMAIL PROTECTED]!
 
 On 29-Feb-00, you wrote:
 
  i If someone knows what to do about it, please let me know.
 
 Just some ideas, let me know if it works:
... 

--  _ ._
ingo@)|_ /|  _| _  We ARE all ONE   www._|_o _   _ ._ _  
www./_|_) |o(_|(/_  We ARE all FREE ingo@| |(_|o(_)| (_| 
http://www.2b1.de/Rebol/ ._|  ._|



[REBOL] Run commands in NT

2000-03-08 Thread guity

Hi ...

Everyone know somethig about run commands in NT inside a REBOL script ...  I need make 
a "at" command in the DOS's consola and i don't know ... Is it
posible???

Please,

Regards

David Guitian



[REBOL] Money Trouble? Re:(2)

2000-03-08 Thread lmecir

Hi,

I want to present a different point of view. My experiences are,
that the binary representation is as good as the BCD for the
accounting purposes. I do have an accounting program in Rebol
using Decimal! as its basic type.

If you want to be exact, you shall always be careful of what you
are doing and BCD can be no replacement for brains eg in Euro
conversions (three or more decimal digits are needed for
intermediate results) or some average computations.

The BCD is more convenient only in the cases where the operations
don't
yield results with infinite number of decimal places, or results
with more decimal places, than the program should process. For
the more complicated cases it's simply the programmer's task to
take care.

a part of my accounting program:

round: func ["Round a number"
n [number!]
p [integer!] {Decimal places - can be negative}
/local factor r
] [
factor: 10 ** (- p)
n: 0.5 * factor + n
n - either negative? r: n // factor [factor + r] [r]
]

add-m: func [a [number!] b [number!]] [
round a + b 2
]

sub-m: func [a [number!] b [number!]] [
round a - b 2
]

(the above doesn't mean, that I consider the "rounding" of Money!
values in Rebol to be correct)

Just my $0,021
Ladislav

 Thanks for defending my cause ! I already posted some messages
on this
 subject but I didn't found a so obvious sample to show the error
of using
 binary when dealing with money.

 I'm lobbying for a decimal internal format for money! values, as
in COBOL:
 REBOL and COBOL should have more than three letter in common !

 Olivier.

 - Original Message -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Monday, March 06, 2000 7:15 PM
 Subject: [REBOL] Money Trouble?


  Hi folks,
 
  Over the weekend I was playing with the REBOL money! datatype
and
 discovered
  some problems. Using the REBOL/Core console:
 
   x: $10
  == $10.00
 
   y: x + .01
  == $10.01
 
   y - x
  == $0.00 ;surprising result, displayed value is
not correctly
  rounded
 
  We can check what is happening by retreiving the decimal value
from the
  money values:
 
   dx: second x
  == 10
 
   dy: second y
  == 10.01
 
   dy - dx
  == 9.79E-3 ;this is the actual numeric value
of y - x, it
  should round to .01
 
  The problem seems to be incorrect or absent rounding of the
difference:
 
   to-money dy - dx
  == $0.00
 
  Checking when to-money will return .01 vs .00:
 
   a: to-money "9.99934E-3"
  == $0.00
   b: to-money "9.99935E-3"
  == $0.01
 
  Clearly both of these values should round to $.01.
 
  There some other anomalies also:
 
   (y - x) * 1.01
  == $0.00
 
   (y - x) * 1.1
  == $0.01
 
   (y - x) * 10;displayed result is wrong by a
factor of
 ten
  == $0.01
 
   (y - x) * 100  ;displayed result is correct
  == $1.00
 
  These problems are not due to the round-off intrinsic to
decimal values.
  Even in the worst case we have 15 significant digits of
precision. The
  example shows incorrect rounding in the 4th significant digit.
 
  I wonder whether others have noticed this problem?
 
  Note: this has been CC'd to feedback as a bug.
 
  Cheers
 
  Larry
 
 







[REBOL] dynamic word names 2

2000-03-08 Thread RChristiansen

What if I want to append a dynamically created word with a value that 
belongs to a word the representation of which must also be dynamically 
created in the script?

Assume an earlier script created the following word values:

lineword1: {hello}
lineword2: {good morning}
lineword3: {good day}

Now I want to append them in order to the word "messagebuilder."

The value of "count" is the total number of "lineword" word values with a 
numeral appendage.

How can I accomplish what lies within the parenthesis?

for build 1 count 1 [
append messagebuilder (with the value of a dynamically created word)
]

Thanks.

-Ryan

 If I understand right, you want to dynamically create words and assign a
 (changing) value to them. If you want to append, just replace the "set"
 (below) with "append".
 
 foreach line page [
  count: count + 1
  set to-word rejoin ["linewords" count] line
 ]




[REBOL] dynamic word names 2 Re:

2000-03-08 Thread VoToNi

In einer eMail vom 08.03.00 19:11:18 (MEZ) Mitteleuropäische Zeit schreibt 
[EMAIL PROTECTED]:

 What if I want to append a dynamically created word with a value that 
  belongs to a word the representation of which must also be dynamically 
  created in the script?
  
  Assume an earlier script created the following word values:
  
  lineword1: {hello}
  lineword2: {good morning}
  lineword3: {good day}
  
  Now I want to append them in order to the word "messagebuilder."
  
  The value of "count" is the total number of "lineword" word values with a 
  numeral appendage.
  
  How can I accomplish what lies within the parenthesis?
  
  for build 1 count 1 [
   append messagebuilder (with the value of a dynamically created word)
  ]
  
  Thanks.
  
  -Ryan
  
do (with the value of a dynamically created word) ?

 a: "print 1 + 1"
== "print 1 + 1"
 do a
2


Volker

Volker



[REBOL] dynamic word names 2 Re:(2)

2000-03-08 Thread RChristiansen

This is what I am thinking of...

michael-info: ""
count: 1
michael1: "employment: truck driver"

a: {rejoin ["michael" count]}

append michael-info (with the value of michael1)

How do I do this?

Thanks.

-Ryan

 do (with the value of a dynamically created word) ?
 
  a: "print 1 + 1"
 "print 1 + 1"
  do a
 2




[REBOL] solved: dynamic words 2

2000-03-08 Thread RChristiansen

got it!

appending the value of a dynamically created word name to a word...

count: 50
out: make string! 1000

for build 1 count 1 [
builder: reform ["messagebuilder:" rejoin ["message" build]]
do builder
append out messagebuilder
]


"reform" was the missing link.  thanks for directing me to use "do."

-ryan



[REBOL] filtering by to

2000-03-08 Thread tf

filtering by "to"

howdy guys,

okey dokey. I'd like to write mail to standard mailbox files (like in
the example, "mailboxsave.r") only I want to send mail to a different
file depending on who it's to. 

I use a slightly modified mailboxsave.r all the time, but can't seem
to work a filter into it...

see ya,

-t



[REBOL] Some niggley things

2000-03-08 Thread ddalley


Hello, Rebols:

#1
files: READ %. gets the current directory, but how do we do it with a
set-word? Example:

   directory: %/partition/drawer/drawer
   files: READ %directory(how to deal with "."?)

doesn't work because (among a few things) it tries to read the current
directory. I don't want to use CHANGE-DIR because then REBOL persists to look
at that drawer, which is *very* annoying when trying to re-run the program.

#2
"files" (above) will, eventually, be a block of about 300 file names. I need
to know how to take five file names at a time and make a string that is:
"name+name+name+name+name", to add to a URL.

I didn't see an example of how to parse a string in this way (take five
elements at a time until the end of block), nor did I see how to efficiently
make a string using a repeated separator.

Do I need to deal with the end of the block or is it automatic?

-- 

---===///||| Donald Dalley |||\\\===---
 The World of AmiBroker Support
  http://webhome.idirect.com/~ddalley
  UIN/ICQ#: 65203020



[REBOL] return statement Re:

2000-03-08 Thread icimjs

Hi Phil,


1. As a matter of principle REBOL lets you modify the value of each and
every word. There are no keywords. This is good.

2. To protect all words that are part of the REBOL vocabulary use the
built-in function
protect-system.

3. To protect selected words (here return) use the function protect, as in 

 protect 'return
 return: none
** Script Error: Word return is protected, cannot modify.
** Where: return: none

You can have it your way without limiting REBOL's flexibility.

At 10:22 PM 3/7/00 +, you wrote:
Consider the following code :

REBOL []
; Check function
check1: function [] []
[
x: "A"
if x  none [return "Error"]
print "This should not print"
return none
]
print check1


does not print the text (correctly).

However adding the line
return: "Error"

gives
REBOL []
; Check function
check1: function [] []
[
return: none
x: "A"
if x  none [return "Error"]
print "This should not print"
return none
]
print check1

does print the text
(I accidentally added this line to a sub-function, instead of return none,
and it took me ages to track this down)

Shouldn't progress stop us setting variables like return: ???

Cheers Phil




;- Elan  [: - )]



[REBOL] solved: dynamic words 2 Re:

2000-03-08 Thread VoToNi

In einer eMail vom 08.03.00 23:28:20 (MEZ) Mitteleuropäische Zeit schreibt 
[EMAIL PROTECTED]:
   builder: reform ["messagebuilder:" rejoin ["message" build]]
   do builder
messagebuilder: do rejoin ["message" build]
should work to? 
But knowing how to reform is never wrong :-)

 got it!
  
  appending the value of a dynamically created word name to a word...
  
  count: 50
  out: make string! 1000
  
  for build 1 count 1 [
   builder: reform ["messagebuilder:" rejoin ["message" build]]
   do builder
   append out messagebuilder
  ]
  
  
  "reform" was the missing link.  thanks for directing me to use "do."
  
  -ryan
  


Volker



[REBOL] Some niggley things Re:

2000-03-08 Thread VoToNi

In einer eMail vom 09.03.00 02:48:04 (MEZ) Mitteleuropäische Zeit schreibt 
[EMAIL PROTECTED]:

 
  Hello, Rebols:
  
  #1
  files: READ %. gets the current directory, but how do we do it with a
  set-word? Example:
  
 directory: %/partition/drawer/drawer
 files: READ %directory(how to deal with "."?)
  
  doesn't work because (among a few things) it tries to read the current
  directory. I don't want to use CHANGE-DIR because then REBOL persists to 
 look
  at that drawer, which is *very* annoying when trying to re-run the program.

files: READ directory; no %! type? directory is file..
maybe use %path/ to say you mean directories (at least here(windows)).

  
  #2
  "files" (above) will, eventually, be a block of about 300 file names. I 
need
  to know how to take five file names at a time and make a string that is:
  "name+name+name+name+name", to add to a URL.
  
  I didn't see an example of how to parse a string in this way (take five
  elements at a time until the end of block), nor did I see how to 
efficiently
  make a string using a repeated separator.
  
  Do I need to deal with the end of the block or is it automatic?
  
print "..the c way"
a: [ 1 2 3 4 5 6 7 ]
until[
n: min length? a 2
for i 1 n 1 [
prin first a
a: next a
]
print []
tail? a
]
print "..the rebol way?"
a: head a
until[
b: copy/part a 2
foreach i b [ prin i ]
print []
a: skip a 2
tail? a
]


  -- 
  
  ---===///||| Donald Dalley |||\\\===---
  


Volker



[REBOL] Some niggley things Re:

2000-03-08 Thread icimjs

Hi Donald,

perhaps I'm misunderstanding something. But ...
#1
files: READ %. gets the current directory, but how do we do it with a
set-word? Example:

   directory: %/partition/drawer/drawer
   files: READ %directory(how to deal with "."?)

doesn't work because (among a few things) it tries to read the current
directory. I don't want to use CHANGE-DIR because then REBOL persists to look
at that drawer, which is *very* annoying when trying to re-run the program.

It appears to me that you are trying to read the directory located at
%/partition/drawer/drawer ?

Under windows I can read the directory saying:

files: read /drive/folder/folder/

such as in

 directory: %/d/temp/
== %/d/temp/
 files: read directory
== [%save_NewFrames/ %funky/ %tcl-v7/ %snapshots/ %lynx_w32_2_8_2 ...



#2
"files" (above) will, eventually, be a block of about 300 file names. I need
to know how to take five file names at a time and make a string that is:
"name+name+name+name+name", to add to a URL.

One possibility would be:

 files: [%a %b %c %d %e %f %g %h %i %j]
 foreach [f-1 f-2 f-3 f-4 f-5] files [ 
  print mold to string! 
 reduce [f-1 "+" f-2 "+" f-3 "+" f-4 "+" f-5] ]

which results in:

"a+b+c+d+e"
"f+g+h+i+j"


Hope this helps,


;- Elan  [: - )]



[REBOL] Some niggley things Re:(2)

2000-03-08 Thread ddalley


Hello, Elan:

On 09-Mar-00, [EMAIL PROTECTED] wrote:

 perhaps I'm misunderstanding something. But ...

 It appears to me that you are trying to read the directory located at
 %/partition/drawer/drawer ?

Yes

 Under windows I can read the directory saying:
 files: read /drive/folder/folder/

I tried using it directly, but...

** Script Error: READ expected source argument of type: file url object block.
** Where: files: READ /Data2 /Stocks /Data

Notice the spaces. They were not in the path.


 #2
 One possibility would be:

   files: [%a %b %c %d %e %f %g %h %i %j]
   foreach [f-1 f-2 f-3 f-4 f-5] files [ 
  print mold to string! 
  reduce [f-1 "+" f-2 "+" f-3 "+" f-4 "+" f-5] ]

 which results in:

 "a+b+c+d+e"
 "f+g+h+i+j"

 Hope this helps,

This looks very interesting, and it was useful tonight. I got the program
working (by cheating - I used the strings directly), so I will give it another
try after I get some sleep. Thanks!

(One of my data sources changed their access method, in some way, so I had to
jury-rig quick access to a slower back-up site. yeuch!)

-- 

---===///||| Donald Dalley |||\\\===---
 The World of AmiBroker Support
  http://webhome.idirect.com/~ddalley
  UIN/ICQ#: 65203020



[REBOL] Some niggley things Re:(3)

2000-03-08 Thread icimjs

Hi Donald,

 Under windows I can read the directory saying:
 files: read /drive/folder/folder/

I tried using it directly, but...

** Script Error: READ expected source argument of type: file url object
block.
** Where: files: READ /Data2 /Stocks /Data

You need a % character (In the prototype I skipped it because - in the back
of mind - I thought it was understood, sorry):

read %/drive/folder/folder/

Example:
 read /d/temp/
** Script Error: read expected source argument of type: file url object block.
** Where: read /d /temp /

Compare to:

 read %/d/temp/
== [%save_NewFrames/ %funky/ %tcl-v7/ %snapshots/ %lynx_w32_2_8_2rel_1.zip...

Hope this helps,


;- Elan  [: - )]



[REBOL] e-mail with attachement

2000-03-08 Thread bitinia

Hi All,

1.- I would like to add a file attachement in FORMLETTER.r (from Rebol
site library)

2.- anyone can help me ?

3.- 
REBOL [
Title:   "Form Letter"
Date:10-Sep-1999
File:%formletter.r
Purpose: "Example of how to create an email form letter."
]

Database: [
"Ms." "Ronda" "Adnor" "Hawaii"   [EMAIL PROTECTED]
"Ms." "Mari"  "Iram"  "New York" [EMAIL PROTECTED]
"Mr." "Bill"  "Clint" "Alcatraz" [EMAIL PROTECTED]
]

foreach [Mr-Ms first-name last-name place email] database [
letter: rejoin [

"Dear " Mr-Ms " " last-name {,

We are interested in hearing more about your upcoming vacation
plans to } place { and what we can do to make your trip more
enjoyable.  } first-name {, you know you can contact us anytime to
find out more about the details of your travel package.

Have fun in } place {!

   Bob "Jetman" Bobbob
   Quantity Travel, Inc.
}
]
print ["Sending to:" first-name last-name]
send email letter
]

4.- thanks in advance

Maurizio Converso



[REBOL] Some niggley things Re:(4)

2000-03-08 Thread ddalley


Hi, Elan:

On 09-Mar-00, [EMAIL PROTECTED] wrote:

 read %/drive/folder/folder/

 Compare to:

  read %/d/temp/
 == [%save_NewFrames/ %funky/ %tcl-v7/ %snapshots/
%lynx_w32_2_8_2rel_1.zip...

 Hope this helps,

What I really wanted to know was how to use a set-word!. The reason is that,
if the program has an error and stops, the console is still set for a changed
directory path. This is very annoying, since, to re-run the program, I have to
change-dir again and again:

  list-path: %/drive/folder/folder/
  list: READ path

with "list" containing the dir-list block. I didn't get this working yet.

-- 

---===///||| Donald Dalley |||\\\===---
 The World of AmiBroker Support
  http://webhome.idirect.com/~ddalley
  UIN/ICQ#: 65203020