Primary Level Educational version
Forum rules
Be kind.
Be kind.
- OpenXTalkPaul
- Posts: 2633
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Primary Level Educational version
Setting the defaultStack is needed when you are using commands that act on behalf of the IDE user from scripts in one 'regular' stack editing into another stack. However, a stack in 'palette' mode behaves differently than a stack that is 'topLevel'. A palette mode stack doesn't become the topStack.
There's also other ways to the same sort of things, like using the 'long IDs' to refer to script objects in your copying/importing/etc. scripts.
There's also other ways to the same sort of things, like using the 'long IDs' to refer to script objects in your copying/importing/etc. scripts.
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Primary Level Educational version
What is MORE important is that EVERY button on all the palettes need to check for the presence of a stack, as Sunny Jim may be such a 'prawn' that he hasn't, initially, made a stack; and, if Sunny Jim hasn't made a stack flash up something that says something like this:
"You Thumping Great Prawn! You need to make a stack first."
Or, even something that is a bit kinder.
My "slight problem" is that with a test stack called "Nonsense":
If there is NO topStack it does NOT return 'Utter Cack' to the messageBox: which is NOT good.
"You Thumping Great Prawn! You need to make a stack first."
Or, even something that is a bit kinder.

My "slight problem" is that with a test stack called "Nonsense":
Code: Select all
on mouseUp
palette "Nonsense"
put the short name of the topStack into STAKK
if STAKK is empty then
put "Utter Cack!"
else
put STAKK
end if
wait 5 seconds
topLevel "Nonsense"
end mouseUp
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Primary Level Educational version
Wow: serious distraction! https://www.superchess.nl/indexengels.htm
-
-
https://richmondmathewson.owlstown.net/
- OpenXTalkPaul
- Posts: 2633
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Primary Level Educational version
AFAIK, there is always a topStack, if no other stacks are open then topStack is the revMenuBar stack.richmond62 wrote: ↑Thu Jan 18, 2024 10:19 am If there is NO topStack it does NOT return 'Utter Cack' to the messageBox: which is NOT good.
You can get a list of open stacks using 'the stacks' (filenames) or the openStacks (short names), there is also 'the mainStacks' which will list EVERY stack file including all the IDE stacks...
OR you could use the IDE's ideUserMainStacks() that won't include IDE stacks in the list, or revLoadedStacks() which would include any substacks too, and there's also ideMainStacks() which returns mainstacks in memory and takes into account the "Show IDE Stacks" preference.
- tperry2x
- Posts: 3211
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Somewhere in deepest darkest Norfolk, England
- Contact:
Re: Primary Level Educational version
loads of ways of doing the same thing 

-
- Posts: 442
- Joined: Sat Sep 11, 2021 4:37 pm
- Contact:
Re: Primary Level Educational version
Paul's got it. The topStack is the top-most stack of the lowest mode number. The engine always needs at least one stack open to remain running, so there is always a topStack.
- tperry2x
- Posts: 3211
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Somewhere in deepest darkest Norfolk, England
- Contact:
Re: Primary Level Educational version
I know this has been discussed already, and what Paul said is 100% right. I just wanted to add:
I was poking around in revIDELibrary and found this nugget:
Code: Select all
/*
Opens an IDE stack as a palette. In the future this should be changed so that
palettes can decide what mode they ought to be opened in, i.e. this logic should
be removed from the IDE library and be specific to the stack rather than the
palette name.
pPaletteName (String):The readable name of the palette to be opened
example: revIDEOpenPalette "inspector"
*/
Code: Select all
revIDEOpenPalette "newTools"
You'll have to have a play.
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Primary Level Educational version
All the subStacks of the newTools stack already open as palettes, as does newTools itself: that was NOT the problem: the problem was that IF there was no stack open the image import routine bunged it into a palette.
This has already been sorted out.
Thanks.
This has already been sorted out.
Thanks.
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Primary Level Educational version
Tangentially . . . this
https://blogs.kcl.ac.uk/proged/joc/
is quite a good model for anyone wanting to get a 'thing' for Primary children going.
https://blogs.kcl.ac.uk/proged/joc/
is quite a good model for anyone wanting to get a 'thing' for Primary children going.
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Primary Level Educational version
Much improved image import facility with all sorts of "twiddles":
-
-
- Attachments
-
- newTools.livecode.zip
- (389.98 KiB) Downloaded 364 times
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Primary Level Educational version
Still quite a number of "hiccups" to iron out though.
I am wondering about (like HyperCard) implementing autosave.
I have had far, far too many 9 and 10 year olds in tears because their work went "down the tubes."
I am wondering about (like HyperCard) implementing autosave.
I have had far, far too many 9 and 10 year olds in tears because their work went "down the tubes."
https://richmondmathewson.owlstown.net/
- OpenXTalkPaul
- Posts: 2633
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Primary Level Educational version
I have an add-on for autosave I picked up somewhere ( from livecodeshare site I think). I'll upload it later so you can take a look at how they set that up. Like everything else I'm sure there's different ways to approach the problem. I've lost work like that but personally I'm more likely to overwrite good scripts with untested bad scripts due to my habit of hitting cmd-S saving often. I sometimes will make a back up (renamed.bak or.old) before I start a scripting session on an existing script, that way I can look back and compare to try to see where changes broke something (Git can do this sort of stuff). I would want an auto-save that makes back up copies when it saves.richmond62 wrote: ↑Wed Jan 24, 2024 4:22 pm Still quite a number of "hiccups" to iron out though.
I am wondering about (like HyperCard) implementing autosave.
I have had far, far too many 9 and 10 year olds in tears because their work went "down the tubes."
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Primary Level Educational version
At the moment the main problems with my interface are these:
1. A new stack is ALWAYS called 'My Stack', which, apart from the way it makes my guts churn thinking about Windows 95 and 'My Computer', is ludicrous as the thing should be used to produce several stacks that will not interfere with eachother.
2. There is a similar problem with BUTTONS and IMAGES.
#1 & #2 can be easily rectified: it is just very tedious.
3. There needs to be a type of AUTOSAVE implemented: possibly with multiple saves with time-stamps, where all but the last save would be deleted when the IDE is exited.
Should be glad of comments re #3.
1. A new stack is ALWAYS called 'My Stack', which, apart from the way it makes my guts churn thinking about Windows 95 and 'My Computer', is ludicrous as the thing should be used to produce several stacks that will not interfere with eachother.
2. There is a similar problem with BUTTONS and IMAGES.
#1 & #2 can be easily rectified: it is just very tedious.
3. There needs to be a type of AUTOSAVE implemented: possibly with multiple saves with time-stamps, where all but the last save would be deleted when the IDE is exited.
Should be glad of comments re #3.
https://richmondmathewson.owlstown.net/
- overclockedmind
- Posts: 363
- Joined: Sat Apr 30, 2022 9:05 pm
- Location: Midwest US
- Contact:
Re: Primary Level Educational version
I find it great to see this. HyperCard was my intro to programming... but if I find the time for it...
I'll be using OXT *and* learning C, C++ probably. I'm tired of not just flat-out being able to say in some language, "DO THIS."
Of course, I also understand I'll be looking at... well a code editor. lol
Can a studious person actually learn C with sufficient willpower and Internet access?
I'll be using OXT *and* learning C, C++ probably. I'm tired of not just flat-out being able to say in some language, "DO THIS."
Of course, I also understand I'll be looking at... well a code editor. lol
Can a studious person actually learn C with sufficient willpower and Internet access?
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win10 Pro, Current)
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2 and Linux Mint)
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2 and Linux Mint)
Who is online
Users browsing this forum: No registered users and 1 guest