World: r3wp
[I'm new] Ask any question, and a helpful person will try to answer.
older newer | first last |
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 [4449x2] | 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. |
I'm not sure that's the problem here, though. | |
todun 10-Oct-2011 [4451] | @Henrik, I see. Is this normal coding or just rebol? |
Pekr 10-Oct-2011 [4452x2] | it is normal rebol :-) |
you might use one trick - result-answer/text: copy " " | |
Henrik 10-Oct-2011 [4454x4] | Try this in the console: repeat i 5 [append [] i] and see what happens. You will see that it literally is that block at that memory location that is reused for APPEND. |
which is a clever way for not needing to assign a word to a block to use it, even just temporarily. | |
so, if you type: in the console, a string is really made. you don't need to assign it. you just have no way to reach it by reference, so it's now left in "oblivion" until the garbage collector picks it up. | |
therefore in this bit of code: button-press?: layout [ ; displays output for user interaction result-question: info " " result-answer: info " " two separate strings are also made prior to the LAYOUT function even getting the block passed. Depending on how the code that manages the INFO faces initializes the face, those two strings can possibly be referenced. | |
todun 10-Oct-2011 [4458x4] | @Henrik, wow! |
@Henrik, so what is REBOL if not call-by-reference? | |
@Pekr, will this work in light of Henrik's remarks? | |
@Pekr, what I mean to say is that will the code be useful in the situation where all of my code seems to be relying on different programming paradigms? | |
Pekr 10-Oct-2011 [4462] | todun - I am not a good programmer, so difficult to say :-) But - many ppl get into some gotchas, when using REBOL. Btw - do you know, that subobjects (objects inside objects) are shared? |
todun 10-Oct-2011 [4463x2] | @Pekr, uhm. do you mean like the scope or something similar? |
@Pekr, I'm actually a new programmer myself. But I didn't start with REBOL thus my confusion. | |
Pekr 10-Oct-2011 [4465x2] | >> person: context [name: copy "" address: context [street: copy ""]] >> a: make person [name: "petr"] >> probe a make object! [ name: "petr" address: make object! [ street: "" ] ] >> b: make person [name: "henrik"] >> a/address/street: "petr's street" == "petr's street" >> probe a make object! [ name: "petr" address: make object! [ street: "petr's street" ] ] >> probe b make object! [ name: "henrik" address: make object! [ street: "petr's street" ] ] |
I mean - when you have a prototype object, which uses subobjects, those are shared between the clones ... | |
todun 10-Oct-2011 [4467] | @Pekr, in this context, what is a prototype object? |
Henrik 10-Oct-2011 [4468] | todun, "call-by-reference" I will defer that question to someone who better knows programming terminology, than me. |
todun 10-Oct-2011 [4469] | @Henrik. ok |
older newer | first last |