Can't save stack

Moderators: LCMark, LCfraser

Post Reply
pthirkell
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 93
Joined: Tue Nov 17, 2009 6:47 pm
Location: Wellington, New Zealand

Can't save stack

Post by pthirkell » Mon Sep 12, 2016 10:22 am

I have a widget script which works fine in test mode and installs ok. When I create a new stack and drag out the widget however, any subsequent attempt to save the stack fails.

I get a dialog box saying... Can't save stack 'myStackName' due to an error: Error writing stack (disk full?)

Any pointers towards what I might be doing wrong are most welcome.

pthirkell
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 93
Joined: Tue Nov 17, 2009 6:47 pm
Location: Wellington, New Zealand

Re: Can't save stack

Post by pthirkell » Mon Sep 12, 2016 10:48 am

OK well it seems that I wasn't constructing the OnSave handler quite correctly. Apologies for inconvenience.

livecodeali
Livecode Staff Member
Livecode Staff Member
Posts: 168
Joined: Thu Apr 18, 2013 2:48 pm

Re: Can't save stack

Post by livecodeali » Mon Sep 12, 2016 10:51 am

The most likely thing off the top of my head is that you're trying to serialise a non-primitive type in your OnSave code.

If you are trying to put a canvas type (for example Color) in the properties array, there will be issues when saving. You need to convert to String beforehand.

(this is just guessing - if not then perhaps you could post your OnSave code)

Ali

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2695
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Can't save stack

Post by mwieder » Sat Jun 10, 2017 12:45 am

(coming here from a related discussion)

the explanation makes sense, but I'm wondering:

1. what primitive types are built in?
Are these just the types listed in the com.livecode.type is<Type> functions? Those would be boolean, data, list, array, number, and string. In that case we'd have the same problems with point and rect as well as some other types probably that I can't think of off the top of my head.

2. why not make the conversion to/from strings automatic under the hood where necessary when serializing? i.e., for colors we can invoke stringFromColor to do this as a one-liner from a script level, and then colorFromString on the way back. It should be easy for the LCB engine to say "this is not a primitive type, I'll convert it for you and save the type information in order to avoid throwing an error that has no relevant information" when saving the array, and then on retrieving the array convert back if there's associated type information.

Post Reply

Return to “LiveCode Builder”