Old tips = new tricks
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Old tips = new tricks
The browser widget and linux don't play well together ever since LC went the CEF route.
But to get back to your issue here, saving a stack by script with the "with format xxx" syntax will work on LC versions where it's supported (I think that's 8.0 and above) and will be ignored on previous versions (i.e., will save in the current engine's version. So there you'd need to set the stackfileversion and then save. For maximum backwards compatibility I try to save in 2.4 or 5.5 format when I can.
But I still don't think this is a good idea. I used to save preferences in plugin stacks instead of text files before I wised up. And changed my ways for exactly some of the things you're running into now.
But to get back to your issue here, saving a stack by script with the "with format xxx" syntax will work on LC versions where it's supported (I think that's 8.0 and above) and will be ignored on previous versions (i.e., will save in the current engine's version. So there you'd need to set the stackfileversion and then save. For maximum backwards compatibility I try to save in 2.4 or 5.5 format when I can.
But I still don't think this is a good idea. I used to save preferences in plugin stacks instead of text files before I wised up. And changed my ways for exactly some of the things you're running into now.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: Old tips = new tricks
Ah HAH! Now I get it! Thank you for repeating it enough to turn on the , sorry for being so dense, but there are so many things I still don't understand about how things work in this language
See, since every version of the IDE I work with had 'Save As..." with older versions, I just assumed they all were using "with format (x)" to do the save, and didn't realize they must be using "stackFileVersion" instead (there is still a lot of code I haven't gotten too in the IDE).
NOW I get it. Boy do I feel like such a shmoe
When I work on these older things, my approach is to change as little as I can for a number of reasons, the primary one being I am sure I don't know as much as the people who wrote them originally did, and the secondary being that I don't like releasing things that act screwy because of something I might have missed (like this very thing we are talking about, heh).
Just to make sure I am parsing the situation correctly, unless a 'save' is issued explicitly somewhere within a stack, nothing in the IDE or engine changes the stack format? Cause I always thought it did.
I think part of my misunderstanding how it all works comes from 2 sources, one being that when you say, are working in the IDE and have a stack and you type in fields, the fields are saved (making me think some kind of save is going on somewhere), and the second confusing source was this lesson, which tells you to use
to save the cProp, which made me think the IDE was doing the same (somewhere along the way).
Only problem is, (I think), since I added the ability for the plugin to create new cards for people to put their own tips into, would that get flubbed up if the stack doesn't save itself? Now I am dying to know
Thanks again for finally punching that concept through my skull, which is often thicker than UN-OBTAINIUM
Mind you, I never have these experiences in the older versions, although I do get other interesting issues in the earliest ones, they haven't been show stoppers.
So, when a new release comes out, I download it and see how it acts, but there are other problems because I specifically don't use one of the 'chosen' release distros. Let's assume I download and rigorously test RC x.
None of my testing will solve anything, because the distro isn't supported. So now I have to create a vm to hold a distro that is supported to see if the same problem happens on that one (which it doesn't the majority of the time).
That is all well and good, but it takes time I usually don't have to begin with for now, and screws up my train of thought on whatever I was initially doing to begin with, for something I don't plan to be using anytime soon anyway.
None of the above stops me from doing testing on the new releases when I do have spare time, but they sure aren't my primary turn to item for development to begin with since I haven't seen anything I need to get done I can't do with the 2.4 set of engines which all apparently work pretty well on a wide range of boxes I still work with.
I am just weird I guess, or maybe an anachronism snowflake
See, since every version of the IDE I work with had 'Save As..." with older versions, I just assumed they all were using "with format (x)" to do the save, and didn't realize they must be using "stackFileVersion" instead (there is still a lot of code I haven't gotten too in the IDE).
NOW I get it. Boy do I feel like such a shmoe
I often do the same, but I wasn't the original author of this plugin, and so far have only changed enough of it to bring it up to the current IDEs.
When I work on these older things, my approach is to change as little as I can for a number of reasons, the primary one being I am sure I don't know as much as the people who wrote them originally did, and the secondary being that I don't like releasing things that act screwy because of something I might have missed (like this very thing we are talking about, heh).
Just to make sure I am parsing the situation correctly, unless a 'save' is issued explicitly somewhere within a stack, nothing in the IDE or engine changes the stack format? Cause I always thought it did.
I think part of my misunderstanding how it all works comes from 2 sources, one being that when you say, are working in the IDE and have a stack and you type in fields, the fields are saved (making me think some kind of save is going on somewhere), and the second confusing source was this lesson, which tells you to use
Code: Select all
on closeStack
save this stack
pass closeStack
end closeStack
Only problem is, (I think), since I added the ability for the plugin to create new cards for people to put their own tips into, would that get flubbed up if the stack doesn't save itself? Now I am dying to know
Thanks again for finally punching that concept through my skull, which is often thicker than UN-OBTAINIUM
In this case, unless the browser widget is somehow running at all times, I don't think that is the problem. I have had versions that showed no attempt to start at all (no splash or other sign they were starting). There have been versions that blipped out on opening the code editor. On placing a field. On placing *any* widget, such as trying to follow the bmi tutorial. The list goes on and on and on.
Mind you, I never have these experiences in the older versions, although I do get other interesting issues in the earliest ones, they haven't been show stoppers.
So, when a new release comes out, I download it and see how it acts, but there are other problems because I specifically don't use one of the 'chosen' release distros. Let's assume I download and rigorously test RC x.
None of my testing will solve anything, because the distro isn't supported. So now I have to create a vm to hold a distro that is supported to see if the same problem happens on that one (which it doesn't the majority of the time).
That is all well and good, but it takes time I usually don't have to begin with for now, and screws up my train of thought on whatever I was initially doing to begin with, for something I don't plan to be using anytime soon anyway.
None of the above stops me from doing testing on the new releases when I do have spare time, but they sure aren't my primary turn to item for development to begin with since I haven't seen anything I need to get done I can't do with the 2.4 set of engines which all apparently work pretty well on a wide range of boxes I still work with.
I am just weird I guess, or maybe an anachronism snowflake
Re: Old tips = new tricks
@ jiml -
Thank you for that Jim, making the changes I made did actually appear to fix the issue, but your snippet makes a lot of sense.
Of course, depending on the answer to the cards question in the previous post, the whole thing might be moot for this plugin but the function is still nice to have around
Thank you for that Jim, making the changes I made did actually appear to fix the issue, but your snippet makes a lot of sense.
Of course, depending on the answer to the cards question in the previous post, the whole thing might be moot for this plugin but the function is still nice to have around
-
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Old tips = new tricks
You're right, if you don't save the stack all changes will be lost. LC loads the entire stack into RAM when it opens and doesn't save anything to disk until you choose to save it. That allows the revert command to work, which basically means "reload from disk" and can be a lifesaver if you've written yourself into a mess.
Since you want to preserve the original stack as much as possible, you probably don't want to alter it much. But if I were doing this, I'd move all the data into text files and use a one card template stack to load each one on demand. Separating the data from the structure is always a good idea. Another way is to create an array of all the info and store it on disk with ArrayEncode, which lets you keep everything in a single file and would have very fast data retrieval once it was decoded and kept in memory.
Since you want to preserve the original stack as much as possible, you probably don't want to alter it much. But if I were doing this, I'd move all the data into text files and use a one card template stack to load each one on demand. Separating the data from the structure is always a good idea. Another way is to create an array of all the info and store it on disk with ArrayEncode, which lets you keep everything in a single file and would have very fast data retrieval once it was decoded and kept in memory.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Old tips = new tricks
Well, short of re-writing the entire thing then, I'll probably leave it as it is, barring any problems cropping up heh. I may wind up re-writing it some day, but not today
-
- VIP Livecode Opensource Backer
- Posts: 18
- Joined: Sat Mar 02, 2019 2:04 pm
- Location: Missouri, USA
Re: Old tips = new tricks
A great stack and great effort to bring it back "to the masses," as it were. Kudos!
D. John Downs | Old school HyperCard enthusiast | Novice LC Indy hobbyist
I have an extremely busy career, so please forgive my "come and go" manner.
I have an extremely busy career, so please forgive my "come and go" manner.
Re: Old tips = new tricks
They certainly did do a good job with it, and I'm glad your enjoying the resurrected version of it