Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

(no subject)

 [1/13] from: rain::release-co::ru at: 11-Dec-2001 19:24


Hello , ALL!!! I need some help. I'd like to make a small program to manage phone traffic. My digital phone system can communicate via RS232 (standart COM-port) I can not find any description about how to open COM-port using REBOL. Can someone help me with info? Thanks in advance. -- Best regards, Rain mailto:[rain--release-co--ru]

 [2/13] from: fabrice:regnier:socopa-entreprise at: 12-Dec-2001 19:33


http://www.rebol.com/docs/core25.html chapter 12 Fab

 [3/13] from: dlhawley:home at: 12-Dec-2001 10:37


to open a serial port use serial-port: open serial://portX where X is the index of the port name in system/ports/serial. If your port is not in that list, then aappend it. Also, you can set the baud rate and so on with options after the X as in:
>> append system/ports/serial 'cm17
== [ser0 ser1 cm17] cm-port: open serial://port3/300/none/8/1 Now I can read/write to cm-port as needed. The values in system/ports/serial are OS dependent and possible incorrect. QNX does not typically have a /dev/ser0 so one could do a system/ports/serial: difference system/ports/serial 'ser0 first. Also, in an OS where the ports are in /dev - /dev is prepended by rebol in the underlying open call. For an OS which allows opening accross the net one can make a symbolic link to the network port - in QNX6 it might look like: ln -sP /net/X10controller/dev/ser3 /dev/cm17 And no - I don't have X10 code under REBOL - but have been looking at the C code... It weould be tyivial to write under REBOL, but for QNX better to put X10 into a resource manager which could be opened by any language. Previously, you (Release) wrote:
> Hello , ALL!!! > I need some help.
<<quoted lines omitted: 10>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- David L. Hawley D.L. Hawley and Associates 1.503.274.2242 Software Engineer [David--L--Hawley--computer--org]

 [4/13] from: greggirwin:mindspring at: 12-Dec-2001 12:08


Hi Rain, << I'd like to make a small program to manage phone traffic. My digital phone system can communicate via RS232 (standart COM-port) I can not find any description about how to open COM-port using REBOL. Can someone help me with info? >> The serial:// scheme is probably what you're after. You can open the serial ports and then use 'insert, 'copy, 'wait, etc. on them, just like other ports. com: open/lines/no-wait/direct serial://port2/9600/8/none/1 The /Core 2.5 docs update talks about them --Gregg

 [5/13] from: ryanc:iesco-dms at: 12-Dec-2001 16:50


A link to the core update that describe how to use the serial port... http://www.rebol.com/docs/core25.html --Ryan Gregg Irwin wrote:
> Hi Rain, > << I'd like to make a small program to manage phone traffic.
<<quoted lines omitted: 11>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Ryan Cole Programmer Analyst www.iesco-dms.com 707-468-5400 The contradiction so puzzling to the ordinary way of thinking comes from the fact that we have to use language to communicate our inner experience which in its very nature transcends lingistics. -D.T. Suzuki

 [6/13] from: riusa:email:it at: 31-Jan-2002 10:11


Hi, can someone tell me if exists a function (or similar) to map a serie over another one? E.G.: (used to translate the month names from italian to english): ['GEN 'FEB 'MAR 'APR 'MAG ] --> ['JAN 'FEB' 'MAR 'APR 'MAY] thanks! ++++++++++++++++++++++++++++++++++++++++++++ Alessandro Manotti Presidente dell'Associazione "RIUSA" Sito web: http://riusa.apritisesamo.net email: [riusa--email--it] mailing-list: [riusa-ml--yahoogroups--com] Telefono: 347.63.43.231 -- Prendi GRATIS l'email universale che... risparmia: http://www.email.it/f Sponsor: Obiettivo Laurea? Scopri la formula vincente per la preparazione dei tui esami universitari! Per informazioni Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=212&d=31-1

 [7/13] from: joel:neely:fedex at: 31-Jan-2002 10:05


Hi, Alessandro, Pardon the fragmentary answer, but my Italian is non-existent! ;-) [riusa--email--it] wrote:
> Hi, > > can someone tell me if exists a function (or similar) to map a serie > over another one? > > E.G.: > (used to translate the month names from italian to english): > ['GEN 'FEB 'MAR 'APR 'MAG ] --> ['JAN 'FEB' 'MAR 'APR 'MAY] >
The general strategy is to use a block that alternatest the from and "to" values, then use SELECT to obtain the corresponding value for a specific input. In this case (perhaps?) we can "cheat" and decide only to translate the cases that are different, and give back the input if there's no translation specified. Thus, for example: month-it-en: func [it-month [string!] /local en-month] [ either none? en-month: select/skip [ "GEN" "JAN" "MAG" "MAY" ] it-month 2 [ it-month ][ first en-month ] ] which behaves as follows:
>> month-it-en "GEN" == "JAN" >> month-it-en "FEB" == "FEB" >> month-it-en "MAR" == "MAR" >> month-it-en "APR" == "APR" >> month-it-en "MAG" == "MAY" >> month-it-en "foo" == "foo"
You might want to use a fully-populated block of values (paired values, actually) and let the lookup-failure value be some other indication, such as the original value wrapped in question marks... HTH! -jn-

 [8/13] from: riusa:email:it at: 1-Feb-2002 0:19


I found some solutions, I wish to propose them to you: - 1 ------------------ month-list: [gen jan feb feb mar mar apr apr mag may giu jun lug jul ago aug set sep ott oct nov nov dic dec] select month-list 'feb select month-list 'giu Of course, it is good only for ITALIAN->ENGLISH (for reverse, we should reverse the order of the items...). - 2 ------------------ date1: [gen feb mar apr mag giu lug ago set ott nov dic] date2: [jan feb mar apr may jun jul aug sep oct nov dec] idx: index? find date1 'gen date2/:idx * Advantage: reverse is ok... idx: index? find date2 'gen date1/:idx - 3 ------------------ -----Messaggio originale----- Da: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]Per conto di Joel Neely Inviato: Thursday, January 31, 2002 5:05 PM A: [rebol-list--rebol--com] Oggetto: [REBOL] Re: [REBOL] Hi, Alessandro, Pardon the fragmentary answer, but my Italian is non-existent! ;-) [riusa--email--it] wrote:
> Hi, > > can someone tell me if exists a function (or similar) to map a serie > over another one? > > E.G.: > (used to translate the month names from italian to english): > ['GEN 'FEB 'MAR 'APR 'MAG ] --> ['JAN 'FEB' 'MAR 'APR 'MAY] >
The general strategy is to use a block that alternatest the from and "to" values, then use SELECT to obtain the corresponding value for a specific input. In this case (perhaps?) we can "cheat" and decide only to translate the cases that are different, and give back the input if there's no translation specified. Thus, for example: month-it-en: func [it-month [string!] /local en-month] [ either none? en-month: select/skip [ "GEN" "JAN" "MAG" "MAY" ] it-month 2 [ it-month ][ first en-month ] ] which behaves as follows:
>> month-it-en "GEN" == "JAN" >> month-it-en "FEB" == "FEB" >> month-it-en "MAR" == "MAR" >> month-it-en "APR" == "APR" >> month-it-en "MAG" == "MAY" >> month-it-en "foo" == "foo"
You might want to use a fully-populated block of values (paired values, actually) and let the lookup-failure value be some other indication, such as the original value wrapped in question marks... HTH! -jn- -- To unsubscribe from this list, please send an email to [rebol-request--rebol--com] with "unsubscribe" in the subject, without the quotes. -- Prendi GRATIS l'email universale che... risparmia: http://www.email.it/f Sponsor: Obiettivo Laurea? Scopri la formula vincente per la preparazione dei tui esami universitari! Per informazioni Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=212&d=1-2

 [9/13] from: joel:neely:fedex at: 31-Jan-2002 19:07


Hi, Alessandro, I suggest using strings instead of words. Strings always evaluate to themselves, while some expressions could end up trying to take the value of MAR or GIU with unexpected results! ;-) Alessandro Manotti wrote:
> month-list: [gen jan feb feb mar mar apr apr mag may giu jun lug > jul ago aug set sep ott oct nov nov dic dec] > > select month-list 'feb > select month-list 'giu > > Of course, it is good only for ITALIAN->ENGLISH (for reverse, we > should reverse the order of the items...). >
You can avoid having two lists by using triples instead of pairs, as follows: translate-month: func [month-name [string!]] [ select [ "gen" "jan" "gen" "feb" "feb" "feb" "mar" "mar" "mar" "apr" "apr" "apr" "mag" "may" "mag" "giu" "jun" "giu" "lug" "jul" "lug" "ago" "aug" "ago" "set" "sep" "sep" "ott" "oct" "ott" "nov" "nov" "nov" "dic" "dec" "dic" ] month-name ] which works as
>> translate-month "jan" == "gen" >> translate-month "lug" == "jul"
<<quoted lines omitted: 7>>
> idx: index? find date2 'gen > date1/:idx
A drawback of using ... INDEX? FIND ... is the behavior when an invalid argument is supplied. Packaged up as a function, with a refinement to control the direction of translation, we can use the above idea as: trans-mon: func [mon-name [string!] /to-it /local date-it date-en] [ date-it: [ "gen" "feb" "mar" "apr" "mag" "giu" "lug" "ago" "set" "ott" "nov" "dic" ] date-en: [ "jan" "feb" "mar" "apr" "may" "jun" "jul" "aug" "sep" "oct" "nov" "dec" ] either to-it [ pick date-it index? find date-en mon-name ][ pick date-en index? find date-it mon-name ] ] which behaves this way:
>> trans-mon "gen" == "jan" >> trans-mon "ott" == "oct" >> trans-mon/to-it "oct" == "ott" >> trans-mon/to-it "may" == "mag"
... but ...
>> trans-mon "abc"
** Script Error: index? expected series argument of type: series port ** Where: trans-mon ** Near: pick date-en index? find date-it So, regardless of the strategy chosen, handling erroneous cases should be part of the plan, IMHO. -jn-

 [10/13] from: riusa:email:it at: 1-Feb-2002 8:57


Using triples is a good idea! thanks for other suggestions!
> Hi, Alessandro, > I suggest using strings instead of words. Strings always evaluate
<<quoted lines omitted: 65>>
> >> trans-mon "abc" > ** Script Error: index? expected series argument of type: series
port
> ** Where: trans-mon > ** Near: pick date-en index? find date-it > > So, regardless of the strategy chosen, handling erroneous cases should > be part of the plan, IMHO. > > -jn- > --
-- Prendi GRATIS l'email universale che... risparmia: http://www.email.it/f Sponsor: Le vacanze da sogno si prenotano solo su eDreams. Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=75&d=1-2

 [11/13] from: petr:krenzelok:trz:cz at: 1-Feb-2002 9:39


Sorry if completly OT, as I don't follow the thread. So, are you trying to do some easy localisation? If you are attempting to do "translation" system, then I forget my post, but if the talk held here concerns localisation system, here's my input: I prefer simplicity. English is standard in Rebol syntax, so: ->> lang: 'cz == cz ->> lang1: "cz" == "cz" ->> blk: [cz 1 'cz 2 "cz" 3] ->> blk/:lang == 1 ->> blk/:lang1 == 3 Choose what you want. Now more complex example of usage: ;central IOS environment "variable" holding value language: 'cz ; not necessary but possible .... select language-description 'cz (or even more complex lang-spec object - national setting for currency etc.) language-secription: ['cz "Cesky jazyk" 'de "Deutsche sprache"] translated: [ months [ cz ["january" "leden" ....] de ["january" "...." ....... ] some-app [....] ] ;... you can check if some kind of an app is translated ; ... if find translated 'some-app .... ; .... or not error? try [translated/:myapp/:lang][app-locale: 'cz] ; if so, ->> app: 'months ->> select translated/:app/:app-locale "january" == "leden" ... and if you don't like English as a default lang, you could just use another aproach - it took me 3 minutes to organise above one :-) -pekr- Joel Neely wrote:

 [12/13] from: riusa:email:it at: 4-Feb-2002 15:16


Hi, I have a problem (!)... (sorry!) I must update some field in a DB (ODBC->Ms Access). I have to write a date or, if the user doesn't insert the date, I want to write "NULL". DB Access has a field "myDate (type: DateTime)". E.G.: Using DB functions in Rebol/Command: type? newDate = string (got from a field in layout... InputDate/text). db: open odbc://accessODBC dbp: first db insert dbp { [update myTable set myDate=?] newDate } if newDate is a date, everything is ok, but... if the user does not insert the date (blank)... I always obtain the error: ** Script Error: ODBC error: [Microsoft][Driver ODBC Microsoft Access] Data types do not correspond in the function-criteria. ** Where: func [face value][panels/pane: none show panels Help me! I need to accept either valid date or null values! Thanks ! -- Prendi GRATIS l'email universale che... risparmia: http://www.email.it/f Sponsor: Obiettivo Laurea? basta con le pratiche burocratiche! Te le possiamo sbrigare noi. Per informazioni Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=216&d=4-2

 [13/13] from: riusa:email:it at: 11-Feb-2002 11:27


Hi all... I'm studying the "parsing"... wow! it's very powerful! Now I have a little (!) problem: I have to parse a string like the following: SELECT SIZE MODIFIED FROM %/c/filetext.txt as result, I would produce the size and the last modification time of the file. I use the following code: rule: [ set action-1 ['select | 'insert | 'update | 'delete] set action-2 ['* | some ['size | 'modified] ] 'from set dir-1 file! ( if action-1 = 'select [ either action-2 = '* [ list-dir dir-1 ] [;either if action-2 = 'size [ print size? dir-1 ] if action-2 = 'modified [ print modified? dir-1 ] ] ] ) ] the problem is "action-2" holds either "size" or "modified" (not both) even if the user insert both of them. What can I do to iterate to discover all the data inserted (discover "size" and "modified" options, and print all the data that the user requested). -- Prendi GRATIS l'email universale che... risparmia: http://www.email.it/f Sponsor: Obiettivo Laurea? il nostro Servizio Didattico ti aiuta a preparare gli esami per ogni facolta' italiana. Per informazioni Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=215&d=11-2

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted