• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r4wp

[Rebol School] REBOL School

GrahamC
20-May-2012
[331]
odbc drivers for windows can only be used with the rebol/view, the 
gui build, unless you paid for a rebol/command sdk
Arnold
20-May-2012
[332x2]
Hi Bas, no didn't know that one, maybe there should be an universalopensubtitleday 
to generate more attention to it :)
The subtitles seem to be kept on their servers. Which is not a problem 
for a video on the web, but for my purpose it is not what I want.
Gregg
20-May-2012
[334]
On filename quoting, I have an ENQUOTE func (and a more generic ENCLOSE, 
ENCLOSED?, etc.) to make the intent clear. MOLD is shorter, but if 
you pass things around, not knowing if they've already been molded, 
you can get tripped up. At least I have.
Arnold
20-May-2012
[335]
MOLD is definitely more vague, could become anyshape the form of 
the mold is. An ENQUOTE saves the time finding out what it does.
Ladislav
20-May-2012
[336x2]
You have to do it like this

random/seed now/precise
token: random/secure 
1000000


- mathematically, the above code does not differ from token: now/precise
(it is neither more "random" nor more "secure")
Kaj
20-May-2012
[338]
Except that you get a date instead of an integer?
GrahamC
21-May-2012
[339]
Enlghten us Ladislav
Ladislav
21-May-2012
[340]
The principle is that the token calculated that way:

1) depends only on now/precise, in fact

2) since there are the is the RANDOM/SEED and RANDOM calls, it is 
still possible that in some cases distinct NOW/PRECISE results lead 
to the same TOKEN value
Arnold
23-May-2012
[341]
Today I tried combining some tables in Excel, but without (frustrating!) 
no success. So tomorrow I will try and build a quicky REBOL script 
to put the data in one Rebdb databasetable and then do a dump of 
that and import that again in Excel.

So I combine data NAME PROP1 with NAME PROP2 giving a table NAME 
PROP1 PROP2
Any tips suggestions for lookalike scripts? Tia!
Kaj
23-May-2012
[342]
Doesn't sound like you need RebDB. You could just do the operation 
on an Excel export such as CSV format
Endo
23-May-2012
[343]
Try using Gregg's perfect REBOL Excel Control Dialect: http://www.robertmuench.ch/development/projects/excel/dialect_documentation/

Also look at Brian's csv-tools on rebol.org:

http://www.rebol.org/view-script.r?script=csv-tools.r&sid=cfnzx597gl
james_nak
23-May-2012
[344]
Arnold, you can also take a look at an .xml file that Excel produces 
and see how that is configured. I've had better success with xml 
files than csv (though I use those as well) since you can add all 
kinds of formatting with XML.
Arnold
23-May-2012
[345]
@kaj and balance-line through the files. A possibility, has some 
tricky attentionpoints in it, and the preferred way when efficiency 
is in the picture or more than once usage. Db seems to be pretty 
straight forward and its a nice exercise in using that.
Thanks Endo, I mailed the links to my work.

@James To me xml just looks like a whole lot of <> characters and 
a lot of description extra. Having to deal with that too seems a 
lot of work more, need a tool for  working quick with xml.
Thank you for all of your suggestions!
Kaj
24-May-2012
[346x3]
There are several XML parsers for REBOL. The most advanced one is 
in the PowerMezz package
http://www.rebol.it/power-mezz/
Does RebDB have easy Excel import/export?
Arnold
24-May-2012
[349x3]
I had the cvs file (one at a time is easiest) read/lines, parsed 
the comma's and then depending on the record with the key name = 
currentrecname being already in the table an insert or an update. 
But the update using db-update/where just gave me trouble beyond 
belief. Trying update within SQL (I am talking about Rebdb here) 
was no problem at least using 1 property at a time (had no more time 
testing). But how to do it using db-update is a mystery to me. Tried 
many things to no avail. My table I created using db-create bt [name 
additive papertype department weight weightline]   How do I update 
the record where name = ABCD and I need only to update columns weight 
and weigthline, both integer (but that's a coincidence, don't mind 
if it could be anything)?
And I thought this would be a quicky! :-)
Any clues if it is possible to test a file for EOF?
Kaj
24-May-2012
[352]
tail?
Arnold
24-May-2012
[353]
If that does the trick I'll try to trick it into believing this eof?: 
tail?
Arnold
25-May-2012
[354]
After some trial and error getting surprised with some thing that 
seemed to work yeterday but didn't today I got it figured out. I 
will post the scripts somewhere when there is interest in it.
caelum
27-May-2012
[355]
A view question. Can the name of a button be changed after it has 
been created?

view layout [button "Text in Button"]


I want to change "Text in Button" to "New Text in Button" and redisplay 
it. I have not come across this anywhere so far?
Sunanda
27-May-2012
[356]
Here's one way:

    view layout [b: button "Text in Button" [face/text: "Changed!" show 
    face]]

Though it'd usually be better to assign the button to a word, so 
you can change the text at other points in your script too:
    view layout [
               but1: button "Text in Button"

               but2: button "Press me" [but1/text: "Changed!" show but1]
      ]
GrahamC
27-May-2012
[357]
I usually label these as btn1 etc so I don't show my butt
Arnold
7-Jun-2012
[358]
When I use rename function to rename a file, the file date on my 
Mac OS X changes too. When I change a name using finder, carefully 
clicking the file and renaming it, the date does not change. Doe 
sthis happen on other platforms too? How to steer this behaviour?
Kaj
7-Jun-2012
[359]
I'm afraid this is where you run into the limitations due to REBOL 
being as platform neutral as possible
GrahamC
7-Jun-2012
[360]
You can use rebol to get the mod date and change it back after the 
move
Evgeniy Philippov
10-Jun-2012
[361x9]
I got an idea from a friend. So I got ready to start my two scripts 
(maybe someone wrote smth similar???) - one window; left pane has 
file system folders tree with top at the script's dir, right pane 
has some content. I want two scripts, every of them is a standalone 
app for its own like-minded audience: 1) plaintext.r, and 2) activetext.r. 
The plaintext.r will have right pane editor for plain text, saving 
it on the fly while editing (when the window is navigated away or 
closed, the text is saved); and activetext.r which has a plaintext-with-rebol-applets 
or .r content at the right pane.
These will be my first two rebol apps.
Well. The activetext.r script will have plaintext-with-embedded-rebol 
applets. And the rtext.r will have .r content at the right pane.
Activetext and rtext will have editor and viewer on the right, however 
plaintext.r will have only editor.
A question: where can I find View syntax reference?
Unknown word or style: tree
Unknown word or style: textarea
REBOL [Title: "rtext.r"]

view layout [treepane: tree contentpane: textarea] 400x400
found a reference...
hmm. How to display a tree of folders and files in REBOL???
Sunanda
10-Jun-2012
[370]
There are some scripts that do that in the script library:
   www.rebol.org/search.r?find=tree
Evgeniy Philippov
10-Jun-2012
[371]
...bloated platforms include tree components by default...
Sunanda
10-Jun-2012
[372]
For a complete package that has a tree view (rather than a separate 
component), try rebGUI:
   http://www.dobeash.com/RebGUI/widgets.html
Endo
11-Jun-2012
[373]
A question: where can I find View syntax reference?
 : http://www.rebol.com/docs/docs.html
See the "Graphical Programming" section.
Maxim
12-Jun-2012
[374]
probe face  
;-)
GiuseppeC
18-Jun-2012
[375]
I have a problem with Parse
The following string does not work
parse line [any [to mystring copy link to {<br />}]]
mystring is a variable
This works
parse line [any [to "http://mysite.com"copy link to {<br />}]]
Can't variables be used after TO ?
GrahamC
19-Jun-2012
[376]
you'd have to use compose on mystring
sqlab
19-Jun-2012
[377]
it works with global variables.
maybe your variable is not visible to parse

>> mys: "ac"
== "ac"
>> parse " abacbac  ba" [any [to mys copy s to "b" (probe s)]]
ac
ac  
== false
GiuseppeC
19-Jun-2012
[378]
How do I parse the same data with different ending ?
I could have
http://myfile.txt</BR>
http://myfile.txt</DIV>
I need something like 
PARSE mystring [copy link to [</ BR>|</ DIV>]
Endo
19-Jun-2012
[379]
to
 doesn't accept block, so put "to" inside the block:

s1: {http://myfile.txt</br>}
s2: {http://myfile.txt</div>}
parse s1 [copy link [to </br> | to </div>] (print link)] ;works

parse s2 [copy link [to </br> | to </div>] (print link)] ;works too
GiuseppeC
19-Jun-2012
[380]
I need something like the following
parse s1 [any [to "http://"copy link [to </br>|to </div>]]
Is it possible ?