[Gambas-user] Calling Function for Array List Forms

Bruce Steers bsteers4 at gmail.com
Wed May 12 20:12:09 CEST 2021


On Wed, 12 May 2021 at 17:13, Hasan Merkit <hasanmerkit at outlook.com> wrote:

>
>
> I do not understand what you mean.
>
> I just ask how i can call >> A Function << for all array items.
>
>
>
> If i do this:
>
> Dim ExampleArray As Form[] = [“form1”, “form2”, “form3”]
>

That is an array of strings not forms.
Try this...

Dim ExampleArray As Form[] = [Form1, Form2, Form3]



>
> I want works this:
>
> AnFunction(form1)
>
> AnFunction(form2)
>
> AnFunction(form3)
>

That way does not pass an array just a single form each time so....
Public Sub AnFunction(fForm as Form)



>
>
> This not works:
>
> AnFunction(ExampleArray[])
>

If array of forms ExampleArray is built like above then try this...

AnFunction(ExampleArray)

Public Sub AnFunction(fFormArray as Form[])
For Each fForm As Form In fFormArray
DoFunctionOn(fForm)
Next
End

BruceS




>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210512/3a134d52/attachment.htm>


More information about the User mailing list