[REBOL] POST in a form Re:
here's the code I currently use in my CGI scripts to handle POST data if system/options/cgi/request-method = "POST" [ buffer: make string! (system/options/cgi/content-length + 10) read-io system/ports/input buffer system/options/cgi/content-length responce: make object! decode-cgi buffer ; do something with the POSTed data ] I haven't had any problems using this so far.. hopefully it will help some... Cal Dixon ([EMAIL PROTECTED]) -- From: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [REBOL] POST in a form Date: Wed, 9 Feb 2000 18:34:30 -0600 I am trying to pass variables to Rebol from a HTML page -no problem doing that so far. Noah and I worked out the form so that a HTML formatted page (because of the aesthetics) prints on a distant printer with a recreated HTML page with the variables inserted. Good so far. Then we realized that the FOR .. GET has a predetermined capacity of only 2K of data. That limit is inherent to HTML, not REBOL. The cure to the data transfer limit is FORM .. POST but we cant make the code work inside Rebol with a POST transfer. The examples are all for GET transfers which is handled differently by Robol (as it is with perl). If you need -i will give you FTP access to a file directory here so we can === files. This will be uniquely valuable to all of us who need to have forms for ourselves or our clients. I can show you how to auto print at a distant printer without user intervention. Thait is not an issue. I am sure this is purely a labor pain. Rebol is very impressive. /john At 0543 2/7/00 , you wrote: Hi John, It's a little harder to see what you're doing with all that HTML formatting in your mail, but I think you can do what you want with: __ Get Your Private, Free Email at http://www.hotmail.com
[REBOL] Rebol for NNTP downloading
Has anybody written anything in the way of an offline reader for news messages in Rebol? What I'm after is something that keeps a list of newsgroups, and downloads any messages from those groups it hasn't seen before. Obviously it will need to keep a persistant record of which messages have been downloaded. I've played around a bit with manually getting all messages from a group, but can't see how to extend that into a useful offline storage mechanism. Oh yeah, and if it could do threading of messages as well that would be great... Andrew
[REBOL] How can i get rebol/view
Can't find it on the webpage. Peoples here are talking about. how can i test it? Gruss Volker
[REBOL] How can i get rebol/view Re:
Hi Gruss, It is currently in a limited beta at the moment, the broader beta distribution has been hinted at for next week. Just keep checking the Rebol site..it is worth the wait.. Cheers, Allen K - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 10, 2000 5:28 PM Subject: [REBOL] How can i get rebol/view Can't find it on the webpage. Peoples here are talking about. how can i test it? Gruss Volker
[REBOL] How can i get rebol/view Re:(2)
[EMAIL PROTECTED] wrote: Hi Gruss, It is currently in a limited beta at the moment, the broader beta distribution has been hinted at for next week. Just keep checking the Rebol site..it is worth the wait.. Are you sure the group is closed? Those who wrote they want to test view, received it. As for next release. - Are you sure it is going to be public beta? Carl just stated beta2 is planned on the end of the weekend, nothing more imho. -pekr- Cheers, Allen K - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 10, 2000 5:28 PM Subject: [REBOL] How can i get rebol/view Can't find it on the webpage. Peoples here are talking about. how can i test it? Gruss Volker
[REBOL] How can i get rebol/view Re:(3)
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 10, 2000 11:19 PM Subject: [REBOL] How can i get rebol/view Re:(2) [EMAIL PROTECTED] wrote: Hi Gruss, It is currently in a limited beta at the moment, the broader beta distribution has been hinted at for next week. Just keep checking the Rebol site..it is worth the wait.. Are you sure the group is closed? Those who wrote they want to test view, received it. As for next release. - Are you sure it is going to be public beta? Carl just stated beta2 is planned on the end of the weekend, nothing more imho. Just repeating what it says on the Rebol Website... -pekr- Cheers, Allen K - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 10, 2000 5:28 PM Subject: [REBOL] How can i get rebol/view Can't find it on the webpage. Peoples here are talking about. how can i test it? Gruss Volker
[REBOL] spaces in block
Hi, I found a weird thing about the block, can anyone help me? I wrote a script: blk: make block! 200 space: "" ; 4 spaces blk: [ 1 space 2 space 3] print blk after ran it, the result is the following: 1 2 3 You can obviously see that the space between each number is 6 instead of 4. Can anyone tell me where I did wrong? Thanks a lot. Tiana
[REBOL] Re: How can i get rebol/view Re:
On Thu, 10 Feb 2000 [EMAIL PROTECTED] wrote: Just keep checking the Rebol site..it is worth the wait.. Any word on what toolkits/graphical library system will be used for the various versions? I'm curious, since X and amiga have so many of them. -- kolla
[REBOL] spaces in block Re:
[EMAIL PROTECTED] wrote: Hi, I found a weird thing about the block, can anyone help me? I wrote a script: blk: make block! 200 space: "" ; 4 spaces blk: [ 1 space 2 space 3] print blk after ran it, the result is the following: 1 2 3 You can obviously see that the space between each number is 6 instead of 4. Can anyone tell me where I did wrong? Nothing's wrong. REBOL just does spacing itself. e.g. print ["A" "B" "C" "D" "E"] will print A B C D E -pekr- Thanks a lot. Tiana
[REBOL] What about Rebol/Command?
I'd like to see Rebol as an extension language I can use in my app, just like VBA or the scheme extension language of Linux, but currently it doesn´t seem to evolve to providing such a services. For example I´d like to run other programs from Rebol using it as a command interpreter ( very much powerful replacement of windows command.com ). I got very dissapointed when I discovered that Rebol doesn´t allow to do this. The Rebol FAQ says that some people have done this by writing to files while keeping another proccess scanning the files for launching the external programs. It also says that a future rebol/command would allow this ( and I hope many more things ). Do you know something about it? And what do you think about a Rebol extension language tool? thanks /cesar
[REBOL] [REBOL] spaces in block Re:
When printing a block, a space is placed in between every block item. Type 'print rejoin blk' to get rid of them, and the print the lot as a string. Cheers -- Från: [EMAIL PROTECTED] Till: [EMAIL PROTECTED] Ämne: [REBOL] spaces in block Datum: tor 10 feb 2000 15.25 Hi, I found a weird thing about the block, can anyone help me? I wrote a script: blk: make block! 200 space: "" ; 4 spaces blk: [ 1 space 2 space 3] print blk after ran it, the result is the following: 1 2 3 You can obviously see that the space between each number is 6 instead of 4. Can anyone tell me where I did wrong? Thanks a lot. Tiana
[REBOL] static variable Re:
Script or object... ? [EMAIL PROTECTED] wrote: Does anyone know whether Rebol has such a kind of variable: you initialize this variable at the first time you run the script. In this script, the variable will be modified to some value. If you run this script again, this variable will preserve the value it has in last run. There are several ways to look at this. 1) If you want persistence of private data between evaluationss of a function (without reloading the function from a file) then the technique posted by mjelinek will do that. 2) If you want persistence of data (independent of function associations, and without reloading from a file) then the technique posted by doug.vos will do that. 3) If you want persistence of state for some "concept" (without reloading from a file, and with the option of multiple functions being privy to that state) then you've just stumbled over the canonical rationale for object-oriented programming. For example: REBOL [] statefulthing: make object! [ val: 0 set: func [n [integer!]] [val: n] get: func [] [val] inc: func [] [val: val + 1] dec: func [] [val: val - 1] ] used as in statefulthing/get == 0 statefulthing/inc == 1 statefulthing/inc == 2 statefulthing/get == 2 statefulthing/set 27 == 27 statefulthing/dec == 26 and so on. 4) If you like the tidyness of the above, but want persistence between REBOL sessions, you can do the following: statefulthing/get == 26 (Just to show current state...) save/header %statefulthing.r statefulthing [] Now the state is safely stashed in a file. statefulthing: "simulate stopping and restarting REBOL" == "simulate stopping and restarting REBOL" statefulthing: none == none (Just to show that the state is no longer "in" that word.) statefulthing: do %statefulthing.r Get it back! statefulthing/inc == 27 5) If you want persistence of data and you really do mean "script" and you really do want to reload the script from a file between usages (and don't mind getting REALLY obscure!) you can do this: REBOL [] staticvar: none somefunction: func [s [string!]] [ either found? staticvar [ print rejoin [{staticvar was "} staticvar {"}] ][ print {staticvar had no value} ] staticvar: s print rejoin [{staticvar is now "} staticvar {"}] write %static.r {REBOL []^/^/} write/append %static.r rejoin [{staticvar: "} staticvar {"^/^/}] write/append %static.r rejoin [{somefunction: } mold get 'somefunction {^/}] ] (in a file named static.r, of course!) Now use it as ... do %static.r somefunction "Hello" staticvar had no value staticvar is now "Hello" somefunction "world!" staticvar was "Hello" staticvar is now "world!" somefunction "still in memory" staticvar was "world!" staticvar is now "still in memory" In-memory persistence is accomplished, as staticvar is global, but the use of somefunction is also keeping the external (file) copy synched, so that somefunction: none == none staticvar: none == none (which simulates shutting down and restarting REBOL) can be followed by do %static.r somefunction "I'm back!" staticvar was "still in memory" staticvar is now "I'm back!" As me auld granny sed, "There's more than one way to skin a cat!" -jn-
[REBOL] What about Rebol/Command? Re:
[EMAIL PROTECTED] wrote: And what do you think about a Rebol extension language tool? I think Rebol would make a fine extension language. The major problem all extension language integrators face is how to glue to language to the application's core datastructures. Series are a simple yet obviously powerful abstraction; RT has given us ample examples of how to bridge that abstraction to a variety of problem domains with their tight integration of series and various network protocols. I suspect that a thoughtful way to wrap host-app datastructures up in series would in a natural way lead to very expressive, very tight extension code. $0.02, jb thanks /cesar
[REBOL] REMOVE
REMOVE ME FROM THIS LIST IMMEDIATELY, IF HAVE BEEN SWAMPED BY YOUR EMAILS
[REBOL] WebCam CGI script Re:
A couple days ago someone had mentioned wanting to use a webcam with a dynamic IP address... Following is a CGI script I use (along with a pair of simple scripts on my machine to update a file containing my address using rebol FTP) The webcam software I'm using is called WebCam2000 (it's for Win32 only unfortunatly), their homepage is http://www.1000klub.com/~loomer/webcam2000 another solution (not involving rebol) for using a webcam without a static IP address is to use dhs.org and their DynDNS service. The real problem is, that I don't have acces to FTP, so it has to be a browserupload!!! K. __ Get Your Private, Free Email at http://www.hotmail.com
[REBOL] REMOVE Re:
Please send an email to [EMAIL PROTECTED] with un subscribe in the subject line, and no text in the body. Also, you must send the email from the same address that you had subscribed with. If you are still unable to remove yourself, please let me know by sending me an email off-list to [EMAIL PROTECTED] so that we can resolve this for you ASAP. Thank your for your patience. Regards, Jennifer L. Allen-Nelson Exec. Asst. to CEO Staff REBOL Technologies 2635 Vichy Springs Rd., Ukiah, CA 95482 Ph: 707.467.8000 Fx: 707.467.8005 www.rebol.com
[REBOL] [REBOL] Imbedding and Extending Rebol
Hi All: Imitation is the sincerest form of flattery, right? In terms of OS interfaces (As I see it, anyway) Macintosh followed Amiga's lead (and I think Carl S. was in on that). Windows followed Macintosh, and Linux followed Windows. Having said that, look at Python: With Python, you can both call other programs from the script, AND you can imbed the script in C/C++ by linking in Python Libraries. As a C/C++ programmer, I would guess that there would be some hurdles to overcome with multiple platforms as targets to implement system calls in Rebol. Looking at the reverse: that is imbedding Rebol in C/C++ (I can only comment on this medium, not other languages). If the necessary resources were provided, it shouldn't be too difficult to arrange for a rebol library to be linked into a C executable. And I don't think then, that it would be too difficult to make the first step a very simple interface like so: use_rebol(char* rebol_syntax_string); //and overloading in C++ use_rebol(char* rebol_syntax_string, char* simple_data_string); OR use_rebol(int number_of_args,/*variable argument list*/) // etc The implementation would be VERY simple, and definitely limited, but it would be a first step, and wouldn't have to be made obsolete by later enhancements. Even at that very simple first step, I could see an easier implementation of ftp, cgi, and email than the components provided to me by Borland. (And Borland CGI services are available to the programmer only with a VERY expensive "interprise" version. By overlaying the code with the preprocessor, one could then create any number of very powerful calls with very brief coding. As cesar state quite correctly resolving datastructure would be somewhat more complicated, but doable. On a related note, I have seen comments about databases: And I do a lot of CGI database programming. Let me put in a plug here: I recently purchased the Mix C/Database Library, it is available for differnt Windows modes, as well as for Linux. And is very complete and powerful. Now I don't pretend to advise rebol as to purchasing someone else's work or joint ventures, but if I could find a way to compile rebol's core with Mix's database libraries, I would be one VERY happy camper. Just a thought. Thanks for listening Tim At 09:22 AM 2/10/00 -0600, you wrote: [EMAIL PROTECTED] wrote: And what do you think about a Rebol extension language tool? I think Rebol would make a fine extension language. The major problem all extension language integrators face is how to glue to language to the application's core datastructures. Series are a simple yet obviously powerful abstraction; RT has given us ample examples of how to bridge that abstraction to a variety of problem domains with their tight integration of series and various network protocols. I suspect that a thoughtful way to wrap host-app datastructures up in series would in a natural way lead to very expressive, very tight extension code. $0.02, jb thanks /cesar
[REBOL] WebCam CGI script Re:
Hello, Rebols: On 10-Feb-00, [EMAIL PROTECTED] wrote: A couple days ago someone had mentioned wanting to use a webcam with a dynamic IP address... Following is a CGI script I use (along with a pair of simple scripts on my machine to update a file containing my address using rebol FTP) I used a REBOL program to get a webcam image that was controlled by Java. The all images arrived incomplete from one site, so I gave up. This was not an obvious problem with non-Java control. Is there anything I can do to make sure these images are complete? -- ---===///||| Donald Dalley |||\\\===--- The World of AmiBroker Support http://webhome.idirect.com/~ddalley Member: ICOA and Team AMIGA
[REBOL] [REBOL] Imbedding and Extending Rebol Re:(2)
And the Mac interface concept came from Xerox anyway. but, there are always historical and even sometimes hysterical precedents. --Ralph -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 10, 2000 2:26 PM To: [EMAIL PROTECTED] Subject: [REBOL] [REBOL] Imbedding and Extending Rebol Re: FWIW, I certainly don't mean to start a thread on this and I may be mistaken but...I believe that the Mac debuted in 1/84 and the Amiga 1000 appeared in 1/85. [EMAIL PROTECTED] wrote: Hi All: Imitation is the sincerest form of flattery, right? In terms of OS interfaces (As I see it, anyway) Macintosh followed Amiga's lead (and I think Carl S. was in on that). Windows followed Macintosh, and Linux followed Windows.
[REBOL] problem with sort a file
Hello, I tried to sort a file in a reverse order according to the date, which is the first column of the file. e.g foo.txt looks like this: 1-Feb-2000 bla bla bla 9-Feb-2000 bla bla bla 3-Feb-2000 bla bla bla .. My script is : file: read/lines %foo.txt file2: sort /skip file 4 write/line %foo2.txt file2 The output file foo2.txt looks as same as foo.txt, it didn't sort at all. Can anyone tell me what's the problem? BTW, How can I sort the date in reverse order: sort/compare %foo.txt func [a b] [a b] only sort the first character instead of the whole date expression. Can I combine these two processes together? Thank in advance. Tiana
[REBOL] Re: How can i get rebol/view Re:
Hello [EMAIL PROTECTED]! On 10-Feb-00, you wrote: k Any word on what toolkits/graphical library system will be k used for the various versions? k I'm curious, since X and amiga have so many of them. None of them, actually. REBOL/View is more than just a GUI frontend to REBOL. You will be amazed when you'll see it. :-) Regards, Gabriele. -- o) .-^-. (--o | Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila | | GIESSE on IRC \ \-\_/-/ / http://www.amyresource.it/AGI/ | o) `-v-' (--o
[REBOL] What Type Of Apps Are You Writting? Re:
I may use it to perform database field manipulation (with flat file records), but right now I'm just writing a game to familiarize myself with the language. BTW I've hit the ceiling for variable space on Windows NT and it will not even load all of the functions, so be careful if you're using lots of variables on NT. I've been told that this limit will eventually be removed. That just keeps me from running it on the PC at work (not a bad thing). Luckily my Amiga at home can still handle it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 09, 2000 12:35 PM To: [EMAIL PROTECTED] Subject: [REBOL] What Type Of Apps Are You Writting? What type of applications are you using REBOL for? ___ EdGrant.Com
[REBOL] problem with sort a file Re:
I'm not sure why you are using sort/skip. It seems to me, if date is the first column of each record (line), you could use sort without refinements. To sort on only the first character of a series of strings, use: sort/compare f func [a b] [a/1 b/1] BTW you didn't really have a space between SORT and /SKIP did you? - Michael Jelinek -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 10, 2000 12:59 PM To: [EMAIL PROTECTED] Subject: [REBOL] problem with sort a file Hello, I tried to sort a file in a reverse order according to the date, which is the first column of the file. e.g foo.txt looks like this: 1-Feb-2000 bla bla bla 9-Feb-2000 bla bla bla 3-Feb-2000 bla bla bla .. My script is : file: read/lines %foo.txt file2: sort /skip file 4 write/line %foo2.txt file2 The output file foo2.txt looks as same as foo.txt, it didn't sort at all. Can anyone tell me what's the problem? BTW, How can I sort the date in reverse order: sort/compare %foo.txt func [a b] [a b] only sort the first character instead of the whole date expression. Can I combine these two processes together? Thank in advance. Tiana
[REBOL] POST in a form Re:
Hi John, use the input function. When you want to collect the posted data just say posted-data: make object! decode-cgi input At 06:34 PM 2/9/00 -0600, you wrote: I am trying to pass variables to Rebol from a HTML page -no problem doing that so far. Noah and I worked out the form so that a HTML formatted page (because of the aesthetics) prints on a distant printer with a recreated HTML page with the variables inserted. Good so far. Then we realized that the FOR .. GET has a predetermined capacity of only 2K of data. That limit is inherent to HTML, not REBOL. The cure to the data transfer limit is FORM .. POST but we cant make the code work inside Rebol with a POST transfer. The examples are all for GET transfers which is handled differently by Robol (as it is with perl). If you need -i will give you FTP access to a file directory here so we can === files. This will be uniquely valuable to all of us who need to have forms for ourselves or our clients. I can show you how to auto print at a distant printer without user intervention. Thait is not an issue. I am sure this is purely a labor pain. Rebol is very impressive. /john At 0543 2/7/00 , you wrote: Hi John, It's a little harder to see what you're doing with all that HTML formatting in your mail, but I think you can do what you want with: ;- Elan [: - )]
[REBOL] read-io and write-io
Hey all, I know that read-io and write-io are supposed to be low-level and undocumented, but I see them all the time in web code so I'll ask anyways... What is the meaning of the integer returned by *-io? How are they supposed to behave when passed negative lengths? Do they only work on network ports, or do they also work on file ports? If they are supposed to work on file ports, why does read-io stop working before the end of the file? If you aren't supposed to use them, what documented function can you use that performs their function? Help? Brian Hawley
[REBOL] problem with sort a file Re:(2)
Hi, Mike Thanks for your reply. I use /skip because I thought it is for sectional sorting. in my file, each record has 4 sections(e.g, 1-Feb-2000 bla bla bla). I just tried without skip, it gave me the same result though. I guess this is might because of I read it from a file? I use the following script and sample file, file: read/lines %foo.txt blk: make block! 100 blk: to-block file file2: sort blk write/lines %foo2.txt file2 which foo.txt is: 2-Feb-2000 1 2 1-Feb-2000 2 1 6-Feb-2000 3 5 24-Feb-2000 4 6 the result foo2.txt is: 1-Feb-2000 2 1 2-Feb-2000 1 2 24-Feb-2000 4 6 6-Feb-2000 3 5 It can't tell 24-Feb-2000 is larger than 6-Feb-2000. Why is it?
[REBOL] problem with sort a file Re:(3)
"Sectional sorting" goes over my head. Your file is being sorted according to the ascii values. I.e. you haven't told it to sort according to a DATE. Try this: file-blk: read/lines %foo1.txt sort/compare file-blk func[a b][(to-date first parse a none) (to-date first parse b none)] write/lines %foo2.txt file-blk Explanation: When you read in a file with read/lines, the result is a block of the lines (strings) of the file. Sort modifies the contents of the block given to it. PARSE block NONE breaks apart the fields of the string into a series (according to whitespace) FIRST takes the first field - in this case a string! TO-DATE converts the string to the internal date format, which will be compared as expected I found that parenthesis are required here - Michael Jelinek -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 10, 2000 2:45 PM To: [EMAIL PROTECTED] Subject: [REBOL] problem with sort a file Re:(2) Hi, Mike Thanks for your reply. I use /skip because I thought it is for sectional sorting. in my file, each record has 4 sections(e.g, 1-Feb-2000 bla bla bla). I just tried without skip, it gave me the same result though. I guess this is might because of I read it from a file? I use the following script and sample file, file: read/lines %foo.txt blk: make block! 100 blk: to-block file file2: sort blk write/lines %foo2.txt file2 which foo.txt is: 2-Feb-2000 1 2 1-Feb-2000 2 1 6-Feb-2000 3 5 24-Feb-2000 4 6 the result foo2.txt is: 1-Feb-2000 2 1 2-Feb-2000 1 2 24-Feb-2000 4 6 6-Feb-2000 3 5 It can't tell 24-Feb-2000 is larger than 6-Feb-2000. Why is it?
[REBOL] problem with sort a file Re:(4)
Mike, I agree with your opinion, but when I tried your script, it gave me the following msg: ** Script Error: Out of range or past end. ** Where: to-date first parse a none Any idea? OR is that the problem of my foo1.txt? Thanks a lot. Tiana Reply Separator Subject:[REBOL] problem with sort a file Re:(3) Author: [EMAIL PROTECTED] Date: 2/10/00 3:20 PM "Sectional sorting" goes over my head. Your file is being sorted according to the ascii values. I.e. you haven't told it to sort according to a DATE. Try this: file-blk: read/lines %foo1.txt sort/compare file-blk func[a b][(to-date first parse a none) (to-date first parse b none)] write/lines %foo2.txt file-blk Explanation: When you read in a file with read/lines, the result is a block of the lines (strings) of the file. Sort modifies the contents of the block given to it. PARSE block NONE breaks apart the fields of the string into a series (according to whitespace) FIRST takes the first field - in this case a string! TO-DATE converts the string to the internal date format, which will be compared as expected I found that parenthesis are required here - Michael Jelinek -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 10, 2000 2:45 PM To: [EMAIL PROTECTED] Subject: [REBOL] problem with sort a file Re:(2) Hi, Mike Thanks for your reply. I use /skip because I thought it is for sectional sorting. in my file, each record has 4 sections(e.g, 1-Feb-2000 bla bla bla). I just tried without skip, it gave me the same result though. I guess this is might because of I read it from a file? I use the following script and sample file, file: read/lines %foo1.txt blk: make block! 100 blk: to-block file file2: sort blk write/lines %foo2.txt file2 which foo1.txt is: 2-Feb-2000 1 2 1-Feb-2000 2 1 6-Feb-2000 3 5 24-Feb-2000 4 6 the result foo2.txt is: 1-Feb-2000 2 1 2-Feb-2000 1 2 24-Feb-2000 4 6 6-Feb-2000 3 5 It can't tell 24-Feb-2000 is larger than 6-Feb-2000. Why is it?
[REBOL] problem with sort a file Re:(3)
Hi Tiana When you read in the file using READ/LINES each entry in the resultiing block is a string. When you sort the block REBOL sorts the strings lexicographically, so lines that that start with the character "2" will come before lines that start with the character "6". If you want them to sort by date you could convert each line to a block. Like file: read/lines %junk.txt == ["2-Feb-2000 1 2" "1-Feb-2000 2 1" "6-Feb-2000 3 5" "24-Feb-2000 4 6"] blk: make block! 10 == [] foreach line file [append/only blk to-block line] == [[2-Feb-2000 1 2] [1-Feb-2000 2 1] [6-Feb-2000 3 5] [24-Feb-2000 4 6]] sort blk == [[1-Feb-2000 2 1] [2-Feb-2000 1 2] [6-Feb-2000 3 5] [24-Feb-2000 4 6]] Hope this helps Larry - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 10, 2000 2:44 PM Subject: [REBOL] problem with sort a file Re:(2) Hi, Mike Thanks for your reply. I use /skip because I thought it is for sectional sorting. in my file, each record has 4 sections(e.g, 1-Feb-2000 bla bla bla). I just tried without skip, it gave me the same result though. I guess this is might because of I read it from a file? I use the following script and sample file, file: read/lines %foo.txt blk: make block! 100 blk: to-block file file2: sort blk write/lines %foo2.txt file2 which foo.txt is: 2-Feb-2000 1 2 1-Feb-2000 2 1 6-Feb-2000 3 5 24-Feb-2000 4 6 the result foo2.txt is: 1-Feb-2000 2 1 2-Feb-2000 1 2 24-Feb-2000 4 6 6-Feb-2000 3 5 It can't tell 24-Feb-2000 is larger than 6-Feb-2000. Why is it?
[REBOL] What Type Of Apps Are You Writting? Re:
I'm working on a for-now text based IRC client, will eventually support the full ctcp2 specification (does handle VERSION,TIME,PING,CLIENTINFO,ACTION and SOURCE for now). I will probably make a GUI for it with REBOL/View when it is available for the Amiga. /PeO What type of applications are you using REBOL for? ___ EdGrant.Com
[REBOL] ANSI stuff..
Comments, optimizations, ideas, fixes etc. welcome (actually another set of functions for my wannabe-IRC-client)... /PeO REBOL [ Title: "ANSI colors" ] escape: func [parm [string!]][join "^(1B)[" parm] get-scr-dims: func [ "Stores the console dimensions in screen-size block (height, width)" /local cons ][ cons: open/binary [scheme: 'console] prin escape "7n" parse to-string copy cons [thru "[" copy screen-size to "R"] screen-size: parse (to-string screen-size) ";" close cons ] comment { irc color ansi color (EPIC) 0: white white bold 1: black black 2: navyblue 3: green green 4: red red 5: maroon yellow! 6: purplepurple 7: orangered bold 8: yellow yellow bold 9: lime green bold 10: tealcyan 11: aquaaqua bold 12: blueblue bold 13: fuchsia purple bold 14: greyblack bold 15: silver white plain } ansi: func [ attributes [block!] ] [ bg: "4" fg: "3" reset: bold_off: underline_off: reverse_off: blink_off:"0" bold_on: bold: "1" underline_on: underline: "4" blink_on: blink: "5"reverse_on: reverse: "7" black: "0" red: "1"green: "2" yellow: "3" blue: "4" magenta: "5"purple: "5" cyan: "6" aqua: "6" white: "7" if error? try [ return rejoin["^(1B)[" (get first attributes) (get second attributes) "m"] ][ return rejoin["^(1B)[" (get first attributes) "m"] ] ] strip-ansi: func[ansitext /local strippedtext] [ strippedtext: copy ansitext ansi-rule: [to "^(1B)[" copy ansicode thru "m" (replace strippedtext ansicode "")] parse/all ansitext [some ansi-rule to end] return strippedtext ] ansitext: join "Normal " [ansi[underline_on] "underline" ansi[reset] ansi[fg red] " Red " ansi[bg white] " Red on White " ansi[reset]] ansitext: join ansitext [ansi[bold_on] "Bold" ansi[fg blue] " Blue bold " ansi[fg purple] ansi[bg green] " Purple bold on green " ansi[reset]] strippedtext: strip-ansi ansitext print length? strip-ansi ansitext print length? strippedtext print strippedtext print length? ansitext print ansitext
[REBOL] REBOL Web site update
The REBOL web site front page has been updated. It shows more of REBOL crew's plan. Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/ --
[REBOL] problem with sort a file Re:(3)
Try this: write %foo.txt {2-Feb-2000 1 2 1-Feb-2000 2 1 6-Feb-2000 3 5 24-Feb-2000 4 6} Lines: read/lines %foo.txt Block: make block! 100 foreach Line Lines [ append/only Block load Line ] print mold Block sort Block print mold Block delete %foo.txt foreach Line Block [ write/append %foo.txt rejoin ["" line newline] ] print read %foo.txt Andrew Martin REBOLutionary in NZ... ICQ: 26227169 http://members.xoom.com/AndrewMartin/ --
[REBOL] Re: How can i get rebol/view Re:
On Thu, 10 Feb 2000 [EMAIL PROTECTED] wrote: Hello [EMAIL PROTECTED]! On 10-Feb-00, you wrote: k Any word on what toolkits/graphical library system will be k used for the various versions? k I'm curious, since X and amiga have so many of them. None of them, actually. REBOL/View is more than just a GUI frontend to REBOL. You will be amazed when you'll see it. :-) This doesnt make sense to me. Will it be like "something you run inside a window" like f.ex Oberon? Or will it be integrated into the graphical environment of the hosting OS? -- kolla
[REBOL] How can i get rebol/view Re:(3)
[EMAIL PROTECTED] wrote: On Thu, 10 Feb 2000 [EMAIL PROTECTED] wrote: Hello [EMAIL PROTECTED]! On 10-Feb-00, you wrote: k Any word on what toolkits/graphical library system will be k used for the various versions? k I'm curious, since X and amiga have so many of them. None of them, actually. REBOL/View is more than just a GUI frontend to REBOL. You will be amazed when you'll see it. :-) This doesnt make sense to me. Will it be like "something you run inside a window" like f.ex Oberon? Or will it be integrated into the graphical environment of the hosting OS? You open an extra window from console. Console can be hided. Don't know Oberon, sorry. It's not dependant of GUI of entire OS it runs upon. -pekr- -- kolla
[REBOL] How can i get rebol/view Re:(3)
Gabrielle wrote: REBOL/View is more than just a GUI frontend to REBOL. You will be amazed when you'll see it. :-) kolla wrote: This doesn't make sense to me. Will it be like "something you run inside a window" like f.ex Oberon? Or will it be integrated into the graphical environment of the hosting OS? Neither and better... :-D Andrew Martin Who's enjoying teasing the one's without /View... :-) ICQ: 26227169 http://members.xoom.com/AndrewMartin/ --