Old tips = new tricks

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

Re: Old tips = new tricks

Post by mwieder » Tue Jul 09, 2019 12:23 am

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.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Old tips = new tricks

Post by bogs » Tue Jul 09, 2019 10:28 am

Ah HAH! Now I get it! Thank you for repeating it enough to turn on the :idea: , 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 :oops:
mwieder wrote:
Tue Jul 09, 2019 12:23 am
I used to save preferences in plugin stacks instead of text files before I wised up.
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
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 :P

Thanks again for finally punching that concept through my skull, which is often thicker than UN-OBTAINIUM :|
mwieder wrote:
Tue Jul 09, 2019 12:23 am
The browser widget and linux don't play well together ever since LC went the CEF route.
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 :D
Image

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Old tips = new tricks

Post by bogs » Tue Jul 09, 2019 10:40 am

@ 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 :D but the function is still nice to have around :wink:
Image

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Old tips = new tricks

Post by jacque » Tue Jul 09, 2019 5:16 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Old tips = new tricks

Post by bogs » Tue Jul 09, 2019 7:39 pm

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 :wink:
Image

hypercardjdowns
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 18
Joined: Sat Mar 02, 2019 2:04 pm
Location: Missouri, USA

Re: Old tips = new tricks

Post by hypercardjdowns » Tue Sep 03, 2019 2:16 am

bogs wrote:
Mon Jun 17, 2019 10:47 pm
I've updated this plugin again.
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.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Old tips = new tricks

Post by bogs » Tue Sep 03, 2019 12:52 pm

They certainly did do a good job with it, and I'm glad your enjoying the resurrected version of it :D
Image

Post Reply

Return to “Off-Topic”