[Gambas-user] Value is not static

Ken King kicking177 at gmail.com
Wed Jun 16 08:26:16 CEST 2021


If I have the following code
 - - - - -
' Gambas class file
Public Value1 As Integer
Public Value2 As Integer

Public Function ProcessIt() As Boolean
  Value2 = Value1 * 2
  Return True
Catch
  Return False
End
 - - - - -
 ' Gambas module file
Public Sub Main()
  Dim class1 As Class1
  Dim CalcValue As Integer
  class1 = New Class1
  class1.Value1 = 3
  If class1.ProcessIt() Then
    CalcValue = class1.Value2
    Print CalcValue
  Else
    Print "An error Occurred"
  Endif
End
 - - - -
it runs and works as I expect but if  if I try to look at the class1 values
I get
'class1.Value1' is not static
What am I not understanding?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210616/cabcac82/attachment.htm>


More information about the User mailing list