[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error Loop Variable cannot be global


Le 18/03/2024 à 19:46, Mayost Sharon a écrit :
Hello

I try to run this code:

' Gambas module file

Public $vList As String[] = ["a", "b", "c"]
Public $vStr As String

Public Sub Main()
For Each $vStr In $vList
     Debug $vStr
   Next

End


and it gives an error:
Error Loop Variable cannot be global

Thanks



This is by design, and was done for performance reasons.

Regards,

--
Benoît Minisini.


References:
Error Loop Variable cannot be global"Mayost Sharon" <sharon@xxxxxxxxx>