Page 1 of 2

What is the mode of the "Code Editor" stack?

Posted: Fri Jul 22, 2022 3:14 pm
by gg12
Hi,
I'm trying to find the mode property of internal livecode app stacks.
What mode would "Code Editor" be in? (And others, if you know it.)
I want to do some actions to stacks that have that specific mode.

The mode is an integer between 0 and 14.

Re: What is the mode of the "Code Editor" stack?

Posted: Fri Jul 22, 2022 3:33 pm
by richmond62
The mode is an integer between 0 and 14.
No, it is not: it is an integer between 0 and 13.

To find out the mode of a stack is extremely easy:
-
SShot 2022-07-22 at 17.33.15.png
SShot 2022-07-22 at 17.33.15.png (38.87 KiB) Viewed 15352 times
-
However, after a longish search I cannot find a stack called Code Editor anywhere.

Re: What is the mode of the "Code Editor" stack?

Posted: Fri Jul 22, 2022 4:32 pm
by Klaus
The mode of stack "revNewScriptEditor X" = 1
Where X stands for the number of open script editor windows.
richmond62 wrote:
Fri Jul 22, 2022 3:33 pm
However, after a longish search I cannot find a stack called Code Editor anywhere.
Really? :shock:
Oh, come on, code = script, and that's more than ovious!

Re: What is the mode of the "Code Editor" stack?

Posted: Fri Jul 22, 2022 4:45 pm
by richmond62
Well, it wasn't "ovious" to me. 8)
-
egg.jpg
Ovious
egg.jpg (18.27 KiB) Viewed 15329 times
-
And IFF gg12 (with a posting total of 3) has been digging around inside the IDE they would know
that the stack you suppose they refer to was called revNewScriptEditor.
-
SShot 2022-07-22 at 18.43.34.png
SShot 2022-07-22 at 18.43.34.png (15.68 KiB) Viewed 15331 times
-
SShot 2022-07-22 at 18.44.55.png

Re: What is the mode of the "Code Editor" stack?

Posted: Fri Jul 22, 2022 5:05 pm
by Klaus
What the EGG? :D

Hint:
I I do not know the name of a stack, I usually use the message box, enter this string,
hit ENTER and move the cursor over the stack in question.

Code: Select all

wait 2 secs;put the name of the mousestack
So I see -> revNewScriptEditor 1
I opened a script editor window first, of course!
And its mode is now 1, since it is open.

Re: What is the mode of the "Code Editor" stack?

Posted: Fri Jul 22, 2022 5:07 pm
by richmond62
The original OP has to be aware that modes are not fixed things, but,
as you stated, Klaus, change according to circumstance.

Re: What is the mode of the "Code Editor" stack?

Posted: Fri Jul 22, 2022 6:56 pm
by stam
Live and learn... Stack 'modes' had passed me by somehow - looking this up in the dictionary was very enlightening!
As far as i can tell, this seems to be a read-only property?

Nevertheless, looking for certain stacks with certain modes (eg mode 0) will greatly simplify some of the tasks i'm coding... very timely!

Re: What is the mode of the "Code Editor" stack?

Posted: Fri Jul 22, 2022 7:41 pm
by richmond62
Oh, I am such a screaming genius the first time I learnt about modes in LiveCode was this afternoon when I read the start of this thread. :lol:

Re: What is the mode of the "Code Editor" stack?

Posted: Sat Jul 23, 2022 6:02 pm
by jacque
Klaus wrote:
Fri Jul 22, 2022 5:05 pm
I I do not know the name of a stack, I usually use the message box, enter this string,
hit ENTER and move the cursor over the stack in question.

Code: Select all

wait 2 secs;put the name of the mousestack
I'm too impatient to wait 2 seconds. :) I enter the same thing in the message box but don't hit the return key. Then I move the mouse over the stack, and then hit return.

I do the same thing using the mouseControl which let's me keep pointing at different controls to see their properties.

Re: What is the mode of the "Code Editor" stack?

Posted: Fri Jul 29, 2022 12:43 pm
by gg12
Thanks for your answers :lol:
In my version of Livecode it said 0 to 14 in the dictionary, even if I thought it was 0 to 13 :oops:
It was nice seeing you discuss, great day

gg

Re: What is the mode of the "Code Editor" stack?

Posted: Fri Jul 29, 2022 3:09 pm
by richmond62
In my version of Livecode it said 0 to 14 in the dictionary
Yes, I apologise, you are quite right:
-
SShot 2022-07-29 at 17.07.16.png
-
What is ODD though, is that the Dictionary does NOT describe what mode 14 is:
-
SShot 2022-07-29 at 17.07.37.png

Re: What is the mode of the "Code Editor" stack?

Posted: Fri Jul 29, 2022 3:12 pm
by richmond62
So, err, I thought I would be clever and try this:
-
SShot 2022-07-29 at 17.10.59.png
-
Which did no good at all, so, just to check I tried this:
-
SShot 2022-07-29 at 17.10.48.png
-
Which was not very helpful either.

Re: What is the mode of the "Code Editor" stack?

Posted: Fri Jul 29, 2022 3:18 pm
by Klaus
Well, take a look at the screenshot of the dictionary you posted!
This property is read-only and cannot be set.

Re: What is the mode of the "Code Editor" stack?

Posted: Fri Jul 29, 2022 3:21 pm
by richmond62
You are actually expecting someone to read everything in this day-and-age? Come on! 8)

AND, more importantly, why does the Dictionary say '14' and then indicate to people who
read slightly more that the truth is '13'?

Also, as Granddad said, "You can always ask." So, I did. :)

Re: What is the mode of the "Code Editor" stack?

Posted: Fri Jul 29, 2022 4:19 pm
by FourthWorld
stam wrote:
Fri Jul 22, 2022 6:56 pm
Live and learn... Stack 'modes' had passed me by somehow - looking this up in the dictionary was very enlightening!
As far as i can tell, this seems to be a read-only property?

Nevertheless, looking for certain stacks with certain modes (eg mode 0) will greatly simplify some of the tasks i'm coding... very timely!
The mode property specifically is indeed read-only, but it is under the control of the scripter though the style property, and various commands that determine mode including ask, answer, sheet, palette, modeless, and others.