Three very simple questions
klaus at major-k.de
Sun Apr 26 08:28:49 EDT 2020
someone called my name? :-D
> Am 26.04.2020 um 14:11 schrieb Graham Samuel via use-livecode <use-livecode at lists.runrev.com>:
> I’m sending this again because some strange text appeared in my message the first time. Don’t know how it go there!
> Folks, I’m finding it difficult to search the lessons and the LC Guide to get really simple info, so forgive me for these grossly newbie questions:
> 1. In the IDE, the ‘Align Selected Controls’ menu item doesn’t allow all possible combinations of alignment, particularly aligning horizontal and vertical centres; nor does it allow alignments in relation to the stack dimensions. I think this functionality used to exist, but maybe (very likely!) my memory is faulty. If these functions are available somewhere in the IDE, I don’t see where.
not sure I understand you correctly.
If the inspector does not offer some alignement that you need, it will be easy to script, the inspector does the same.
> particularly aligning horizontal and vertical centres
Just use the two items of THE LOC OF WHATEVER to do youralignement:
x -> horizontal centre
y -> vertical centre
> 2. I’ve not had to use LC arrays much, at least not ones containing my own data. The description of arrays is somewhat scattered throughout the lessons and the Guide, and I failed to find a thorough treatment of the whole idea of arrays in LC, which I find quite slippery. I am looking to use a two- or three-dimensional array, where you can script something like
> put myArray[2,7] into…, or
> get myArray[x,y,z]
> I still don’t know if this is possible. I kind of think it is, but I can’t grasp how to do it.
Yes, sure, but read up Alex last mail for "better" syntax.
> 3. I can’t work out if you can construct an array using the IDE, i.e. prior to actually executing the code.
That depends. :-D
You can create an array whenever you need one and we can also store an array into a custom property,
so it will survive the LC session if you save the stack.
put "this is string1_1" into tArray["string1"]
put "this is string1_2" into tArray["string2"]
put "this is string2_1" into tArray["string1"]
put "this is string2_1" into tArray["string2"]
answer "This is the string 1, stored in my array[string2]:" && tArray["string2"]
Silly example, but you shlould get the picture...
And if possible, named keys are much more readable
> I was thinking for example of an array of constants (really strings) which could be written into my script. Again, if that’s possible I don’t know how. It seems odd to have to do something like convert lists of constants into array form only when the program is running.
Well, when else would you like to do it in LC, when it is not running? :-D
I'm sure I did nto really understand what you mean.
> Somehow I don’t think this is possible in LC, but I’m not sure.
> Maybe Klaus, who tells us that he sleeps with the LC documentation under his pillow, can help!
Hope I did!
klaus at major-k.de
More information about the use-livecode