>I have a Legacy Foxpro 2.6 for Windows App here to maintain.
>
>I found that they are using on this particular form a listbox. This listbox gets its input from a SQL Select feeding to an Array. The selected value goes to a variable (character).
>
>One problem.
>
>I am starting fresh with the code to create a new layer of input, so I copied this to use. I am starting with blank databases, so the SQL statement gets NO records, hence the array is non-existant, and the form crashes upon starting.
>
>What is a solution for this? I have placed code to check _TALLY, and then intialize the Array with 1 element, and placed values in the array element.
>
>Is there a cleaner way?
>What would you do?
>
>Tommy
You can dimension and initialize an array before select.
If SQL select gets no records than foxpro wouldn't change the array.
Otherwise the array will be filled with selected data.
--sb--