Page 1 of 1

The "Put" command is not putting

Posted: Sat Mar 24, 2012 8:27 pm
by Maxiogee
Hi,
In a double repeat loop I like to be advised of where the process is at any point in time.

===
on mouseUp
set lockscreen to true
repeat with a = 1 to 1000
repeat with b = a+1 to 1000
put a && b
do stuff
end repeat
end repeat
set lockscreen to false
end mouseUp
===

That, in Hypercard, would show the relevant numbers in the message box.
But, in LiveCard nothing gets displayed in the message box - unless I add in a line

===
on mouseUp
set lockscreen to true
repeat with a = 1 to 1000
repeat with b = a+1 to 1000

wait 1 tick

put a && b
do stuff
end repeat
end repeat
set lockscreen to false
end mouseUp
====

I'm using LiveCode 4.6.1 on a G4 Mac running OS 10.4.11

Is this a LiveCode 'feature' or a Mac thing, and is there a workaround which doesn't add unnecessary pauses to an already lengthy process.

Re: The "Put" command is not putting

Posted: Sat Mar 24, 2012 8:37 pm
by Dixie
Hi...

I don't know what you are trying to do, but if you wish to see A and B increment then you can't have the screen locked. The script below that includes the 'wait with messages' line lets the engine catch its breath and display the increment...

Code: Select all

on mouseUp
   --set lockscreen to true
   repeat with a = 1 to 1000
      repeat with b = a to 1000
         put a && b
         wait 0 millisecs with messages
      end repeat
   end repeat
   --set lockscreen to false
end mouseUp
be well

Dixie

Re: The "Put" command is not putting

Posted: Sat Mar 24, 2012 9:28 pm
by Maxiogee
Thanks Dixie, but - the purpose of the lockscreen is to speed up the process as LiveCode doesn't need to go to new cards and they are are created.

The messagebox in HyperCard was exempt from the lockscreen process and thus the progress of a process could be noted without slowing the process.

Re: The "Put" command is not putting

Posted: Fri Mar 30, 2012 3:44 pm
by dunbarx
YIPES!

I never knew this. It's true. I also use the msg box to track things. LC really locks you out, where HC had let this pass. I suppose the LC way is more consistent, but, well, geez.

I can't find a workaround. And of course setting locksreen back and forth takes noticeable time:

Code: Select all

on mouseUp
   put the ticks into temp
     set lockscreen to true
      repeat with y = 1 to 100
        set lockscreen to false
               put y
      set lockscreen to true
      end repeat
   put the ticks - temp
end mouseUp
There should be a property, the "messageBoxLockScreen". I will post it in the feature request area.

Craig Newman

Re: The "Put" command is not putting

Posted: Fri Mar 30, 2012 3:58 pm
by Maxiogee
Thanks Craig.
I'm new here and didn't know (a) if this was Mac-specific, or (b) where to post it to best effect.

Tony