AltME: REBOL3

Messages

GiuseppeC
I'd rather prefeer direct server to serve communication, but if it is the only option I will use a file syste watcher.
Also, how do I read command line arguments in REBOL 3 ?
Gregg
I'm sure it's not the only option, just an easy suggestion since I don't have code at the ready for another one. :-)
So system/options/args or system/script/args not work correctly in R3?

DideC
@GiuseppeC:
- If this server app need only to serve SQL commands and send response, and if ODBC 32bits is an option, consider using odbcsocketserver with the Rebol client script, but it's for R2, not R3. It's a pretty simple protocol so maybe it could be adapted to R3 easily.
http://odbcsock.sourceforge.net/
The Rebol client protocol seems to not be available online anymore but ask me in private if you are interested.
GiuseppeC
DideC, it is not suitable for me.
I need only 2 scripts which communicate each other.

GiuseppeC
Hi, is it possible to create a Rebol3 Executable ?
Also, is it possible to associate the R3 console to .r (r3 ?) files ?
Gregg
There was an experimental ENCAP in the Atronix version. I don't know how far Shixin took it though.
File association should be normal.

Sunanda
Rebol to executable: Someone posted this link a while back. No idea if it works:
http://nsis.sourceforge.net/How_to_turn_a_REBOL_script_into_EXE
GiuseppeC
It seem write/append/lines %filename.txt reduce [a b c d] is not working correctly. I have not newlines.
I have also tried write/append/lines %filename.txt append {sometext} lf
but as soon as the loop run reiterating the same line, I accumulate tons of LF

GiuseppeC
Too many answer for all my question in this world, please, stop, it's a flooding !!! :)

Bo
Hmmm. I know I've done this before, but I can't find any reference to it. In Rebol3, how does one access the serial port? It doesn't work the same way as in Rebol2, as there is no system/ports/serial object.
Version:   3.0.99.4.20
This version has GUI and Serial built into it. Here are some things I tried:
>> ser: open serial://  
** Access error: invalid port argument: make error! [
    code: 346
    type: 'Script
    id: 'bad-make-arg
    arg1: integer!
    arg2: none
    arg3: none
    near: [to integer! speed]
    where: [to try if init if -apply- open]
]
** Where: open
** Near: open serial://
>> ser: open serial://ttyUSB0/9600/8/none/1
** Access error: invalid port argument: make error! [
    code: 346
    type: 'Script
    id: 'bad-make-arg
    arg1: integer!
    arg2: 9600/8/none/1
    arg3: none
    near: [to integer! speed]
    where: [to try if init if -apply- open]
]
** Where: open
** Near: open serial://ttyUSB0/9600/8/none/1
>> ser: open serial://ttyUSB0              
** Script error: cannot MAKE/TO file! from: none
** Where: to if init if -apply- open
** Near: to file! path
Bo
OK. Note to self: I was close. This is the correct way to open a serial port:
ser: open serial://ttyUSB0/9600
And here's how to write/read data to/from the serial port:
ser/awake: func [event /local p][
    p: event/port
    switch event/type [
        lookup  [open p]
        connect [write p to-binary request]
        read [
           result: to-string p/data
           close p
           return true
        ]
        wrote [read event/port]
    ]
    false
]
write ser "ping^/"
s: wait [ser 5]
print to-string s/data
Bo
The problem I have now is that I cannot figure out how to read data from the serial port. I always only get back the last command I wrote to the serial port in s/data.

Bo
Hmm, I guess nobody has any ideas here nor on Stack Overflow. :-(

Pekr
Isn't serial port occupied by other app? I very vaguely remember, I once met such situation too. Or it might be related to USB to serial converted, not sure ....
Gregg
I've only ever used R2 for serial port work.

Arnold
Bo, what is wrote [read event/port] ? Is it a typo you only made here?
Arnold
(I saw on SO you also had WROTE not WRITE)

Marco
@Bo . Try also to search for "gs: open" in this group (6-dec-2015 by Josh)

Last message posted 164 weeks ago.