[Gambas-user] Collections

Werner wdahn at ...1000...
Sat Jan 16 17:57:19 CET 2010


On 17/01/10 00:27, Pino Zollo wrote:
> Il sabato 16 gennaio 2010 12:21:09 gambas-user-request at lists.sourceforge.net 
> ha scritto:
>   
>>>               Disp.DisRes.Text = Disp.DisRes.Text & "~~~~~~~~~"
>>>             INC i
>>>          LOOP
>>>          ' CBCommand.Clear
>>>          ' CBComm2.Clear
>>>          FOR EACH Element IN Lista
>>>              
>>>               PRINT Lista.Key;; "   ";; Lista[Lista.key][1];; "   ";;
>>> Lista[Lista.key][0] PRINT Lista.Key;; "   ";; Element[1];; "   ";;
>>> Element[0]
>>>
>>>               ' SELECT CASE Element[1]
>>>               '    CASE "n:s"
>>>               '      CBCommand.Add(Lista.Key)
>>>               '    CASE "s:n"
>>>               '      CBComm2.Add(Lista.Key)
>>>               ' END SELECT
>>>          NEXT  
>>> -----------------------------------------------------
>>>
>>>  
>>>       
>> I look at the code above and wonder abount the first 2 lines.
>> Say i is 3 and count is 6. When it loops you get the following:
>>     i        count
>>     3        6
>>     4        5
>> end of loop
>> because the Pop in the second line reduces count. Is that what you wanted?
>>     
> Hi Werner,
>
> Sorry for the previous wrong "Object"....
>
> Yes definitively it takes to eliminate the INC i instruction....
>
> The main problems remains....now the 119th string is always printed:
> i.e. "  A:n     Returns the list of methods.  "
> While the first column, the key, is correct.
> -----------------------
> fldigi.version_struct     A:n     Returns the list of methods.
> fldigi.version_struct     A:n     Returns the list of methods.
> fldigi.name     A:n     Returns the list of methods.
> fldigi.name     A:n     Returns the list of methods.
> fldigi.list     A:n     Returns the list of methods.
> fldigi.list     A:n     Returns the list of methods.
> -----------------------
>
> Regards
>
> Pino
>
>
>   
Like Charlie mentioned, it would be helpful if you supplied a small
subproject that shows the problem, along with test data, if needed.

Personally, my debugging style is to step through the code or use
breakpoints at strategic locations. Then I inspect the variables that
are being used in that section to compare with what values I expect them
to contain.

For expressions like myArray.Count you highlight the expression and the
debugger will show you the value.

The Gambas debugger is fantastic.

Regards,
Werner




More information about the User mailing list