r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Rebol School] Rebol School

shadwolf
21-Aug-2011
[3843x3]
rebol school is void since the core stuff designing rebol isn't populated 
PARSE
rebol school my ass you don't even  know how to do a dialect or to 
properly use parse
rebol school is yet another self satisfactory idiom used by those 
self proclamed gurus
Henrik
21-Aug-2011
[3846]
Marco, my response to you seems to have scrolled away. Did you get 
it?
Geomol
21-Aug-2011
[3847]
:) Nice way to put it, Henrik!
Marco
21-Aug-2011
[3848]
@Henrik I have a mix of "settable" and "unsettable" values (eg. the 
color of a "box") and I don't use your kit (at the moment).
todun
4-Oct-2011
[3849x4]
hello.
is there a way to remove the newline at the end of a file?
is there a way to remove the newline at the end of a file?
my last attempt to connect to the room failed...
Ashley
4-Oct-2011
[3853]
write %b.txt trim/tail read %a.txt
todun
4-Oct-2011
[3854x5]
@Ashley Thanks. I will try that.  Also, do you know how I can display 
 each line of a file in an "info" field when using "view layout"?
My intention is to have a button that I will press that will tell 
me what the next line to read and display will be.
So one button will let me go 5 lines in the file. Another 20 lines 
etc.
Then when I quit the view, I will have the last line read be the 
starting point.
trim/tail did not work for me.
PeterWood
5-Oct-2011
[3859]
Try:

write %b.txt head remove back tail read %a.txt

(I think that trim doesn't treat a "newline" as whitespace)
todun
5-Oct-2011
[3860]
PeterWood: Thanks . sadly that didn't work either. though the other 
issues are greater at this point.
GrahamC
5-Oct-2011
[3861]
You should be able to open/direct, skip to the end and write a space 
or null to the end
todun
5-Oct-2011
[3862]
@GrahamC, how do I accomplish this?
PeterWood
5-Oct-2011
[3863x2]
The code that I gave does remove a newline from the end of a file:

>> read/binary %a.txt                            

== #{31323334350E}

>> write %b.txt head remove back tail read %a.txt

>> read/binary %b.txt                           
 
== #{3132333435}
Can you show the last few characters of your file here?
Geomol
5-Oct-2011
[3865x2]
The example with trim/tail does remove the newline from the end here.
Peter, on what system is #{0E} a newline?
todun
5-Oct-2011
[3867x3]
How do I make a file containing tokens on each line be displayed 
one at a time in an "info" field (.ie. non-modifiable view, just 
readable) on the view when I click a button?
How do I make the data loaded from the file change to another token 
in the file when I click another button?
@PeterWood, thanks for the suggestion. I will try that.
Kaj
5-Oct-2011
[3870]
Please don't cross-post, thanks
PeterWood
5-Oct-2011
[3871x3]
John: It isn't it was my mistake.
Here is the correction:

>> write %a.txt "12345^/"                       
 
>> read/binary %a.txt   
 
== #{31323334350A}

>> write/binary %b.txt head remove back tail read %a.txt

>> read/binary %b.txt                                  
 
== #{3132333435}
So I believe the answer to todun's issue is the need to use the binary 
refinement of write to stop REBOL adding a newline at the end of 
the file.
todun
5-Oct-2011
[3874]
@Kaj, I have no idea what the conventions are here or what all the 
different rooms mean. I assumed that my questions in "I'm new" were 
not meeting the requiremetns of the room so I posted here. Sorry 
if I'm tresspasing on some rule here.
Henrik
5-Oct-2011
[3875]
we usually simply say "let's talk in group X", if a specific topic 
is inappropriate for the current group.
todun
5-Oct-2011
[3876x3]
@Henrik, thanks for the tip.
@PeterWood, ok. thanks. I will try that.
how can I do MVC(Model View Controller) in REBOL? Thanks.
Kaj
5-Oct-2011
[3879]
Look in the !QM QuarterMaster group here
todun
5-Oct-2011
[3880]
@Kaj: do I repost the question there or  is this information someplace 
online?
Kaj
5-Oct-2011
[3881]
The answer is in there, so I don't think you'll have to repost :-)
todun
5-Oct-2011
[3882]
@Kaj, I just reposted. Oops.
Kaj
5-Oct-2011
[3883]
It's a good approach to want to design a first REBOL GUI program 
in MVC parts, but I think you'll find when you fit them together, 
that the resulting code would blend together. We don't really talk 
in MVC terms about View code
todun
5-Oct-2011
[3884]
@Kaj, what is idiomatic REBOL to approach my problem? How do I make 
sense of it?
Kaj
5-Oct-2011
[3885x2]
There's not much idiom for this, like in general in functional languages, 
because for such a small program, not much code is needed in REBOL
Just write the three MVC parts and then fit them together
todun
5-Oct-2011
[3887]
@Kaj, ok. So I can just write all my VIEW as a function. Repeat the 
same for Model and CONTROLLER? How will I then combine them?
Kaj
5-Oct-2011
[3888x2]
A view is typically a template. In REBOL, it would be a piece of 
View dialect
Model and controller would be functions, that you can then connect 
to the View GUI
todun
5-Oct-2011
[3890x3]
@Kaj, thanks. This is begining to make sense. The view is like a 
template, something static the user will see. The MODEL, is a function, 
the controller coordinates with Model and View somehow.
@Kaj, I've not used MVC much myself, but the rumor out there is that 
it's one way to go. So when you say connect them, what do you mean?
@Kaj, Also, when I have a Model with multiple parts that are best 
represesnted as functions themselves, how can I make it available 
to the view(these "sub-functions")?