Re: Bitten by Group Default Margins

2017-05-06 Thread Richard Gaskin via use-livecode

Sannyasin Brahmanathaswami wrote:

> Are we the only ones who would prefer that the engine not auto set
> group margins to 4?

I would prefer 0, but we're about 20 years too late to change it now.

Easy enough to change the property to anything you want.

> it got worse: even if you set the margins of the group to 0 *after*
> resizing all it's child elements, the prop inspector, after the
> layout was done, showed margins were 4 pixels, which to me seems
> completely "bogus"

Does the margin of the group itself become smaller when you set it to a 
smaller number?


There may be an update bug in the PB; one way to check that would be to 
close and then re-open the PB.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Bitten by Group Default Margins

2017-05-06 Thread Sannyasin Brahmanathaswami via use-livecode
We discussed this before on this list, but I wanted to bring it up again. I 
don't remember any conclusions.

Are we the only ones who would prefer that the engine not auto set group 
margins to 4?

This bit us  hard recently as one member of the team who was not familiar with 
this issue spent a lot of time trying to get some dynamic responsive layout to 
work.

Even if the script set the group rect to

0,0,50, (the width of this card)

and then you created a background grc

0,0,50, (the width of this card)


We kept seeing a 4 pixel transparent  offset on the screen, as if the group 
were offset (in fact it wasn't the margins were forcing child elements to be 
inset, as if the coords of the child controls were relative to the 4 x offset 
of the group. instead of the card itself.

it got worse: even if you set the margins of the group to 0 *after* resizing 
all it's child elements, the prop inspector, after the layout was done, showed 
margins were 4 pixels, which to me seems completely "bogus"

The only way I could get it to lay out correctly was this this esoteric hack:

# at the beginning of the layout handler:

set the width of group "header" to (the width of this card +8) # over 
compensate for the default margins
set the left of group "header" to -4 # centers the group so that the x,y coord 
of the child elements are now at card edge
set the top of group "header" to 0
set the margins of group "header" to 0 # Important! so that child elements will 
not be offset.

# now you can set all the child elements to the width of the card
# and when you inspect the group, the topleft is 0 and the margins are 0

isn't this "just wrong" ??  Doesn't it make more intuitive sense that if I set 
a group topleft to 0,0 and  child element to 0,0 that it would be flush with 
the top left of the card?

BR







___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Relayering Controls in 9 dp5 problematic?

2017-05-06 Thread Sannyasin Brahmanathaswami via use-livecode
layout card
make some controls
click on prop inspector
try to set the layer of fld now set to layer 6

nothing happens, IDE "blinks" are resets the field to 6

select fld; object menu, arrange, send back… now it works

property inspector is not updated.  use revApplicationOverview, click on a 
control button "whatever" and instead we get inspector for fld "title" even 
thought control button is highlighted.

Go back to Project Browser. Hmm… one control I tried to set to layer 2, does 
now in fact as layer 2

three of these controls were previously in a group. I ungrouped them 
theoretically that group is now "gone" from the stack…

relayerGroupControls is true (even though there is no group on the card)… still 
cannot relayer some objects?

What other conditions will "lock" a control into a specific layer?

Anyone else struggling with this?

BR
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Shell argv

2017-05-06 Thread JB via use-livecode
To use a shell command it needs to work from
the terminal.  I am using OS X  10.11.6 and if
I try to open a Xcode c build named my_file I
type in the terminal,

open my_file

and the file my_file will open.

I want to pass arguments to argv but the never
get passed.  I have tried the following;

open my_file —args arg1

The argument never gets passed.  Does anyone
know how to pass arguments to argv from the
terminal when open a file so I can use the script
from a shell command?

JB




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Escape From Script In Use Blocking?

2017-05-06 Thread Sannyasin Brahmanathaswami via use-livecode
if you manage to do something odd in an on preopencard script such that

a) no error msg appears
b) attempts to change the script are blocked with:

  "cannot change script while is it executing

How to you get out?  I have a good idea what is wrong but cannot change the 
script or enter a break point to step through the code to see issues?

cmd dot doesn’t halt anything either.

BR


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: mySQL connection fine in LiveCode but error in standalone

2017-05-06 Thread Mike Bonner via use-livecode
I'm wondering if the mySql db driver is being included. If you view the
package contents then drill down to
Contents/MacOS/Externals/database_drivers  is there a dbmysql.bundle
folder?

Another thing to check would be WHEN do you try to open the database?  If
you do it in preopenstack, you might be trying to open the db before the
drivers are completely loaded.

Other than that, not sure.


On Sat, May 6, 2017 at 5:19 PM, Kaveh Bazargan via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi folks
>
> I am a definite newbie to databases, but I have been reading from a mysql
> database on the Mac running LC 9. The command is:
>
> revOpenDatabase("MySQL", DatabaseAddress, DatabaseName, DatabaseUser,
> DatabasePassword)
>
> When I export to standalone I get the "revdberr, invalid database" type
> error.
>
> Sorry not much more info but I wonder if there is a simple thing I am
> missing. Is it perhaps that the password cannot  be saved in the stack?
>
> --
> Kaveh Bazargan
> Director
> River Valley Technologies
> @kaveh1000
> +44 7771 824 111
> www.rivervalleytechnologies.com
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


mySQL connection fine in LiveCode but error in standalone

2017-05-06 Thread Kaveh Bazargan via use-livecode
Hi folks

I am a definite newbie to databases, but I have been reading from a mysql
database on the Mac running LC 9. The command is:

revOpenDatabase("MySQL", DatabaseAddress, DatabaseName, DatabaseUser,
DatabasePassword)

When I export to standalone I get the "revdberr, invalid database" type
error.

Sorry not much more info but I wonder if there is a simple thing I am
missing. Is it perhaps that the password cannot  be saved in the stack?

-- 
Kaveh Bazargan
Director
River Valley Technologies
@kaveh1000
+44 7771 824 111
www.rivervalleytechnologies.com
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Scrollbars in 8.1.3

2017-05-06 Thread Paul Hibbert via use-livecode
In LC 7.1.4 you can set the orientation property in the inspector panel under 
Basic Properties, but not in LC 8.1.3 for some reason, the option menu is 
greyed out which suggests it could be a bug to me, however, the dictionary 
states:

Use the orientation property <> to find out whether a scrollbar <> is 
horizontal or vertical.

If the scrollbar's height <> is greater than or equal to its width <>, the 
scrollbar <> is vertical. If the width <> is greater than the height <>, the 
scrollbar <> is horizontal.

To change a scrollbar's orientation, change its width <> and height <> 
properties <>.

The dictionary for LC7 or 8 doesn’t say you can set this property, and if you 
try using the message box it tells you that it can’t set this property. So I 
guess you will have to set the orientation by setting the size to suit in LC 
8.1.3.

I don’t see why the option should be greyed out though.

Paul

Paul
p...@livecode.org

Mac OS Sierra 10.12.1



> On May 6, 2017, at 1:28 PM, Richmond Mathewson via use-livecode 
>  wrote:
> 
> I don't know.
> 
> I just set up a vertical scrollbar in an LC 7.1.4 stack, saved it and opened 
> it up in 8.1.3.
> 
> Richmond.
> 
> On 5/6/17 6:51 pm, Paul Hibbert via use-livecode wrote:
>> How are you trying to set the scrollbar to vertical?
>> 
>> Setting or dragging the SB rect to the desired dimensions should 
>> automatically change it’s orientation as soon as it's width is less than 
>> it's heigh, is this not working?
>> 
>> Paul
>> 
>> 
>>> On May 6, 2017, at 6:42 AM, Richmond Mathewson via use-livecode 
>>>  wrote:
>>> 
>>> I seem quite unable to set a scrollbar to
>>> be vertical in LC 8.1.3 (Mac OS 10.7.5).
>>> 
>>> Richmond.
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Android label and name

2017-05-06 Thread J. Landman Gay via use-livecode

On 5/6/17 3:21 PM, Richard Gaskin via use-livecode wrote:

J. Landman Gay wrote:


I need to build two versions of an Android app, one for production
and another for testing. It appears that the standalone builder uses
the "name" property as the icon label in the Android launcher. I need
the stack name to stay the same, and only the label to differ.

I have tried building with only the label string changed, but in the
launcher it still appears as the stack name. Is there a way to
differentiate the label without changing the stack name?


IMNSHO that would be a bug.

Object labels are for display to end-users; object names are for
developers to code for.

Please post the bug # here so we can follow its progress.



I'm not sure yet if it's a bug or just something extra I should add to 
the manifest. Android uses a complex inheritance for labelling which I 
don't quite understand.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Scrollbars in 8.1.3

2017-05-06 Thread Richmond Mathewson via use-livecode

I don't know.

I just set up a vertical scrollbar in an LC 7.1.4 stack, saved it and 
opened it up in 8.1.3.


Richmond.

On 5/6/17 6:51 pm, Paul Hibbert via use-livecode wrote:

How are you trying to set the scrollbar to vertical?

Setting or dragging the SB rect to the desired dimensions should automatically 
change it’s orientation as soon as it's width is less than it's heigh, is this 
not working?

Paul



On May 6, 2017, at 6:42 AM, Richmond Mathewson via use-livecode 
 wrote:

I seem quite unable to set a scrollbar to
be vertical in LC 8.1.3 (Mac OS 10.7.5).

Richmond.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Android label and name

2017-05-06 Thread Richard Gaskin via use-livecode

J. Landman Gay wrote:

> I need to build two versions of an Android app, one for production
> and another for testing. It appears that the standalone builder uses
> the "name" property as the icon label in the Android launcher. I need
> the stack name to stay the same, and only the label to differ.
>
> I have tried building with only the label string changed, but in the
> launcher it still appears as the stack name. Is there a way to
> differentiate the label without changing the stack name?

IMNSHO that would be a bug.

Object labels are for display to end-users; object names are for 
developers to code for.


Please post the bug # here so we can follow its progress.

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: looking for a smart approach to "sort" an array

2017-05-06 Thread J. Landman Gay via use-livecode

Use tabwidths instead of tabstops. I was working off faulty memory.


On 5/6/17 2:32 PM, Mike Bonner via use-livecode wrote:

Cool stuff! Didn't know you could hide things with tab, and will have to
look at metadata now.  Thanks!

On Sat, May 6, 2017 at 1:30 PM, Jim Lambert via use-livecode <
use-livecode@lists.runrev.com> wrote:




Jacque wrote:
I've done this often, it's a nice clean solution. And now that we can
set tabstops to 0, the second item won't be visible whether there's a
horizontal scrollbar or not.



That’s right!  tabwidths are handy for this hiding too.

But I realized Tiemo might not even need to bother hiding the otherData if
he takes advantage of another property of fields - the metadata property:

set the metadata of line 1 of field 1 to otherDataString
set the metadata of line 2 of field 1 to otherDataString2

A field’s metadata is never visible.
Yet the otherData strings will travel along with each line as the user
drags the the lines up and down.

LiveCode offers so much flexibility! We can usually have a choice of
approaches to any problem

Jim Lambert



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: looking for a smart approach to "sort" an array

2017-05-06 Thread J. Landman Gay via use-livecode

On 5/6/17 2:30 PM, Jim Lambert via use-livecode wrote:

But I realized Tiemo might not even need to bother hiding the
otherData if he takes advantage of another property of fields - the
metadata property:


I forgot all about that, even though I've used it in the past. That's 
the best idea so far.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: looking for a smart approach to "sort" an array

2017-05-06 Thread Mike Bonner via use-livecode
Cool stuff! Didn't know you could hide things with tab, and will have to
look at metadata now.  Thanks!

On Sat, May 6, 2017 at 1:30 PM, Jim Lambert via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> > Jacque wrote:
> > I've done this often, it's a nice clean solution. And now that we can
> > set tabstops to 0, the second item won't be visible whether there's a
> > horizontal scrollbar or not.
>
>
> That’s right!  tabwidths are handy for this hiding too.
>
> But I realized Tiemo might not even need to bother hiding the otherData if
> he takes advantage of another property of fields - the metadata property:
>
> set the metadata of line 1 of field 1 to otherDataString
> set the metadata of line 2 of field 1 to otherDataString2
>
> A field’s metadata is never visible.
> Yet the otherData strings will travel along with each line as the user
> drags the the lines up and down.
>
> LiveCode offers so much flexibility! We can usually have a choice of
> approaches to any problem
>
> Jim Lambert
>
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: looking for a smart approach to "sort" an array

2017-05-06 Thread Jim Lambert via use-livecode

> Jacque wrote:
> I've done this often, it's a nice clean solution. And now that we can 
> set tabstops to 0, the second item won't be visible whether there's a 
> horizontal scrollbar or not.


That’s right!  tabwidths are handy for this hiding too.

But I realized Tiemo might not even need to bother hiding the otherData if he 
takes advantage of another property of fields - the metadata property:

set the metadata of line 1 of field 1 to otherDataString
set the metadata of line 2 of field 1 to otherDataString2

A field’s metadata is never visible.
Yet the otherData strings will travel along with each line as the user drags 
the the lines up and down. 

LiveCode offers so much flexibility! We can usually have a choice of approaches 
to any problem

Jim Lambert



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Android label and name

2017-05-06 Thread J. Landman Gay via use-livecode
I need to build two versions of an Android app, one for production and 
another for testing. It appears that the standalone builder uses the 
"name" property as the icon label in the Android launcher. I need the 
stack name to stay the same, and only the label to differ.


I have tried building with only the label string changed, but in the 
launcher it still appears as the stack name. Is there a way to 
differentiate the label without changing the stack name?


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: looking for a smart approach to "sort" an array

2017-05-06 Thread J. Landman Gay via use-livecode

On 5/6/17 12:10 PM, Jim Lambert via use-livecode wrote:

Set the tabstops to a number greater than the width of the field.
Set the itemdelimter to tab.
Then put the OtherData of each line into the second item of each line.

As long as there’s no horizontal scrollbar on the field the user will never see 
the OtherData.
Getting item 2 of the hilitedline will always give you the corresponding 
OtherData for the word the user has selected.


I've done this often, it's a nice clean solution. And now that we can 
set tabstops to 0, the second item won't be visible whether there's a 
horizontal scrollbar or not.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: looking for a smart approach to "sort" an array

2017-05-06 Thread Jim Lambert via use-livecode
Tiemo,

> I have a list field of words and a correspondent array with the words of the
> field as the keys plus some data per key. I can store the array in a file,
> read it later from file and rebuild the list of words from the keys of the
> array. Up to now, I had this list of words alphabetically sorted. So it was
> easy, when reloading the array to sort the list always alphabetically to
> refresh the visible list in the field.
> 
> The user can also create a custom sequence of the words in the field by drag
> and drop the lines in individual order. Now I am looking for a smart
> approach to keep the same sort order in the correspondent array. I need the
> custom sort order of the words in case I reload the array later from file to
> get the same sequence of words as the user has sorted them, after extracting
> the words from the array. 

As much as I like arrays, in this case you might consider an ‘old school’ 
approach.
This approach will only work if the stack is writable and that 'plus some data 
per key’ is just text.
And the approach is - keep everything in the scrolling list field - including 
the OtherData. No arrays, no writing files.

Set the tabstops to a number greater than the width of the field.
Set the itemdelimter to tab.
Then put the OtherData of each line into the second item of each line.

As long as there’s no horizontal scrollbar on the field the user will never see 
the OtherData.
Getting item 2 of the hilitedline will always give you the corresponding 
OtherData for the word the user has selected.

Your drag and drop routines should still work. Just remember to save the stack 
each time the user rearranges the line order.

Jim Lambert
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Scrollbars in 8.1.3

2017-05-06 Thread Paul Hibbert via use-livecode
How are you trying to set the scrollbar to vertical?

Setting or dragging the SB rect to the desired dimensions should automatically 
change it’s orientation as soon as it's width is less than it's heigh, is this 
not working?

Paul


> On May 6, 2017, at 6:42 AM, Richmond Mathewson via use-livecode 
>  wrote:
> 
> I seem quite unable to set a scrollbar to
> be vertical in LC 8.1.3 (Mac OS 10.7.5).
> 
> Richmond.
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: looking for a smart approach to "sort" an array

2017-05-06 Thread Mike Bonner via use-livecode
Wasn't my post originally, but the gist of the problem was, how does one
get data back out of an array based on a custom sorted list of words that
are used as main array key back out of the array in the desired sequence.

IE there is a list of words in a field.  And an array that has extra
information relating to each word keyed by array[theWord]

To me, the simplest answer is to keep track of the word list and iterate
through it to access each key of the array in the desired sequence.


On Sat, May 6, 2017 at 7:30 AM, Quentin Long via use-livecode <
use-livecode@lists.runrev.com> wrote:

> sez "Tiemo Hollmann TB" :
> To: "LiveCode User Liste senden" 
> > I have a list field of words and a correspondent array with the words of
> the
> > field as the keys plus some data per key. I can store the array in a
> file,
> > read it later from file and rebuild the list of words from the keys of
> the
> > array. Up to now, I had this list of words alphabetically sorted. So it
> was
> > easy, when reloading the array to sort the list always alphabetically to
> > refresh the visible list in the field.
> >
> > The user can also create a custom sequence of the words in the field by
> drag
> > and drop the lines in individual order. Now I am looking for a smart
> > approach to keep the same sort order in the correspondent array. I need
> the
> > custom sort order of the words in case I reload the array later from
> file to
> > get the same sequence of words as the user has sorted them, after
> extracting
> > the words from the array. The key of the array has to keep the words from
> > the list for accessing the data in the array.
> >
> > As far as I see it, I have to add an additional item to the array data,
> > storing the sort sequence of the keys, while the user creates his custom
> > sequence of the words in the list field and keeping this number always
> > synchronous to the line number of the fields list. So I could use this
> "sort
> > sequence number" from the array to rebuild the same sort of the words
> when
> > extracting the words from the array.
> >
> > Would this be the best approach to keep the sort sequence of the words
> > stored with the array, or do you see an easier more straight forward
> > approach to keep the array "synchronous sorted" which I don't see right
> now?
> Use the alphabetically-sorted word-list as the keys of an array.
>
> -- MySortedList is a return-delimited list, one word per line, sorted
> alphabetically
> -- UserSortedWordList is the return-delimited list of words sorted into
> the user's preferred order
> put "" into WordArray
> repeat for each line LL in MySortedList
>   put lineOffset (LL,UserSortedWordList) into WordArray[LL]
> next repeat
>
> I'm not entirely sure that lineOffset (or even wordOffset) are the right
> thing to do here; there's every danger of encountering a Scunthorpe
> problem, such as if "pen" and "open" are both words in the list, or
> "squire" and "ire", etc etc. Hmm… maybe go with comma-delimited lists, and
> something along the lines of "put wordOffset (comma & LL & comma, comma &
> UserSortedWordList & comma) into WordArray[LL]" ?
>
> If this is what Mike Bonner had in mind, chalk it up to my inability to
> comprehend what he wrote.
>
> "Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"
>
> Read the webcomic at [ http://www.atarmslength.net ]!
>
> If you like "At Arm's Length", support it at [ http://www.patreon.com/
> DarkwingDude ].
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Scrollbars in 8.1.3

2017-05-06 Thread Richmond Mathewson via use-livecode

I seem quite unable to set a scrollbar to
be vertical in LC 8.1.3 (Mac OS 10.7.5).

Richmond.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: looking for a smart approach to "sort" an array

2017-05-06 Thread Quentin Long via use-livecode
sez "Tiemo Hollmann TB" :
To: "LiveCode User Liste senden" 
> I have a list field of words and a correspondent array with the words of the
> field as the keys plus some data per key. I can store the array in a file,
> read it later from file and rebuild the list of words from the keys of the
> array. Up to now, I had this list of words alphabetically sorted. So it was
> easy, when reloading the array to sort the list always alphabetically to
> refresh the visible list in the field.
> 
> The user can also create a custom sequence of the words in the field by drag
> and drop the lines in individual order. Now I am looking for a smart
> approach to keep the same sort order in the correspondent array. I need the
> custom sort order of the words in case I reload the array later from file to
> get the same sequence of words as the user has sorted them, after extracting
> the words from the array. The key of the array has to keep the words from
> the list for accessing the data in the array.
> 
> As far as I see it, I have to add an additional item to the array data,
> storing the sort sequence of the keys, while the user creates his custom
> sequence of the words in the list field and keeping this number always
> synchronous to the line number of the fields list. So I could use this "sort
> sequence number" from the array to rebuild the same sort of the words when
> extracting the words from the array.
> 
> Would this be the best approach to keep the sort sequence of the words
> stored with the array, or do you see an easier more straight forward
> approach to keep the array "synchronous sorted" which I don't see right now?
Use the alphabetically-sorted word-list as the keys of an array.

-- MySortedList is a return-delimited list, one word per line, sorted 
alphabetically
-- UserSortedWordList is the return-delimited list of words sorted into the 
user's preferred order
put "" into WordArray
repeat for each line LL in MySortedList
  put lineOffset (LL,UserSortedWordList) into WordArray[LL]
next repeat

I'm not entirely sure that lineOffset (or even wordOffset) are the right thing 
to do here; there's every danger of encountering a Scunthorpe problem, such as 
if "pen" and "open" are both words in the list, or "squire" and "ire", etc etc. 
Hmm… maybe go with comma-delimited lists, and something along the lines of "put 
wordOffset (comma & LL & comma, comma & UserSortedWordList & comma) into 
WordArray[LL]" ?

If this is what Mike Bonner had in mind, chalk it up to my inability to 
comprehend what he wrote.
   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ 
http://www.patreon.com/DarkwingDude ].

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode