Would anyone mind..

classic Classic list List threaded Threaded
32 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Would anyone mind..

Mike Bonner
Would anyone mind checking over a stack for me?  I've come to the
conclusion that I just don't have the energy for a real project (plus with
my design skills its pretty much out of my reach) but I do think there are
some  useful aspects to the thing as it sits right now.  Unfortunately my
other efforts to extend it have.. er.. How to put this politely.  Ok
they've sucked.

As it sits, the stack will track the mainstacks that are open, filtered
based on a list of filters in a field. (to eliminate untitled mainstacks
and rev stacks from the list) The list should auto update when changes are
made (thanks to pete, thanks pete!)
It also maintains a list of all stacks currently backed up. The backups are
stored in an array in a property of the stack.

What its good for:
Want to take a snapshot of a mainstack and all of its substacks that are in
memory? (They don't have to be saved, and even if they are, the version is
memory is what will be backed up) select from the list and click backup.
 The stacks are added to the array of backed up stacks, and the plugin
stack saves itself.

If you took a snapshot of a stack hierarchy and then manage to break the
stack you're working on, you can then recover the snapshot and look at the
code of the recovered copy along side the main working stack. If a stack is
with an identical name is already in memory the recovered stacks are named
"copy of thestackname" so there is no worry about the "that stack is
already in memory" message.

Want to revert to the snapshot? Just close the stacks you wish to dump,
then either rename the "copy of.." or close the misnamed stacks and then
recover them again. They'll pop back out with the correct name as long as a
stack name is not already in use. If the destroystack property is not set
for your stacks this means forcibly removing them from memory.

Thats about it.  Why am I blabbing all this here? Because someone (with a
better grasp of design and structure for this sort of thing, AKA not me)
could easily convert the method in to a cvs.  The sheer speed at which a
stack and its substacks can be grabbed this way is amazing, So, anyone and
everyone is welcome to look it over, incorporate any pieces and/or parts
into different projects, mangle it, whatever.

The current version of the stack can be found at
https://dl.dropbox.com/u/11957935/mdbRevisionPlugin.livecode The automagic
stack updates won't work unless the stack script is inserted into front.
The scripts are documented, and there is a test stack "saved" as a backup
in a property of the stack. the test stack has a field with another short
description of how things work.
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Would anyone mind..

Jim L.
Hi Mike,

Thank you for contributing this plugin to the community.

I've tried it out this morning and it worked flawlessly.  

I like your UI as it is … simple and intuitive.

The code is nicely documented.  

Thanks again,

Jim Little


On Sep 30, 2012, at 6:52 PM, Mike Bonner wrote:

> Would anyone mind checking over a stack for me?  I've come to the
> conclusion that I just don't have the energy for a real project (plus with
> my design skills its pretty much out of my reach) but I do think there are
> some  useful aspects to the thing as it sits right now.  Unfortunately my
> other efforts to extend it have.. er.. How to put this politely.  Ok
> they've sucked.
>
> As it sits, the stack will track the mainstacks that are open, filtered
> based on a list of filters in a field. (to eliminate untitled mainstacks
> and rev stacks from the list) The list should auto update when changes are
> made (thanks to pete, thanks pete!)
> It also maintains a list of all stacks currently backed up. The backups are
> stored in an array in a property of the stack.
>
> What its good for:
> Want to take a snapshot of a mainstack and all of its substacks that are in
> memory? (They don't have to be saved, and even if they are, the version is
> memory is what will be backed up) select from the list and click backup.
> The stacks are added to the array of backed up stacks, and the plugin
> stack saves itself.
>
> If you took a snapshot of a stack hierarchy and then manage to break the
> stack you're working on, you can then recover the snapshot and look at the
> code of the recovered copy along side the main working stack. If a stack is
> with an identical name is already in memory the recovered stacks are named
> "copy of thestackname" so there is no worry about the "that stack is
> already in memory" message.
>
> Want to revert to the snapshot? Just close the stacks you wish to dump,
> then either rename the "copy of.." or close the misnamed stacks and then
> recover them again. They'll pop back out with the correct name as long as a
> stack name is not already in use. If the destroystack property is not set
> for your stacks this means forcibly removing them from memory.
>
> Thats about it.  Why am I blabbing all this here? Because someone (with a
> better grasp of design and structure for this sort of thing, AKA not me)
> could easily convert the method in to a cvs.  The sheer speed at which a
> stack and its substacks can be grabbed this way is amazing, So, anyone and
> everyone is welcome to look it over, incorporate any pieces and/or parts
> into different projects, mangle it, whatever.
>
> The current version of the stack can be found at
> https://dl.dropbox.com/u/11957935/mdbRevisionPlugin.livecode The automagic
> stack updates won't work unless the stack script is inserted into front.
> The scripts are documented, and there is a test stack "saved" as a backup
> in a property of the stack. the test stack has a field with another short
> description of how things work.
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Would anyone mind..

Mike Bonner
Thanks for the kind words, glad it actually worked too!

Mike

On Mon, Oct 1, 2012 at 10:03 AM, Jim Little <[hidden email]> wrote:

> Hi Mike,
>
> Thank you for contributing this plugin to the community.
>
> I've tried it out this morning and it worked flawlessly.
>
> I like your UI as it is … simple and intuitive.
>
> The code is nicely documented.
>
> Thanks again,
>
> Jim Little
>
>
> On Sep 30, 2012, at 6:52 PM, Mike Bonner wrote:
>
> > Would anyone mind checking over a stack for me?  I've come to the
> > conclusion that I just don't have the energy for a real project (plus
> with
> > my design skills its pretty much out of my reach) but I do think there
> are
> > some  useful aspects to the thing as it sits right now.  Unfortunately my
> > other efforts to extend it have.. er.. How to put this politely.  Ok
> > they've sucked.
> >
> > As it sits, the stack will track the mainstacks that are open, filtered
> > based on a list of filters in a field. (to eliminate untitled mainstacks
> > and rev stacks from the list) The list should auto update when changes
> are
> > made (thanks to pete, thanks pete!)
> > It also maintains a list of all stacks currently backed up. The backups
> are
> > stored in an array in a property of the stack.
> >
> > What its good for:
> > Want to take a snapshot of a mainstack and all of its substacks that are
> in
> > memory? (They don't have to be saved, and even if they are, the version
> is
> > memory is what will be backed up) select from the list and click backup.
> > The stacks are added to the array of backed up stacks, and the plugin
> > stack saves itself.
> >
> > If you took a snapshot of a stack hierarchy and then manage to break the
> > stack you're working on, you can then recover the snapshot and look at
> the
> > code of the recovered copy along side the main working stack. If a stack
> is
> > with an identical name is already in memory the recovered stacks are
> named
> > "copy of thestackname" so there is no worry about the "that stack is
> > already in memory" message.
> >
> > Want to revert to the snapshot? Just close the stacks you wish to dump,
> > then either rename the "copy of.." or close the misnamed stacks and then
> > recover them again. They'll pop back out with the correct name as long
> as a
> > stack name is not already in use. If the destroystack property is not set
> > for your stacks this means forcibly removing them from memory.
> >
> > Thats about it.  Why am I blabbing all this here? Because someone (with a
> > better grasp of design and structure for this sort of thing, AKA not me)
> > could easily convert the method in to a cvs.  The sheer speed at which a
> > stack and its substacks can be grabbed this way is amazing, So, anyone
> and
> > everyone is welcome to look it over, incorporate any pieces and/or parts
> > into different projects, mangle it, whatever.
> >
> > The current version of the stack can be found at
> > https://dl.dropbox.com/u/11957935/mdbRevisionPlugin.livecode The
> automagic
> > stack updates won't work unless the stack script is inserted into front.
> > The scripts are documented, and there is a test stack "saved" as a backup
> > in a property of the stack. the test stack has a field with another short
> > description of how things work.
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Would anyone mind..

Mark Smith
Hi Mike, what is a cvs?

-- Mark
Reply | Threaded
Open this post in threaded view
|

Re: Would anyone mind..

Mike Bonner
er.. vcs. :) cvs is dislexia.

On Mon, Oct 1, 2012 at 7:56 PM, Mark Smith <[hidden email]>wrote:

> Hi Mike, what is a cvs?
>
> -- Mark
>
>
>
> --
> View this message in context:
> http://runtime-revolution.278305.n4.nabble.com/Would-anyone-mind-tp4655630p4655711.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Finally found one.

dunbarxx




Finally found reproducible scripts that work as advertised when stepping through in the deBugger, but do not when simply run. This gremlin has been sighted, like the Yeti, by nominally sane people, but never caught.


Make two buttons. Name one "start". Name the other "stop".


in btn "start":
on mouseUp
   put the seconds + 8 into tSecs
   showrandoms tSecs
end mouseUp


In btn "stop":
on mouseup
   send "showRandoms" && 0 to this card
end mouseup


In the card script:
on showRandoms tSecs
   put random(99)
   if tSecs = 0 then
      exit to top
   end if
   if tSecs > the seconds then send "showRandoms" && tSecs to me in 0 millisecs
end showRandoms


Try it. If you press the "start" button, you get random numbers in msg for eight seconds. If you press the "stop" not while this is going on, nothing happens.


If you place a breakpoint at the "exit to top" line in the card script. the handler is caught there, and if you then step through, you exit. The "stop" button resets the variable "tSecs" to a value that will force showRandoms to end. And it does, but only if you step through, not if you run it. The variable watcher shows a "0" as the value of tSecs, as it should, and the conditional tosses you out of the handler. As it should.


But not in a normal run, only in the debugger.


I have been chasing this since 1987. I am not crazy. I have pictures. I will start a support group.


Craig Newman

 
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Would anyone mind..

Dr. Hawkins
In reply to this post by Mike Bonner
On Mon, Oct 1, 2012 at 6:58 PM, Mike Bonner <[hidden email]> wrote:
> er.. vcs. :) cvs is dislexia.

Nah, I can see the sign for the local CVS from my back yard.  I'd
rather look from the front to the Sam's Town sign, though . . .


--
Richard E. Hawkins, Esq.
(702) 508-8462

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Would anyone mind..

Mike Bonner
ok, my turn. Whats cvs? (would probably know but I live in bfe)

On Mon, Oct 1, 2012 at 8:43 PM, Dr. Hawkins <[hidden email]> wrote:

> On Mon, Oct 1, 2012 at 6:58 PM, Mike Bonner <[hidden email]> wrote:
> > er.. vcs. :) cvs is dislexia.
>
> Nah, I can see the sign for the local CVS from my back yard.  I'd
> rather look from the front to the Sam's Town sign, though . . .
>
>
> --
> Richard E. Hawkins, Esq.
> (702) 508-8462
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Would anyone mind..

Jim L.
Mike,

I agree.  It does seem that your plugin could be readily expanded into a version control system.  

Jim Little  



On Oct 1, 2012, at 7:48 PM, Mike Bonner wrote:

> ok, my turn. Whats cvs? (would probably know but I live in bfe)
>
> On Mon, Oct 1, 2012 at 8:43 PM, Dr. Hawkins <[hidden email]> wrote:
>
>> On Mon, Oct 1, 2012 at 6:58 PM, Mike Bonner <[hidden email]> wrote:
>>> er.. vcs. :) cvs is dislexia.
>>
>> Nah, I can see the sign for the local CVS from my back yard.  I'd
>> rather look from the front to the Sam's Town sign, though . . .
>>
>>
>> --
>> Richard E. Hawkins, Esq.
>> (702) 508-8462
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Finally found one.

mwieder
In reply to this post by dunbarxx
Craig-

Monday, October 1, 2012, 7:25:49 PM, you wrote:

[bunch of stuff deleted]

> Try it. If you press the "start" button, you get random numbers
> in msg for eight seconds. If you press the "stop" not while this is
> going on, nothing happens.

You need to give the engine some room to breathe. Insert the line

wait 0 milliseconds with messages

at the start of your showRandoms function. The "with messages" part
will allow the engine a chance to look around and see if any events
have occurred (as for instance someone pressing the Stop button).
Otherwise you've coded up a loop that's so tight the engine will never
see the mouseUp (or any other) message.

When you're running this in the debugger there are a lot of engine
events happening - your actual code is only a small fraction of that,
and the engine is paying attention to everything in the environment.
That's why your mouseclicks get registered.

--
-Mark Wieder
 [hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
--
 Mark Wieder
 ahsoftware@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Finally found one.

dunbarxx
In reply to this post by dunbarxx

Mark.


I thought of that, but believed that the "send in time", where I even increased the time value to, say, 100 ticks, would be more than enough to allow the engine to "rest".



So I am misunderstanding the two paths. I see clearly what "wait with messages" does. But I am trying to avoid "wait" in general. This from an old HC user.


But I thought that "send in time" also placed control back in the hands of the engine (the message pending) for the specified interval. What else is going on during that time? There is no loop. The handler ends, the message is queued, and I would have thought that I can invoke a new instance of that handler from another source, like clicking a button.



This was derived from a post I made on the forum. I tried something like this, and failed, eventually setting a custom property and checking its value to allow the poster to do just what I mentioned.


Thanks,


Craig




-----Original Message-----
From: Mark Wieder <[hidden email]>
To: How to use LiveCode <[hidden email]>
Sent: Tue, Oct 2, 2012 1:10 am
Subject: Re: Finally found one.


Craig-

Monday, October 1, 2012, 7:25:49 PM, you wrote:

[bunch of stuff deleted]

> Try it. If you press the "start" button, you get random numbers
> in msg for eight seconds. If you press the "stop" not while this is
> going on, nothing happens.

You need to give the engine some room to breathe. Insert the line

wait 0 milliseconds with messages

at the start of your showRandoms function. The "with messages" part
will allow the engine a chance to look around and see if any events
have occurred (as for instance someone pressing the Stop button).
Otherwise you've coded up a loop that's so tight the engine will never
see the mouseUp (or any other) message.

When you're running this in the debugger there are a lot of engine
events happening - your actual code is only a small fraction of that,
and the engine is paying attention to everything in the environment.
That's why your mouseclicks get registered.

--
-Mark Wieder
 [hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 

 
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Finally found one.

dunbarxx
Mark.


I had not even time to try the wait with messages thing, when I read Bernd's reply in the forum (I posted there as well).



Check it out. Now I have to go experiment some more.



Craig




-----Original Message-----
From: dunbarx <[hidden email]>
To: use-livecode <[hidden email]>
Sent: Tue, Oct 2, 2012 9:49 am
Subject: Re: Finally found one.



Mark.


I thought of that, but believed that the "send in time", where I even increased
the time value to, say, 100 ticks, would be more than enough to allow the engine
to "rest".



So I am misunderstanding the two paths. I see clearly what "wait with messages"
does. But I am trying to avoid "wait" in general. This from an old HC user.


But I thought that "send in time" also placed control back in the hands of the
engine (the message pending) for the specified interval. What else is going on
during that time? There is no loop. The handler ends, the message is queued, and
I would have thought that I can invoke a new instance of that handler from
another source, like clicking a button.



This was derived from a post I made on the forum. I tried something like this,
and failed, eventually setting a custom property and checking its value to allow
the poster to do just what I mentioned.


Thanks,


Craig




-----Original Message-----
From: Mark Wieder <[hidden email]>
To: How to use LiveCode <[hidden email]>
Sent: Tue, Oct 2, 2012 1:10 am
Subject: Re: Finally found one.


Craig-

Monday, October 1, 2012, 7:25:49 PM, you wrote:

[bunch of stuff deleted]

> Try it. If you press the "start" button, you get random numbers
> in msg for eight seconds. If you press the "stop" not while this is
> going on, nothing happens.

You need to give the engine some room to breathe. Insert the line

wait 0 milliseconds with messages

at the start of your showRandoms function. The "with messages" part
will allow the engine a chance to look around and see if any events
have occurred (as for instance someone pressing the Stop button).
Otherwise you've coded up a loop that's so tight the engine will never
see the mouseUp (or any other) message.

When you're running this in the debugger there are a lot of engine
events happening - your actual code is only a small fraction of that,
and the engine is paying attention to everything in the environment.
That's why your mouseclicks get registered.

--
-Mark Wieder
 [hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 

 
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Finally found one.

mwieder
In reply to this post by dunbarxx
Craig-

> I thought of that, but believed that the "send in time", where I even
increased the time value to, say, 100 ticks, would be more than enough to allow
the engine to "rest".

It's not a matter of giving the engine time to "rest". See below.

> I see clearly what "wait with messages" does.

No, I do think you're missing the point. It's the "with messages" part that's
important, not the "wait" part. It doesn't matter how long you wait - if you
omit the messages part the engine still won't be looking for other events. "With
messages" says "look around and see what other messages may have been triggered
before continuing". As in, someone might have clicked a button. Or a message may
have come in from another control. Or another timer has expired. Or...

> But I am trying to avoid "wait" in general

Waiting for 0 milliseconds is essentially not waiting. It just gives us
something to tack the "with messages" part onto. So don't be afraid of waiting
for no time. The overhead of checking for messages will take up more time than
the wait statement and you won't even notice it.

--
 Mark Wieder
 [hidden email]





_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
--
 Mark Wieder
 ahsoftware@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Finally found one.

J. Landman Gay
On 10/2/12 12:49 PM, Mark Wieder wrote:
> Craig-
>
>> I thought of that, but believed that the "send in time", where I even
> increased the time value to, say, 100 ticks, would be more than enough to allow
> the engine to "rest".
>
> It's not a matter of giving the engine time to "rest". See below.

I added "wait 0 with messages" to Craig's card handler and it didn't
work. :( I've been tinkering with it and I can't find anything so far
that makes it work.

I did think that sending a message in time allows a brief idle state
where the engine would pick up any pending user actions. I've used it
with a 0 millisecond send in order to force events to go through. In
this case I can't find anything that allows the Stop button to work.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Finally found one.

Pierre Sahores-2
Jacque,

Try inside opencard :

if MyStartUpVar is not a number then  
send opencard to this cd in 0 milliseconds
put "1" into MyStartUpVar
end if

or :

something with message without waiting

Best,

Pierre

Le 2 oct. 2012 à 22:06, J. Landman Gay a écrit :

> On 10/2/12 12:49 PM, Mark Wieder wrote:
>> Craig-
>>
>>> I thought of that, but believed that the "send in time", where I even
>> increased the time value to, say, 100 ticks, would be more than enough to allow
>> the engine to "rest".
>>
>> It's not a matter of giving the engine time to "rest". See below.
>
> I added "wait 0 with messages" to Craig's card handler and it didn't work. :( I've been tinkering with it and I can't find anything so far that makes it work.
>
> I did think that sending a message in time allows a brief idle state where the engine would pick up any pending user actions. I've used it with a 0 millisecond send in order to force events to go through. In this case I can't find anything that allows the Stop button to work.
>
> --
> Jacqueline Landman Gay         |     [hidden email]
> HyperActive Software           |     http://www.hyperactivesw.com
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

--
Pierre Sahores
mobile : 06 03 95 77 70
www.sahores-conseil.com


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Finally found one.

John Craig-4
In reply to this post by dunbarxx
Hi, Craig.  Looks like the trouble is that you've always got a pending
message, so after you press stop, there's another message fired
immediately to start things rolling again.

try this handler in the card;

command cancelMessages pMessages
    -- cancel any pending messages in the pMessages list
    if pMessages = empty then exit cancelMessages
    put the pendingMessages into tPending
    repeat for each line tMsg in tPending
       put item 1 of tMsg into tID
       put item 3 of tMsg into tName
       if tName is among the items of pMessages then cancel tID
    end repeat
end cancelMessages



and change your showRandoms command to;


on showRandoms tSecs
    put random(99)
    if tSecs = 0 then
       cancelMessages "showRandoms"
       exit to top
    end if
    if tSecs > the seconds then send "showRandoms" && tSecs to me in 10
millisecs
end showRandoms


HTH  :)



On 02/10/2012 03:25, [hidden email] wrote:

>
>
>
> Finally found reproducible scripts that work as advertised when stepping through in the deBugger, but do not when simply run. This gremlin has been sighted, like the Yeti, by nominally sane people, but never caught.
>
>
> Make two buttons. Name one "start". Name the other "stop".
>
>
> in btn "start":
> on mouseUp
>     put the seconds + 8 into tSecs
>     showrandoms tSecs
> end mouseUp
>
>
> In btn "stop":
> on mouseup
>     send "showRandoms" && 0 to this card
> end mouseup
>
>
> In the card script:
> on showRandoms tSecs
>     put random(99)
>     if tSecs = 0 then
>        exit to top
>     end if
>     if tSecs > the seconds then send "showRandoms" && tSecs to me in 0 millisecs
> end showRandoms
>
>
> Try it. If you press the "start" button, you get random numbers in msg for eight seconds. If you press the "stop" not while this is going on, nothing happens.
>
>
> If you place a breakpoint at the "exit to top" line in the card script. the handler is caught there, and if you then step through, you exit. The "stop" button resets the variable "tSecs" to a value that will force showRandoms to end. And it does, but only if you step through, not if you run it. The variable watcher shows a "0" as the value of tSecs, as it should, and the conditional tosses you out of the handler. As it should.
>
>
> But not in a normal run, only in the debugger.
>
>
> I have been chasing this since 1987. I am not crazy. I have pictures. I will start a support group.
>
>
> Craig Newman
>
>  
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Finally found one.

J. Landman Gay
On 10/2/12 3:42 PM, John Craig wrote:

> Hi, Craig.  Looks like the trouble is that you've always got a pending
> message, so after you press stop, there's another message fired
> immediately to start things rolling again.
>
> try this handler in the card;
>
> command cancelMessages pMessages
>     -- cancel any pending messages in the pMessages list
>     if pMessages = empty then exit cancelMessages
>     put the pendingMessages into tPending
>     repeat for each line tMsg in tPending
>        put item 1 of tMsg into tID
>        put item 3 of tMsg into tName
>        if tName is among the items of pMessages then cancel tID
>     end repeat
> end cancelMessages
>
>
>
> and change your showRandoms command to;
>
>
> on showRandoms tSecs
>     put random(99)
>     if tSecs = 0 then
>        cancelMessages "showRandoms"
>        exit to top
>     end if
>     if tSecs > the seconds then send "showRandoms" && tSecs to me in 10
> millisecs
> end showRandoms
>
>
> HTH  :)

Ah, that's it. I tried handling pending messages differently but in the
wrong place:

on showRandoms tSecs
   put random(99)
   wait 0 with messages
   if tSecs = 0 then
     exit to top
   end if
   if tSecs > the seconds and "showRandoms" is not in the pendingmessages
   then send "showRandoms" && tSecs to me in 5
end showRandoms

Your way works.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Finally found one.

mwieder
In reply to this post by J. Landman Gay
J. Landman Gay <jacque@...> writes:

> I added "wait 0 with messages" to Craig's card handler and it didn't
> work. :( I've been tinkering with it and I can't find anything so far
> that makes it work.

OK - granted I've only tried it on Windows and linux so far.
There may be some other platform out there.
I'll give it a try again when I get back to my mac.

--
 Mark Wieder
 [hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
--
 Mark Wieder
 ahsoftware@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Would anyone mind..

Mark Smith
In reply to this post by Mike Bonner
Mike Bonner wrote
er.. vcs. :) cvs is dislexia.
Thanks :-)
Reply | Threaded
Open this post in threaded view
|

Re: Finally found one.

ScottR
In reply to this post by dunbarxx
Mark:  One thing worth noting is that "send xyz to me in 0 millisecs" can allow screen updates and other events to take place, while attempts to do the same in a repeat loop may not.  So I'm pretty sure other events will take place before the send is executed.  This is why long running sessions of "send" with a specific interval can eventually get thrown off.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design

On Oct 2, 2012, at 7:28 PM, Mark Wieder <[hidden email]> wrote:

> Scott-
>
> Yes to all the above with the exception that I'm not sure
>
> send xyz to me in 0 milliseconds
>
> gives any time for other messages to get through.
>
> --
> -Mark Wieder
> [hidden email]
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
12