Re: Cloning cards

2010-11-18 Thread Richard Gaskin

Joe Lewis Wilkins wrote:

 If we create a standalone with a menu item of New Form and
 then implement it with a handler script in which we do: clone
 this card, will this create a new card in the Standalone, keeping
 in mind that this will be done in a sub-stack? Also, with a
 matching menu item: Delete Form with the same concern.

Good news:  it's easy to do.

Bad news:  ...but not as a substack.

A substack of the stackfile that's been made into an executable won't be 
able to save changes because the OS prevents executables from modifying 
themselves.


So instead all you have to do is what every other app does:  keep any 
stacks that must be saved in a separate stack file.


Sarah Reichelt contributed this excellent tutorial on saving data in 
standalones to the LiveCode Journal site, which many have found very 
helpful for this:


http://livecodejournal.com/tutorials/saving_data_in_revolution.html

--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Cloning cards

2010-11-18 Thread Joe Lewis Wilkins
Hi Richard,

My intuition told me as much, and I've been surprised at how easily I'm able to 
change the data in a Standalone by using an external text file and then 
changing the text file along the way. My dilemma, now, is that this sub-stack 
is already part of the standalone, so splitting it off as another stack file 
may not be so easy. OTOH, it may also solve an issue I now have communicating 
between that sub-stack and the main stack in the standalone. We'll see once I 
take a look at Sarah's tutorial.

Thanks, 

Joe Wilkins

On Nov 18, 2010, at 7:01 AM, Richard Gaskin wrote:

 Joe Lewis Wilkins wrote:
 
  If we create a standalone with a menu item of New Form and
  then implement it with a handler script in which we do: clone
  this card, will this create a new card in the Standalone, keeping
  in mind that this will be done in a sub-stack? Also, with a
  matching menu item: Delete Form with the same concern.
 
 Good news:  it's easy to do.
 
 Bad news:  ...but not as a substack.
 
 A substack of the stackfile that's been made into an executable won't be able 
 to save changes because the OS prevents executables from modifying themselves.
 
 So instead all you have to do is what every other app does:  keep any stacks 
 that must be saved in a separate stack file.
 
 Sarah Reichelt contributed this excellent tutorial on saving data in 
 standalones to the LiveCode Journal site, which many have found very helpful 
 for this:
 
 http://livecodejournal.com/tutorials/saving_data_in_revolution.html
 
 --
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Cloning cards

2010-11-18 Thread Richard Gaskin

Joe Lewis Wilkins wrote:

 My dilemma, now, is that this sub-stack is already part of the
 standalone, so splitting it off as another stack file may not
 be so easy. OTOH, it may also solve an issue I now have
 communicating between that sub-stack and the main stack in
 the standalone.

Maybe not so bad - consider trying this:

Rename the existing substack something like SubstackNameTEMPLATE, when 
add this when you need to create a savable document:


  -- Make the savable stack:
  clone stack SubstackNameTEMPLATE
  set the name of it to SubstackName
  -- Now to save it in some writable location:
  set the filename of it to MyDataPath()
  save stack SubstackName

In a central library you can use this handy function to find the path to 
the file for saving or opening:


function MyDataPath
   switch the platform
   case MacOS
 put specialFolderPath(asup) into tPath
 break
   case Win32
 put specialFolderPath(26) into tPath
 break
   case Linux
 put specialFolderPath(home)/Documents into tPath
   end switch
   --
   put /MyAppName/ after tPath
   if there is not a folder tPath then
 create folder tPath
 if the result is not empty then
answer Error:  the result
exit to top
 end if
   put MyDocumentName.myExtension after tPath
   return tPath
end MyDataPath


The above is off-the-cuff and untested, but I've written similar 
handlers often so hopefully it will be at least mostly working and 
somewhat helpful. :)


--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Cloning cards

2010-11-18 Thread Joe Lewis Wilkins
Hi Richard,

I'll save this approach as a plan B; for now, I think, I'll just create a 
brand new, expandable Main Stack that I can use when the user needs to create 
new forms. I think I can probably do this by just creating a dummy empty stack 
and, then, when I need additional copies of a Form, instead of cloning that 
Form in the sub-stack, I'll copy it, go to the dummy stack and paste it. That 
may also make the sequencing of Forms easier. Your suggestion, though I'm sure 
it is great, appears to be a bit too complex for me at this time. Plus, it is 
always a good idea to have a Plan B around. (smile) My problem is: if I don't 
think of something, I sometimes have trouble understanding how someone else's 
way of doing things works. It's a my brain problem we all face in our 
declining years. The old dog - new tricks syndrome if you will. I'm still 
struggling with the custom properties concept. (smile) Thanks...

Joe Wilkins 

On Nov 18, 2010, at 7:54 AM, Richard Gaskin wrote:

 Joe Lewis Wilkins wrote:
 
  My dilemma, now, is that this sub-stack is already part of the
  standalone, so splitting it off as another stack file may not
  be so easy. OTOH, it may also solve an issue I now have
  communicating between that sub-stack and the main stack in
  the standalone.
 
 Maybe not so bad - consider trying this:
 
 Rename the existing substack something like SubstackNameTEMPLATE, when add 
 this when you need to create a savable document:
 
  -- Make the savable stack:
  clone stack SubstackNameTEMPLATE
  set the name of it to SubstackName
  -- Now to save it in some writable location:
  set the filename of it to MyDataPath()
  save stack SubstackName
 
 In a central library you can use this handy function to find the path to the 
 file for saving or opening:
 
 function MyDataPath
   switch the platform
   case MacOS
 put specialFolderPath(asup) into tPath
 break
   case Win32
 put specialFolderPath(26) into tPath
 break
   case Linux
 put specialFolderPath(home)/Documents into tPath
   end switch
   --
   put /MyAppName/ after tPath
   if there is not a folder tPath then
 create folder tPath
 if the result is not empty then
answer Error:  the result
exit to top
 end if
   put MyDocumentName.myExtension after tPath
   return tPath
 end MyDataPath
 
 
 The above is off-the-cuff and untested, but I've written similar handlers 
 often so hopefully it will be at least mostly working and somewhat helpful. :)
 
 --
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Cloning cards

2010-11-18 Thread Richard Gaskin

Joe Lewis Wilkins wrote:

 I'll save this approach as a plan B; for now, I think, I'll
 just create a brand new, expandable Main Stack that I can use
 when the user needs to create new forms. I think I can probably
 do this by just creating a dummy empty stack and, then, when I
 need additional copies of a Form, instead of cloning that Form
 in the sub-stack, I'll copy it, go to the dummy stack and paste
 it. That may also make the sequencing of Forms easier. Your
 suggestion, though I'm sure it is great, appears to be a bit too
 complex for me at this time.

Whether you clone or copy, either is just a single line of code.

The long part of my post was a function to help with the thing either 
method will still need:  where to save the file in a place you know will 
be user-writable.


--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Cloning cards

2010-11-18 Thread Bob Sneidar
Hi Joe. 

Not so tough. Make a brand new stack which will be your splash stack. Have that 
stack open the real stack and then close itself. Add your real stack along 
with it's substack as an included file in your standalone settings. Mince 
finely, stir in with a cup of lemon juice and compile. The mincing and lemon 
juice are not strictly necessary. 

Bob


On Nov 18, 2010, at 7:35 AM, Joe Lewis Wilkins wrote:

 Hi Richard,
 
 My intuition told me as much, and I've been surprised at how easily I'm able 
 to change the data in a Standalone by using an external text file and then 
 changing the text file along the way. My dilemma, now, is that this sub-stack 
 is already part of the standalone, so splitting it off as another stack file 
 may not be so easy. OTOH, it may also solve an issue I now have communicating 
 between that sub-stack and the main stack in the standalone. We'll see once 
 I take a look at Sarah's tutorial.
 
 Thanks, 
 
 Joe Wilkins

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Cloning cards

2010-11-18 Thread Joe Lewis Wilkins
Thanks Robert.
Just haven't had the time this AM to tackle this as yet.

Joe Wilkins

On Nov 18, 2010, at 9:29 AM, Bob Sneidar wrote:

 Hi Joe. 
 
 Not so tough. Make a brand new stack which will be your splash stack. Have 
 that stack open the real stack and then close itself. Add your real stack 
 along with it's substack as an included file in your standalone settings. 
 Mince finely, stir in with a cup of lemon juice and compile. The mincing and 
 lemon juice are not strictly necessary. 
 
 Bob
 
 
 On Nov 18, 2010, at 7:35 AM, Joe Lewis Wilkins wrote:
 
 Hi Richard,
 
 My intuition told me as much, and I've been surprised at how easily I'm able 
 to change the data in a Standalone by using an external text file and then 
 changing the text file along the way. My dilemma, now, is that this 
 sub-stack is already part of the standalone, so splitting it off as another 
 stack file may not be so easy. OTOH, it may also solve an issue I now have 
 communicating between that sub-stack and the main stack in the standalone. 
 We'll see once I take a look at Sarah's tutorial.
 
 Thanks, 
 
 Joe Wilkins
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Cloning cards

2010-11-18 Thread Bob Sneidar
Whoops! I didn't mean the splash stack should close itself I meant hide 
itself. Closing the real stack will have to have a Quit command at the end 
of anything else you do. Otherwise I think the splash screen will pop up again 
if you close the real stack. The more knowledgable among us may correct me. 

Bob


On Nov 18, 2010, at 9:46 AM, Joe Lewis Wilkins wrote:

 Thanks Robert.
 Just haven't had the time this AM to tackle this as yet.
 
 Joe Wilkins
 
 On Nov 18, 2010, at 9:29 AM, Bob Sneidar wrote:
 
 Hi Joe. 
 
 Not so tough. Make a brand new stack which will be your splash stack. Have 
 that stack open the real stack and then close itself. Add your real 
 stack along with it's substack as an included file in your standalone 
 settings. Mince finely, stir in with a cup of lemon juice and compile. The 
 mincing and lemon juice are not strictly necessary. 
 
 Bob
 
 
 On Nov 18, 2010, at 7:35 AM, Joe Lewis Wilkins wrote:
 
 Hi Richard,
 
 My intuition told me as much, and I've been surprised at how easily I'm 
 able to change the data in a Standalone by using an external text file and 
 then changing the text file along the way. My dilemma, now, is that this 
 sub-stack is already part of the standalone, so splitting it off as another 
 stack file may not be so easy. OTOH, it may also solve an issue I now have 
 communicating between that sub-stack and the main stack in the 
 standalone. We'll see once I take a look at Sarah's tutorial.
 
 Thanks, 
 
 Joe Wilkins
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Cloning cards

2010-11-17 Thread Joe Lewis Wilkins
A quick question before I spend a lot of time assuming it will work: If we 
create a standalone with a menu item of New Form and then implement it with a 
handler script in which we do: clone this card, will this create a new card in 
the Standalone, keeping in mind that this will be done in a sub-stack? Also, 
with a matching menu item: Delete Form with the same concern.

TIA

Joe Wilkins


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Cloning cards

2010-11-17 Thread Scott Rossi
Hi Joe:

If I understand what you're asking, the answer is yes, but the cloned card
won't be saved unless your stack exists in a file that's separate from the
standalone (standalones can't modify themselves).

You'll either need to use the splash screen launcher strategy which involves
building a standalone from a small splash screen stack and using this to
launch your real mainstack file, or clone your cards in new stacks and
save those as external files that can be opened by your standalone.  You can
find references in the list archives (one example:
http://tinyurl.com/2bpn68z).

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design



Recently, Joe Lewis Wilkins wrote:

 A quick question before I spend a lot of time assuming it will work: If we
 create a standalone with a menu item of New Form and then implement it with
 a handler script in which we do: clone this card, will this create a new card
 in the Standalone, keeping in mind that this will be done in a sub-stack?
 Also, with a matching menu item: Delete Form with the same concern.
 
 TIA
 
 Joe Wilkins


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Problems with cloning cards...

2004-03-02 Thread Stephen King
Mark,
Thanks for the response, I haven't yet tried it in the standalone, I have
been working this section entirely in the IDE.

The card has a background group but not created by the script.

Anyway, I'll put a few more debug prompts in then test with a standalone.

Cheers
Steve

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Problems with cloning cards...

2004-03-01 Thread Stephen King
Hi All,

I should have stuck with one card stacks!

I am having some trouble understanding cloning cards. I am using the clone
approach at the moment so that card script is carried over (maybe templates
are the way but I haven't investigated them yet).

1. In the script
On..handler
...
Clone card template
.
end handler
does the script complete or terminate immediately the clone takes place. I
ask this because for a while it seemed that scripts after the clone did
occur (in my case sending a message to the new card), but now nothing seems
to happen after the clone takes place. I have tested this by placing an
Answer directly after the clone command which does not respond but does if
just before the clone command. The clone itself does occur.

Now, I can get only get the clone card to respond to a message sent to it by
placing 'send message to last card in xxx milliseconds' BEFORE the clone
takes place. Before it was after (without the milliseconds)!

2. When a card is cloned, does it receive any newcard, opencard messages? My
clone doesn't seem to respond to anything like this.

3. Previously, my cloned cards seemed to number themselves upwards from the
original. Now they SEEM (not 100% sure) to be pushing the original up and
numbering themselves 1 etc! If it doesn't become the last card this gives me
some problems as I send an initialise message to the last card after
cloning.

As you can see, I'm a little confused!

Cheers
Steve

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Problems with cloning cards...

2004-03-01 Thread Mark Talluto
On Mar 1, 2004, at 8:56 AM, Stephen King wrote:

Hi All,

I should have stuck with one card stacks!

I am having some trouble understanding cloning cards. I am using the 
clone
approach at the moment so that card script is carried over (maybe 
templates
are the way but I haven't investigated them yet).

1. In the script
On..handler
...
Clone card template
.
end handler
does the script complete or terminate immediately the clone takes 
place. I
ask this because for a while it seemed that scripts after the clone did
occur (in my case sending a message to the new card), but now nothing 
seems
to happen after the clone takes place. I have tested this by placing an
Answer directly after the clone command which does not respond but 
does if
just before the clone command. The clone itself does occur.

Now, I can get only get the clone card to respond to a message sent to 
it by
placing 'send message to last card in xxx milliseconds' BEFORE the 
clone
takes place. Before it was after (without the milliseconds)!

2. When a card is cloned, does it receive any newcard, opencard 
messages? My
clone doesn't seem to respond to anything like this.

3. Previously, my cloned cards seemed to number themselves upwards 
from the
original. Now they SEEM (not 100% sure) to be pushing the original up 
and
numbering themselves 1 etc! If it doesn't become the last card this 
gives me
some problems as I send an initialise message to the last card after
cloning.

As you can see, I'm a little confused!


Hi Stephen,

I just posted the same problem to this list.  You might take a look at 
my messages with the subject:  Differences between standalone and IDE 
results.  I have even created a sample stack that demonstrates the 
problem.  You are not alone.  I believe it is a bug in the IDE.  It 
should run fine if you create a standalone out of it or build your app 
in MC 2.5.  I will be buzillaing this in a few minutes.

--
Best regards,
Mark Talluto
http://www.canelasoftware.com
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Problems with cloning cards...

2004-03-01 Thread Mark Talluto
On Mar 1, 2004, at 8:56 AM, Stephen King wrote:

I am having some trouble understanding cloning cards. I am using the 
clone
approach at the moment so that card script is carried over (maybe 
templates
are the way but I haven't investigated them yet).

1. In the script
On..handler
...
Clone card template
.
end handler
Are you grouping any objects before you clone your card?  I found that 
the start the problem.

--
Best regards,
Mark Talluto
http://www.canelasoftware.com
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution