Page 2 of 2
Re: Sorting...
Posted: Wed Feb 27, 2019 12:01 pm
by Klaus
jacque wrote: Wed Feb 27, 2019 1:08 am
Erm, I think for openStack you'd have to 'send openStack to the mouseStack" from the message box, wouldn't you?
Nope. The message box doesn't send messages to itself, it aims for the defaultstack -- except when LC goes wacky, that is, but then there are other problems.

If you put your cursor over the stack you want before hitting ENTER, then this will surely work
->
...to the mousestack!
Re: Sorting...
Posted: Wed Feb 27, 2019 12:16 pm
by bogs
Yah, thats how I thought it had to work Klaus, but Jacque says not necessary. I can see i'll be testing the limits of this later today

Re: Sorting...
Posted: Wed Feb 27, 2019 12:21 pm
by Klaus
Using "the mousestack" you can also target any NON defaultstack on the screen!
Re: Sorting...
Posted: Wed Feb 27, 2019 12:33 pm
by bogs
Ah, gotcha. I think with me, it just became a habit to use it after the first time you pointed it out to me, along with 'the mouseControl' and so on.
Re: Sorting...
Posted: Wed Feb 27, 2019 5:24 pm
by jacque
Note that my suggestion will only work with topstacks that have a mode of 1. Palettes and modals aren't candidates. For those I use the mousestack trick.
Re: Sorting...
Posted: Wed Feb 27, 2019 8:37 pm
by ValiantCuriosity
Well Bogs,
At least you have a focus. Mine is a total blur.
Jackie, thanks for jumping in. I am trying to familiarize myself with the message box.
I really enjoy the little short sample code snips too. The memory game is fantastic, but a little on the deep end for me yet. Everything helps. I'm trying out different bits of code with the LC commands, properties, etc. Some work as expected (for me). Others, don't. Still, "step by step..."
Right now, I'm having a lot of fun grabbing buttons, changing colors, font sizes, etc. Just playing. I got a little burned out on Android. For some reason, Android has been my nemesis even when using HTML5 technologies. I'm hoping that LC will allow me to put out my apps for both iOS and Android.
I've finished the great Amazon book. It has helped. The blinds have been raised on a few things. That is good news.
Thanks to all. Have a GREAT day.
-Rachel
Re: Sorting...
Posted: Wed Feb 27, 2019 8:59 pm
by bogs
I've been pretty blurry on occasion (like in the blocking/non-blocking thread

). My wife tells me I'm in a fog on other occasions. Embrace the blurriness !
Re: Sorting...
Posted: Wed Feb 27, 2019 9:04 pm
by Klaus
Hi Rachel,
ValiantCuriosity wrote: Mon Feb 25, 2019 2:26 am
...
1. I have a list that is "Dog, Cat, Rabbit, Monkey".
Klaus wrote: Mon Feb 25, 2019 2:36 pm
...
"sort fld xyz" always does a LINE sort (like -> sort LINES of fld xyz), unless you tell LC otherwise.
You want:
...
sort ITEMS of fld "your field here"
...
you didn't explicitely say so, but your intial question should have been answered correctly so far, right?
Best
Klaus
Re: Sorting...
Posted: Thu Feb 28, 2019 9:28 pm
by ValiantCuriosity
Hi Klaus,
Yes, I have gotten the "sort" command code to work!

I think the problem that I had was where I was placing the command. It finally worked when I created a new card and used the "preOpenCard" statement:
Code: Select all
preOpenCard
sort field "Field" ascending
end preOpenCard
Then I accessed the script from a different card. The script ran perfectly. I need to look at "item" and delimiters some more.
I read that the main stack and first card should really not be used for much other than holding the new cards. It sounds like sub stacks and/or cards are the way to go. Could that be because the mainStack/card1 only runs once when the app opens or is it my ignorance of the finer points?
The script that Bogs gave me helped a lot. I could study it to see what it was doing. All the feedback here got my "baby steps" sort command issue solved.
Where to place the code is tricky for me. I've been studying your conference reference. That does a nice job of describing some of the information on Stacks and Cards, etc.
I do wish that the dictionary would give a real code sample at the bottom of the description. Sometimes it does and other times, it doesn't. A true code sample would help new people with the syntax. Ah, well, for such a few developers, LC is truly an amazing piece of work. I'm in awe of what they have done.
Thanks again to everyone.
-Rachel
Re: Sorting...
Posted: Thu Feb 28, 2019 9:34 pm
by Klaus
Hi Rachel,
get used to know and use the message hierachy, check this great article:
http://www.fourthworld.com/embassy/arti ... _path.html
I read that the main stack and first card should really not be used for much other than holding the new cards. It sounds like sub stacks and/or cards are the way to go.
You can't generalize this, it depends, I'd say.
Best
Klaus
Re: Sorting...
Posted: Thu Feb 28, 2019 9:56 pm
by jacque
I put stuff in the stack and first card all the time. More often than not, actually. Klaus is right.
Re: Sorting...
Posted: Thu Feb 28, 2019 10:02 pm
by bogs
I'm the odd duck, I tend to put almost everything in the main stack
(of course, I do separate it out later if I need to)
I think someone once said to me (but don't quote this) that you put it as high as it makes sense.
I.e. if it affects one control, put it in that control, several controls, card level, several cards/stacks, stack level, something like that.
Re: Sorting...
Posted: Thu Feb 28, 2019 11:37 pm
by dunbarx
I wonder if Rachel may be alluding to the "splash stack" method in making standalones, where nothing of importance should be placed in the "mainStack" if that is to be the executable, since nothing can be saved there.
But historically, the mainStack is the central workhorse, with subStacks performing ancillary tasks or providing ancillary services. The splash stack is yet another "main" stack, and merely a vehicle for the "real" mainStack and its minions.
Craig
Re: Sorting...
Posted: Thu Feb 28, 2019 11:49 pm
by bogs
dunbarx wrote: Thu Feb 28, 2019 11:37 pm
...and its minions.
...but not these guys
