Page 1 of 1

this wait until works

Posted: Sun Feb 25, 2007 9:32 pm
by ToreT
Hi,
finally made it, do not how I can upload the stack though...in case someone would like it.

Regards
Tore

Code: Select all

local fromTheBeginning, exitHandler

on oneMoreLine
  -- this handler is for the "Next Line" button
  if fromTheBeginning = true
  then
    -- start handler:
    oneLineAtTheTime
  else
    set the cCustomProp of me to true
  end if
end oneMoreLine

on oneLineAtTheTime
  set the cCustomProp of me to false
  put false into exitHandler
  put false into fromTheBeginning
  repeat with i = 1 to the number of lines in field "myField"
    select line i of field "myField"
    wait until the cCustomProp of me is true with messages
    if exitHandler is true then exit to top
    set the cCustomProp of me to false
  end repeat
  put true into fromTheBeginning
end oneLineAtTheTime

on exitHandlerOneLineAtTheTime
  -- this handler is for the "Exit Loop" button
  put true into exitHandler
  set the cCustomProp of me to true
  put true into fromTheBeginning
end exitHandlerOneLineAtTheTime

on closeStack
  exitHandlerOneLineAtTheTime
end closeStack

Posted: Sun Feb 25, 2007 9:56 pm
by xApple
Ah I see what you are trying to do.
You could have just used a global variable like this:

Code: Select all

on mouseUp
  global i
  if i is empty then put 1 into i
  select line i of field "myField" 
  if i = the number of lines in field "myField" then put 1 into i
  add one to i
end mouseUp

Posted: Fri Mar 02, 2007 10:02 pm
by ToreT
no, the whole point was to use "wait until" in one handler and restart it from another handler. This was just to test it, I skipped all the other stuff and reasons for doing it.

Maybe a bit confusing that i made both handlers start from one button handler.

I should not have put a subject on the last message, because it was supposed to hang on to my other posted subject "Restarting a handler by a message"

Posted: Sat Mar 03, 2007 2:00 am
by marielle
ToreT wrote:no, the whole point was to use "wait until" in one handler and restart it from another handler. This was just to test it, I skipped all the other stuff and reasons for doing it."
Hi ToreT,

Note there was some related discussion on the use-revolution list. It is archived on the codes CMS under like pass, but without ending the handler