ArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2010-06-30T20:01:25+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/2271 2010-06-30T20:01:25+02:00 2010-06-30T20:01:25+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14481#p14481 <![CDATA[[script] TstringList sizes]]> Totally right.

Statistics: Posted by senso — 30 Jun 2010, 20:01


]]>
2010-06-28T23:31:00+02:00 2010-06-28T23:31:00+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14451#p14451 <![CDATA[[script] TstringList sizes]]>
think it's better than my system, i copy the list items to an array of string, that will work in any case and recompose the comma from the array, but that mean double internal use and old skool reconcating with comma. better format the new adds and use your technique.

funny i was also using the index as "max size" and you make me notice i forgot to add +1.will convert my system..

Statistics: Posted by 23fx23 — 28 Jun 2010, 23:31


]]>
2010-06-28T22:39:12+02:00 2010-06-28T22:39:12+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14449#p14449 <![CDATA[[script] TstringList sizes]]>
for now, i solved this problem with a procedure

CODE:

// S is a global string variableProcedure ExtendStringList;var id, count, i &#58; Integer;BEGIN    id &#58;= Round&#40;GetValue&#40;new_caption_id&#41;&#41;;    count &#58;= slCaptions.count;        if &#40;new_id >= count&#41; then     begin        slCaptions.capacity&#58;= new_id + 1;         S &#58;= '';        for i&#58;= count to new_id + 1 do begin               slCaptions.add&#40;S&#41;;        end;    end;END;
it extend the stringlist to the new capacity with some empty string

hope it help

Statistics: Posted by martignasse — 28 Jun 2010, 22:39


]]>
2010-06-28T21:09:10+02:00 2010-06-28T21:09:10+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14448#p14448 <![CDATA[[script] TstringList sizes]]>
what we want is being able to set an item above SL1.count

ie a comma from a preset as 5 item, but we wanna set the 8th item.
SL1 pick the commatext from in, so SL1.count is 5, then even if we set SL1 Capacity to 8,
we can't modify the 8th element of SL1, cause the commatext only goes to 5, even if it's capacity is 8.

my solution for now was make an array of string of size 8, fill it with the 1-5 from comma in items, so if then if i try to set item 8
of stringArray, it works,( whereas i can't on stringlist )then reconstruct the commaout by concating each element of the string array + a comma in between.
that works but seems weird complex, ;) there must be simpler no?

Statistics: Posted by 23fx23 — 28 Jun 2010, 21:09


]]>
2010-06-28T21:01:21+02:00 2010-06-28T21:01:21+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14447#p14447 <![CDATA[[script] TstringList sizes]]>

CODE:

SL1.count
gives the total number of items in the StringList

Statistics: Posted by senso — 28 Jun 2010, 21:01


]]>
2010-06-28T20:25:04+02:00 2010-06-28T20:25:04+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14446#p14446 <![CDATA[[script] TstringList sizes]]>
maybe gonna try to fill an array of string, but there must be a simple solution, that's not possible..
don't know arf this drives me crasy heehe. oooollliiiviiier!!

Statistics: Posted by 23fx23 — 28 Jun 2010, 20:25


]]>
2010-06-28T20:09:12+02:00 2010-06-28T20:09:12+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14445#p14445 <![CDATA[[script] TstringList sizes]]>

unfortunately, i haven't found a solution yet :(

Statistics: Posted by martignasse — 28 Jun 2010, 20:09


]]>
2010-06-28T20:05:18+02:00 2010-06-28T20:05:18+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14444#p14444 <![CDATA[[script] TstringList sizes]]>
usually I use 'Set capacity' on init of the script so that looks like

SL1.capacity := X;

or i pick commaText from an input.
but I notice to be able to set an item in the list, the list seems to first have a comma text. if i direct try ie:

SL1.strings[5] := 'blabla';

it returns me an error, , even if capacity is set above 5, whereas it will work if on init i defined a commatext, ie

SL1.commaText := 0,1,2,3,4,5,6,7,8; ect.. so that's quite boring if size change, or have to fill it...

Isn't there a simpler way? basically i want the script to catch a matrix size and be able to change some captions
relating the cliced index nb, but if i saved to a preset with a matrix where 5 cellz had caption set, the commain goes
back to script and i can change the 5 captions , but if iwanna set ie cell 8 wich as no caption i can't, even if i set
SL1.capacity to 8, cause the comma from matrix only goes to 5.

see what i mean, any mater as a tip?

Statistics: Posted by 23fx23 — 28 Jun 2010, 20:05


]]>
BrainModular BrainModular Users Forum 2010-06-30T20:01:25+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/2271 2010-06-30T20:01:25+02:00 2010-06-30T20:01:25+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14481#p14481 <![CDATA[[script] TstringList sizes]]> Totally right.

Statistics: Posted by senso — 30 Jun 2010, 20:01


]]>
2010-06-28T23:31:00+02:00 2010-06-28T23:31:00+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14451#p14451 <![CDATA[[script] TstringList sizes]]>
think it's better than my system, i copy the list items to an array of string, that will work in any case and recompose the comma from the array, but that mean double internal use and old skool reconcating with comma. better format the new adds and use your technique.

funny i was also using the index as "max size" and you make me notice i forgot to add +1.will convert my system..

Statistics: Posted by 23fx23 — 28 Jun 2010, 23:31


]]>
2010-06-28T22:39:12+02:00 2010-06-28T22:39:12+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14449#p14449 <![CDATA[[script] TstringList sizes]]>
for now, i solved this problem with a procedure

CODE:

// S is a global string variableProcedure ExtendStringList;var id, count, i &#58; Integer;BEGIN    id &#58;= Round&#40;GetValue&#40;new_caption_id&#41;&#41;;    count &#58;= slCaptions.count;        if &#40;new_id >= count&#41; then     begin        slCaptions.capacity&#58;= new_id + 1;         S &#58;= '';        for i&#58;= count to new_id + 1 do begin               slCaptions.add&#40;S&#41;;        end;    end;END;
it extend the stringlist to the new capacity with some empty string

hope it help

Statistics: Posted by martignasse — 28 Jun 2010, 22:39


]]>
2010-06-28T21:09:10+02:00 2010-06-28T21:09:10+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14448#p14448 <![CDATA[[script] TstringList sizes]]>
what we want is being able to set an item above SL1.count

ie a comma from a preset as 5 item, but we wanna set the 8th item.
SL1 pick the commatext from in, so SL1.count is 5, then even if we set SL1 Capacity to 8,
we can't modify the 8th element of SL1, cause the commatext only goes to 5, even if it's capacity is 8.

my solution for now was make an array of string of size 8, fill it with the 1-5 from comma in items, so if then if i try to set item 8
of stringArray, it works,( whereas i can't on stringlist )then reconstruct the commaout by concating each element of the string array + a comma in between.
that works but seems weird complex, ;) there must be simpler no?

Statistics: Posted by 23fx23 — 28 Jun 2010, 21:09


]]>
2010-06-28T21:01:21+02:00 2010-06-28T21:01:21+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14447#p14447 <![CDATA[[script] TstringList sizes]]>

CODE:

SL1.count
gives the total number of items in the StringList

Statistics: Posted by senso — 28 Jun 2010, 21:01


]]>
2010-06-28T20:25:04+02:00 2010-06-28T20:25:04+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14446#p14446 <![CDATA[[script] TstringList sizes]]>
maybe gonna try to fill an array of string, but there must be a simple solution, that's not possible..
don't know arf this drives me crasy heehe. oooollliiiviiier!!

Statistics: Posted by 23fx23 — 28 Jun 2010, 20:25


]]>
2010-06-28T20:09:12+02:00 2010-06-28T20:09:12+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14445#p14445 <![CDATA[[script] TstringList sizes]]>

unfortunately, i haven't found a solution yet :(

Statistics: Posted by martignasse — 28 Jun 2010, 20:09


]]>
2010-06-28T20:05:18+02:00 2010-06-28T20:05:18+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=2271&p=14444#p14444 <![CDATA[[script] TstringList sizes]]>
usually I use 'Set capacity' on init of the script so that looks like

SL1.capacity := X;

or i pick commaText from an input.
but I notice to be able to set an item in the list, the list seems to first have a comma text. if i direct try ie:

SL1.strings[5] := 'blabla';

it returns me an error, , even if capacity is set above 5, whereas it will work if on init i defined a commatext, ie

SL1.commaText := 0,1,2,3,4,5,6,7,8; ect.. so that's quite boring if size change, or have to fill it...

Isn't there a simpler way? basically i want the script to catch a matrix size and be able to change some captions
relating the cliced index nb, but if i saved to a preset with a matrix where 5 cellz had caption set, the commain goes
back to script and i can change the 5 captions , but if iwanna set ie cell 8 wich as no caption i can't, even if i set
SL1.capacity to 8, cause the comma from matrix only goes to 5.

see what i mean, any mater as a tip?

Statistics: Posted by 23fx23 — 28 Jun 2010, 20:05


]]>