> Okay, that's also a bug: SetField Stem does not use COUNT at all,
> but only relies on the initialized ARexx variables. I.e. if you
> have a stem.1 initialized, SetField will currently always possibly
> create an entry and set it to stem.1
I prefer that the number of items is congruent with the .count value
(and the highest .count value for connected LV).
>> SetField 'CreateListEntries' 'stem' where 'STEM..count = 0
>> should delete the entire LV.
>
> Yes, it should. It does when stem..1 is not initialized.
...but actually, due to the bug, a line is always present.
>> STEM..n (n = numentry) is an uninitialized element, fiasco should
>> initialize it to the defaul value set for that field.
>
> Currently, these are ignored, the old contents remain the same.
This is not what is stated in the Fiasco.guide
"... if you use the CreateListEntries switch, this command will remove
all old entries from the listview and replace them by the entries in the
stem variable. "
However I prefeer that you switch to this working instead of changing the
documentation, becouse merging the old values with the new ones would be a
simple task, the user has only to change the items of the stem he as just
taken and write back to the LV.
(LATER... I have another proposal, read it below)
>> When we have connected LV, the number of entries of the other LVs should
be
>> adjusted to match the .COUNT value of the stem you are SETFIELDing so, if
>> they have more entries, they should be deleted starting from the last, if
>> they have less entries, new ones must be added and their content shoul be
>> the default value the user has set for each field.
>
> I will probably add an argument that handles grouped listviews.
I find the proposed approach for the 'CreateListEntries' is a good one and
fullfills all the needing one may have fo a LV. Why (and where) you find
the needing of another switch ?
Summary:
- .count sets the number of lines in a LV and the number of lines in all
the connected LVs.
- An uninitialized element in the range STEM..1 - STEM..count
create a LV entry set to the default value.
... -> Later addition:
Or... Nils I have had another IDEA while observing the working of the
Setfield command: actually there is no way to set a field to its
predefined value. You may leave the actual 'CreateListEntries' working,
(changeing only the .count one) and add another switch to 'Setfield' to let
fiasco set a field to its predefined value when the corresponding compound
simbol inside a stem is uninitialized or when the name of the field is
given but not its value.
Examples:
Setfield '"From"' 'Default' / Set the 'From' field to its predefined
value /
Setfield 'stem' '"Mystem"' 'Default' / Stores the predefined value inside
each field whose compound simbol is
uninitialized and in each LV line
whose compound simbol in the range
stem..1 - stem..count
If the .count value of a LV is
uninitialized, it is left untouched.
If it set to something other, it acts
in all the lines opto .count replacing
the existing value with new and default
ones /
and so on..
In any other way, the contents of the fields and LVs are preserved.
Ciao,
Giuseppe Chillemi
-------------------------------------------------------------------------
fiasco - Majordomo 1.94.4 - http://www.amigaworld.com
You can download the complete archive as Fiasco database here.