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

World: r3wp

[I'm new] Ask any question, and a helpful person will try to answer.

Henrik
9-Oct-2011
[4400x2]
todun, I would work on learning about the design of REBOL, since 
this is one of the primary features; It's generally well designed, 
very deep and ignores conventions of other languages in that it was 
not designed to be a "satellite language" for java or some such. 
It was developed on its own merits by a person who is very difficult 
to outsmart. I've used it for a decade and there are still concepts 
in it that are beyond my intellectual reach. Once you get the basic 
design, the rest comes on its own.
todun, also, the structure of the program that you wrote hopefully 
shows that it requires a bit of discipline in organizing REBOL code, 
as it can be extremely free form, and it can be a little frustrating 
around generating VID code, because there is a lot going on in that 
type of code. So learning what the LAYOUT function does, (it simply 
generates a tree of objects, that's all), helps you to handle layout 
data with more confidence.


I didn't write the console version through some kind of convention 
(other than basic formatting), but by knowing how to organize data 
sensibly in REBOL for the needs of the program and how simple it 
is to store and retrieve that from disk. There are dozens of ways 
that program could have been written, each equally as valid as the 
other.
todun
9-Oct-2011
[4402x3]
@Henrik, thanks for hte advice. How do I go about learning about 
the design of REBOL without going through specification manuals? 
Did you have a resource in mind?
@Henrik, looking at your example code again, I'm not quite sure what 
the refinement qa/1/2 does. I thought it meant that "get list item 
2 at 1 place away" but I'm not sureanymore..
@Henrik, I ask because I get my results being one off.
Henrik
9-Oct-2011
[4405]
todun: qa/1/2, it means "get block at first position and get second 
item in that block"

it's similar to:

second first qa
Sunanda
9-Oct-2011
[4406]
Nick Antonaccio's tutorial is an excellent place to start:
    http://re-bol.com/rebol.html
todun
9-Oct-2011
[4407x8]
@Henrik, for seem reason I always get the second item in the next 
block. Using the same notation is there a way of getting the second 
item in the current block(head)?
@Sunanda, thanks. I'm looking at it now.
@Henrik, I figured out the problem. I make call next on the input 
at  the end of  the button press. This causes the list to change.
@Henrik, I do need to do a next in the button so that whenever the 
button is pressed, the next question comes up. Is there a way of 
 "holding" the list so it doesn't move around while I try to modify 
it?
@Sunanda,  the tutorial helped me figure out a solution. I made a 
temporary variable to hold the current series then used "back". Then 
simply read the new series.
@Sunanda, thanks.
Is there a way of making the name of a file the header of the view?
For instance, in the REBOL block, the Title will be displayed as 
the title of the layout view. Is there a way to make this title be 
the name of the file read in the program?
Henrik
9-Oct-2011
[4415x2]
view/title layout [button] form %my-file.r
the FORM converts the file! to a string!.
todun
9-Oct-2011
[4417x2]
@Henrik, I have the layout grouping all the buttons before I call 
the view on it like so: 
button-press: layout [ ...}
view button-press
trying the scheme you suggest gives me an error, and I suspect it 
is because of my layout
Henrik
9-Oct-2011
[4419]
what error do you get?
todun
10-Oct-2011
[4420x2]
@Henrik, the error had to do with the view. I am putting that on 
hold for now.
Is it possible to update a series outside of the button that triggers 
it? I run into the problem whereby my series is being prematurely 
updated.
Henrik
10-Oct-2011
[4422]
it sounds like there might be an organizational problem with the 
action code.
todun
10-Oct-2011
[4423]
@Henrik, I'm clueless as to why it is behaving like this.
Henrik
10-Oct-2011
[4424x2]
With VID, each action should not be run, unless you are passing some 
kind of event to a face. you are probably describing your actions 
in blocks in VID, like this:

button "hello" [do stuff here]


it should not do anything outside it, unless you have set up a timer 
(which I doubt) or a FEEL (which I'm not sure you have learned yet), 
so there is probably something wrong in the action code that is run 
as you click your button.
you could also be running into a copy trap, which makes it look like 
your blocks are changed by some unknown source.
todun
10-Oct-2011
[4426]
@Henrik, all these look likely. I just noticed all these new errors 
today when I revisited the code. I actually thought it was working.
Henrik
10-Oct-2011
[4427]
http://www.rebol.net/wiki/Forgoing_faux_pas#The_COPY_Trap
todun
10-Oct-2011
[4428]
@Henrik, I've been debugging for hours and I think I just don't know 
enough about REBOL because the logic of the code seems ok..or that's 
my conclusion anyways.
Henrik
10-Oct-2011
[4429]
can you pastebin the code?
todun
10-Oct-2011
[4430x2]
sure.
http://pastebin.com/YabkWa8p
Henrik
10-Oct-2011
[4432]
I get an unknown paste ID
todun
10-Oct-2011
[4433x3]
@Henrik..let me post it again
http://pastebin.com/eixcKrTQ
sorry about that. I don't know why it keeps doing that sometimes.
Henrik
10-Oct-2011
[4436]
maybe there is a timeout on pastes
todun
10-Oct-2011
[4437x2]
@Henrik, ok.
@Henrik, does it work now?
Henrik
10-Oct-2011
[4439]
yes, I can see it.
todun
10-Oct-2011
[4440]
ok
Henrik
10-Oct-2011
[4441]
which button press shows the error? and which series?
todun
10-Oct-2011
[4442x5]
@Henrik, it is not so much an error as that it doesn't do what it 
should do by design
so when I press SOON, it should advance the question 5 places ahead. 
The temp file shows it does.
the display shows a  series that didn't change
the same behavior happens for all of them.
I tried move/to ; move/skip and even tried backtracking with back 
at every button press, without luck
Henrik
10-Oct-2011
[4447]
is one expected to click "Show Question" after clicking "Soon"?
todun
10-Oct-2011
[4448]
@Henrik, yes. to get to see the other questions.
Henrik
10-Oct-2011
[4449]
result-answer/text: " "
show result-answer


This will assign a new string to the TEXT facet of the RESULT-ANSWER 
face. What to be careful of here is that every time you pass that 
bit in the code, it is the exact same string (same memory location) 
and not a new string that gets assigned. That means that if something 
is put in there from another location, that memory location will 
no longer be empty, and the content will be shown in RESULT-ANSWER.