extract every code out of stack

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

extract every code out of stack

Claus Dreischer
Hi,

i somehow managed to mess up one of my stacks ...
(Main stack has a preOpenStack handler, the substacks don't.
But now some substacks perform the preOpenStack handler of the main stack when opening these substacks.
I don't have a clue how to fix that.  :-(  )

Is there a way to get all the code from all the objects in all the stacks?
So i can build the whole thing again from scratch.

Something like:

repeat for eack stack my_stack
  repeat for each card my_card of stack my_stack
    repeat for each object my_object of card my_card of stack my_stack
       put my_stack && my_card && my_object && the script of object my_object of card my_card of stack my_stack after my_scripts
    end repeat
  end repeat
end repeat


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

Re: extract every code out of stack

xtalkprogrammer
Hi Claus,

Sure, you could extract every script of every object, but that will  
probably not solve the problem. The actual problem is that you need  
to get aware of the message hierarchy.

Start by moving the preOpenStack handler of the main stack to the  
card script of the first card of that stack. When you open the main  
stack now, the preOpenStack handler in the card script will run, but  
if you open a substack, it will not.

Best,

Mark

--

Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Salery is the easiest way to get your own web store on-line: http://
www.salery.biz/salery.html



Op 30-mei-2006, om 14:11 heeft Claus Dreischer het volgende geschreven:

> Hi,
>
> i somehow managed to mess up one of my stacks ...
> (Main stack has a preOpenStack handler, the substacks don't.
> But now some substacks perform the preOpenStack handler of the main  
> stack when opening these substacks.
> I don't have a clue how to fix that.  :-(  )
>
> Is there a way to get all the code from all the objects in all the  
> stacks?
> So i can build the whole thing again from scratch.
>
> Something like:
>
> repeat for eack stack my_stack
>   repeat for each card my_card of stack my_stack
>     repeat for each object my_object of card my_card of stack my_stack
>        put my_stack && my_card && my_object && the script of object  
> my_object of card my_card of stack my_stack after my_scripts
>     end repeat
>   end repeat
> end repeat
>
>
> Regards,
>    Claus.
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Kind regards,

Drs. Mark Schonewille

Economy-x-Talk Consultancy and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
Facebook: http://facebook.com/LiveCode.Beginner
KvK: 50277553
Reply | Threaded
Open this post in threaded view
|

Re: extract every code out of stack

Klaus major-k
In reply to this post by Claus Dreischer
Hi Claus,

nice to read you again :-)

> Hi,
>
> i somehow managed to mess up one of my stacks ...
> (Main stack has a preOpenStack handler, the substacks don't.
> But now some substacks perform the preOpenStack handler of the main  
> stack when opening these substacks.
> I don't have a clue how to fix that.  :-(  )

you can change the script of your mainstack like this:

on preopenstack
   if the short name of the target <> the short name of this stack then
       exit preopenstack
   end if
   ...
end preopenstack

and you are out of the tailor :-D
(Hint: literal translation of a german saying)

> Is there a way to get all the code from all the objects in all the  
> stacks?
> So i can build the whole thing again from scratch.
>
> Something like:
>
> repeat for eack stack my_stack
>   repeat for each card my_card of stack my_stack
>     repeat for each object my_object of card my_card of stack my_stack
>        put my_stack && my_card && my_object && the script of object  
> my_object of card my_card of stack my_stack after my_scripts
>     end repeat
>   end repeat
> end repeat

This is surely doable!

If you need this list for all substacks of a stack:

...
put the substacks of this stack into STList
   repeat for each line i in STList
   ## loop through all substacks

     put the num of cds of stack i into Numocds
       repeat with k = 1 to Numocds
      ## loop through all cards of this stack

         put the num of controls of cd k of stack i into Controllist
             repeat with m = 1 to Controllist
            ## loop through all objects on this card of stack
                 put i && "Card:" && k && the short name of control m  
of cd k of stack i && the script of control m of cd k of stack i  
after myList
       .....


You get the picture.

> Regards,
>    Claus.

Best

the other Klaus :-)


Klaus Major
[hidden email]
http://www.major-k.de

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

Re: extract every code out of stack/Addendum

Klaus major-k
In reply to this post by Claus Dreischer
Hi Claus,

there is a similar functionailty in my plug-in "2lz2"!
Button: "misc..." -> "Analyze this..."

Take a look, might help you.


Regards

Klaus Major
[hidden email]
http://www.major-k.de

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

[EN][FR]Re: extract every code out of stack

Dom-2
In reply to this post by Claus Dreischer
Claus Dreischer <[hidden email]> wrote:

> Is there a way to get all the code from all the objects in all the stacks?

you may take a glance at "Rappus"

from my description:

Rappus is a small tool to write down a stack's scripts under text files.
A folder is created at the same level than the stack. Another folder is
created within the first folder to host the first* card's scripts, and
another folder for every group on the card.
* The stack reports only at this time the first card's scripts; it
assumes that all cards are identical.

the link:

http://domiscript.free.fr/Rev/DescriUS/rappus.html

take note that this work is improvable ;-)

for the french-speaking persons:

Rapp est un petit utilitaire servant à enregistrer les scripts d'une
pile sous format texte.
Un dossier est créé au même niveau que la pile à étudier. Un
sous-dossier est créé pour la première carte*, et un nouveau
sous-dossier pour les controles de chaque groupe.
* La pile n'enregistre pour l'instant que les scripts de la première
carte (on suppose que toutes les cartes sont identiques)

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

Re: extract every code out of stack

Claus Dreischer
In reply to this post by Klaus major-k
>Hi Claus,
>
>nice to read you again :-)

Hallo (kleiner) Klaus ;-)

...

>>(Main stack has a preOpenStack handler, the substacks don't.
>>But now some substacks perform the preOpenStack
>>handler of the main stack when opening these
>>substacks.
>
>you can change the script of your mainstack like this:
>
>on preopenstack
>   if the short name of the target <> the short name of this stack then
>       exit preopenstack
>   end if
>   ...
>end preopenstack
>
>and you are out of the tailor :-D
>(Hint: literal translation of a german saying)

seams i was on the wood way :-D (another german translation)

Thanks, I'll be using this now.
There must be some major misunderstanding on my
side regarding the message path ...

Gruß,
        Claus.
--
http://www.danasoft.com/sig/dsagsdg.jpg
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: extract every code out of stack

Claus Dreischer
In reply to this post by xtalkprogrammer
>Hi Claus,

Hi Mark,


>Sure, you could extract every script of every object, but that will
>probably not solve the problem. The actual problem is that you need
>to get aware of the message hierarchy.

THIS must be the main problem ;-)

It was my understanding, that the preOpenStack message is only sent
to the (sub)stack that is going to open, not that it's going to the
(main)stack that triggered the opening of the (sub)stack too (and all
other substacks without an own preOpenStack handler).


>Start by moving the preOpenStack handler of the main stack to the
>card script of the first card of that stack. When you open the main
>stack now, the preOpenStack handler in the card script will run, but
>if you open a substack, it will not.

Works.
Thanks!

So, again, the problem was sitting in front of the screen ...   X-)


>Best,
>
>Mark

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

Re: extract every code out of stack

Geoff Canyon-3

On May 30, 2006, at 11:38 AM, Claus Dreischer wrote:

> It was my understanding, that the preOpenStack message is only sent  
> to the (sub)stack that is going to open, not that it's going to the  
> (main)stack that triggered the opening of the (sub)stack too (and  
> all other substacks without an own preOpenStack handler).

Any message will pass up the hierarchy until some object handles it.  
The preOpenStack message is delivered first to the first card in  
whatever stack is opening. That's the substack in this case.

If not handled, the message goes to the substack.

If not handled, the message goes to the mainstack.

If not handled, the message goes to the engine.

This ignores the possibility of frontscripts, backscripts, and stacks  
in use, which can complicate the issue further. ;-)

This is why people put the preOpenStack handler in the card script of  
the first card of the mainstack if they don't want it to be triggered  
by substacks opening.

regards,

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