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.

Sunanda
8-Oct-2011
[4313]
SWAP ... AT should work in R3.

Are you on R2 or R3 -- SWAP exists only in R3 .... Though it is easy 
to write a version for R2.
Henrik
8-Oct-2011
[4314]
SWAP is in R2, 2.7.7 and up, it seems.
todun
8-Oct-2011
[4315x2]
@Sunanda, desktop says I'm using REBOL/View 2.7.8
@Henrik, you seem to be suggesting that i store my intermediate operations...ok. 
Let me try that. thanks.
Henrik
8-Oct-2011
[4317]
so, todun, the general mechanism is that you can store a new index 
of a series, by simply by first move the index and storing the series 
under the same word again:

a: at a 4

This works for BACK, NEXT, AT, SKIP, HEAD, TAIL.

The series will not be modified or copied.


Note that when you COPY, COPY will only copy from the current index 
and forward.


If your index is not at head, HEAD is useful to temporarily reference 
the series from the head, like if you use AT several times in a loop 
or something:

at head a 4
todun
8-Oct-2011
[4318]
@Henrik, ok. I'm trying your first suggestion but it doesn't work. 
I'm trying to do the second one to see if it will work now....
Sunanda
8-Oct-2011
[4319]
I suspect then you do not have SWAP. What do you see if you type 
this at the console?
   swap "abc" "def"
todun
8-Oct-2011
[4320x2]
@Henrik, the assignment you suggest seems to be depopulating my file 
on the button presses
@Sunanda, I get "dbc"
Sunanda
8-Oct-2011
[4322]
Okay -- then you do have SWAP.....That's a start :)
Henrik
8-Oct-2011
[4323x2]
if you save your data with the index moved away from head, then you 
will get data loss.
can you post your revised code?
todun
8-Oct-2011
[4325x3]
@Henrik, I just want to swap the data though.
@Henrik, the code is multi-part. I'm still not sure how many lines 
of code I'm allowed to post here.
@Henrik, I can also post the local portions doing the swapping...but 
that will keep you in the dark on other parts though.
Henrik
8-Oct-2011
[4328]
perhaps about 30-50 lines is OK, but perhaps it makes better sense 
to try the steps in the console.
todun
8-Oct-2011
[4329]
@Henrik, I have tried it in console..or do you mean somethign else 
?
Henrik
8-Oct-2011
[4330x2]
no, I mean the console alright.
but I understand that you save the file to disk after modifying the 
index? perhaps it's the saving process that contains errors.
todun
8-Oct-2011
[4332x3]
@Henrik, let me post it...one second.
@Henrik: better still, can I just send you a pastebin linke
?
Henrik
8-Oct-2011
[4335]
sure
todun
8-Oct-2011
[4336]
pastebin.com/nKswMM5w
Henrik
8-Oct-2011
[4337]
do you have a cards.txt file?
todun
8-Oct-2011
[4338]
yes...should I post that too?
Henrik
8-Oct-2011
[4339]
yes, thanks. gives a better idea of the stored data.
todun
8-Oct-2011
[4340x2]
pastebin.com/TmQm55G7
sorry for the lag, I'm having to work across platforms because of 
altme compatibility issues.
Henrik
8-Oct-2011
[4342]
I get an unknown paste ID
todun
8-Oct-2011
[4343x2]
http://pastebin.com/ZWaw10DA
hopefully that works better.
Henrik
8-Oct-2011
[4345x2]
do you not want the DO block in the layout to be performed after 
FLASHCARD-PARSING? otherwise the questions-list.txt file is not generated 
in time.
based on its content, there is no reason to put the DO block in the 
layout.
todun
8-Oct-2011
[4347x2]
oh...I'm actually using that as is based on a suggestion I got on 
here.
ould I be doing that as you say because I did notice an update lag 
and did not know what to make of it.
Henrik
8-Oct-2011
[4349]
I'm moving the content after FLASHCARD-PARSING right now, so I can 
get the program to start.
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.