World: r3wp
[I'm new] Ask any question, and a helpful person will try to answer.
older newer | first last |
todun 8-Oct-2011 [4350x2] | @Henrik, ok... |
I really don't know where things should or shouldn't go. | |
Henrik 8-Oct-2011 [4352x2] | we'll figure that out eventually. |
so, the user clicks "Show Question" to see a question. then he clicks "Show answer" to see if he's correct? | |
todun 8-Oct-2011 [4354x2] | that'll be wonderful. I've been banging my head on these issues for over a week. |
@Henrik, yes. | |
Henrik 8-Oct-2011 [4356] | ok, and the idea of "Soon" is? |
todun 8-Oct-2011 [4357x2] | ....to move the current question to a forward location in the pool of questions becasue the user doesn't have the answer yet. |
The user will then see the question again,.."Soon" | |
Henrik 8-Oct-2011 [4359] | I see. And you save this, because you want to have the user start where he stopped from, when last quitting the program? |
todun 8-Oct-2011 [4360] | exactly! |
Henrik 8-Oct-2011 [4361] | is there a particular reason that you split the questions and answers in separate files? |
todun 8-Oct-2011 [4362] | since I was new to rebol/view and vid, I didn't know of a better way to make two streams of data, one going to questions and another to asnwers. The prospect of updating two sides of the same list seemed confusing to me hence my split. |
Henrik 8-Oct-2011 [4363] | ok. I think in general you will have an easier time not doing this split. Instead you can work on using the card data directly. Then, what you would save, would be a REBOL formatted copy of those card data. I think this will simplify your program. you are already taking advantage of reading the cards with READ/LINES. when you parse that data, you can turn it into a record with two elements in each, the question and the answer. then by using SAVE/ALL, you can directly save this as your questions and answers, in the custom order that the user likes. |
todun 8-Oct-2011 [4364] | @Henrik, ok. there is allot in there. |
Henrik 8-Oct-2011 [4365] | yes, it might be too dramatic. perhaps it's better to save it for later. |
todun 8-Oct-2011 [4366] | I am not sure how to do these individual steps yet, but I actually do understand the gist of them. |
Henrik 8-Oct-2011 [4367] | there is a typo in line 54: quesiton-list.txt |
todun 8-Oct-2011 [4368x3] | @Henrik, ok. But I do want to explore the options you present because it meets my other goal of working with different data structures in rebol. |
@Henrik, thanks! | |
I wonder why rebol didn't flag that... | |
Henrik 8-Oct-2011 [4371] | it simply writes a new file, so the code is syntactically correct. |
todun 8-Oct-2011 [4372] | oh ok.. |
Henrik 8-Oct-2011 [4373] | as for my writing above, an approach would be to load the cards file and parse it into a format that is comfortable to work with in REBOL. |
todun 8-Oct-2011 [4374x2] | ok |
what about the issue of swapping though? | |
Henrik 8-Oct-2011 [4376x4] | perhaps you can try moving back one element after swapping. that might put you in the correct location. |
or perhaps use MOVE instead of SWAP | |
here is a cheap console version: http://pastebin.com/K9w9BEQ1 it does not work entirely the same as yours, but you can use it for inspiration. just ask, if there is something that you don't understand. | |
it will crash at the end, so I leave it as an exercise on how to fix that :-) | |
todun 8-Oct-2011 [4380x5] | @Henrik, thanks. How does using MOVE update the original list? |
going back to my question about using SWAP. | |
I see you moving it within the list but the file doesn't dynamically get changed using MOVE... | |
I get the following error and haven't a clue what is wrong. What normally causes this? Thanks. | |
** Access Error: Cannot open file.txt ** Where: forever ** Near: were: read/lines %were-file.txt | |
Henrik 8-Oct-2011 [4385x2] | MOVE modifies the list like SWAP does, but does not require any adjustments to index. |
** Access Error: Cannot open file.txt ** Where: forever ** Near: were: read/lines %were-file.txt That is possibly because file.txt does not exist and you are trying to read it somewhere near that line of code. | |
todun 8-Oct-2011 [4387] | @Henrik, I see. I will try to better trace the path the file takes to open. thanks. |
todun 9-Oct-2011 [4388x2] | I'm trying to trouble shoot this error I get, but not sure what it means: |
** Script Error: button-press? has no value ** Near: do view button-press? | |
Ladislav 9-Oct-2011 [4390] | It means, that you use the button-press? variable in the above expression. But, you forgot to define that variable. |
todun 9-Oct-2011 [4391x7] | @Ladislav, I'm trying to use the VID dialect. This is how I start my definition of button-press?.... |
button-press: layout [ .....] | |
@Ladislav, I figured out my problem. My typo. | |
thanks. | |
@Henrik, thanks for your help. I think I've figured out most of the code and how to apply it to my situation aka HW. My previous approach was totally confusing me. | |
@Henrik, do you have any advice as to the sort of things I can be learning if I want to understand REBOL better? Like specific problem sets for instance.. The tutorials are good, but they don't seem to be getting across to me. | |
Is there a standard list of what goes into the block following the REBOL flag? I'm thinking javadocs here. Thanks. | |
Ladislav 9-Oct-2011 [4398] | http://www.rebol.com/r3/docs/concepts/scripts-headers.html |
todun 9-Oct-2011 [4399] | @Ladislav, thank you. |
older newer | first last |