Re: sharing variables and arrays in different comboboxes in a form



If I declare a private array in the forms load or init method - can I use
that array in a valid method of a combobox in that form or should I declare
it somewhere else..
(think I have tested this with no success)

/Patrik

"Anders Altberg" wrote:

> Any array or variable created in a procedure is scoped to that procedure and
> released when that procedure finishes. A Private variable can still be seen
> in a procedure called from the procedure where it was created (unless the
> theres a PRIVATE declaration in the subprocedure).
> Make the array a Form property or possibly a property of a combobox.
> THIS.ADDPROPERTY("arr(1)")
> SELECT ... INTO ARRAY This.arr
>
> -Anders
>
> "Piddepadde" <Piddepadde@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:C96F2CB2-A631-4850-B3A5-2DC71B1C82E9@xxxxxxxxxxxxxxxx
> > I am rewriting an application from foxpro 2.6 to vfp 9 and have some
> problem
> > to understand the way to sharr variables and arrays in different
> comboboxes
> > in the same form.
> >
> > When I create an array, using SQL select command, in a "valid" method in
> one
> > combobox I can't use it (see the contents) in another combox methods.
> > I think that I have missed something basic...
> >
> > Is there any basic, initally command that has to be set in order to use
> > arrays and variables trough a forms different objects... ?
> >
> > /Patrik
>
>
.



Relevant Pages

  • Re: Array of Strings
    ... type letters is private; ... type letters is array of Element_Type; ... When you declare a generic formal type (a "type" ... You can also declare formal array types, access types, and derived ...
    (comp.lang.ada)
  • Help with Array Declarations
    ... I have two Userforms that use exactly the same information ... in a combobox if I wanted to only declare the Array once ... Both Userforms have the Array declared on the ...
    (microsoft.public.excel.programming)
  • Re: Passing an array of structuresfrom a pointer?
    ... to only declare structs in headers and then define the ... the struct should be declared ... what if you have a simple array like this: ... In the header we would declare? ...
    (microsoft.public.vc.language)
  • Re: What is the Fastest way for adding string items to some array/collection in sorted order?
    ... Test is performed to almost always add item at beginning of array, ... Private Declare Function StrArrAddItemSortedWD Lib "X.dll" As ... private arrcount as long ... szItemString is Empty String when API call returns ...
    (microsoft.public.vb.winapi)
  • Re: vb.net class
    ... about fixed array lenghts or using ReDim statements. ... code ensures everything in the array is a String because you declare it ... Count can be generated from the time list, not need to store ...
    (microsoft.public.dotnet.languages.vb)