| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | binktrim in rebol, again |
here's the binktrim in rebol again. this time it will take command line arguments.
to give you an idea of how asbolutely loud the documentation sucks: it took
me 4 hours to get the information i needed to write 4 of the lines.
i have 'the official rebol guide'. it's over 700 pages, but there's not one
mention of how to get command line arguments to a program. the online
documentation has no mention of it either. once again i had to sift through
536 example programs in the 'rebol script library' to find what i was
looking for.
you're probably wondering what the advantage of rebol is. well size and
resources as i mentioned last message. but the biggest is that with
addition of 5 more lines code you can have the trimmed lines sent to you in
email every hour (or whatever time span you want).
also this code runs unchanged on whatever platform is supported by rebol
(somewhere between 37 and 50 different platforms)
i wouldn't suggest rebol for any general programming. unless you really
know the language there's nothing quick and dirty about it, unless it's net
related
it takes about 6 lines to check a web page and email it to you if it
changed at all. that's pretty hard to beat...
==========================================================================
REBOL []
either not system/script/args == none [
arg: system/script/args
arg: parse arg ""
log: to-file arg/1
binkd-log: read/lines log
days: to-integer arg/2
][
print ""
print "usage: "
print ""
ask "hit enter:"
quit
]
forall binkd-log [
line: first binkd-log
line: parse/all line " "
date: pick line 2
if date none [
month: pick line 3
time: pick line 4
date-time: join date ["-" month "-"
now/year "/" time now/zone]
date-time: to-date date-time
line: rejoin [form line newline]
if (now - date-time) < days [write/append %binkd.trimmed line]
]
]
if exists? log [delete log]
rename %binkd.trimmed log
if exists? %binkd.trimmed [delete %binkd.trimmed]
==========================================================================
--- GoldED/spleen 3.0.1+
* Origin: ventedspleen.dyndns.org (1:249/100)SEEN-BY: 633/267 270 @PATH: 249/100 261/38 123/500 106/2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.