My problem with keyword TYPE
Posted: Thu Jun 12, 2014 3:03 pm
There are this program (from fnybasic help), but does not work as it should. According to the fnxcompiler:
"error 8 line 16 `LEFT` not declared/unknown"
Why? "left" is a propertie of panel, also propertie of mypanel too, on my opinion.
The program:
[code]
type mypanel as panel
dim isvisible as boolean `see this as an extra propertie
isvisible=false `default value
sub getvisible `this would be an extra method
isvisible=visible `variable is mypanel.visible
end sub
end type
object myform as form
autosize=true
center
object newpanel as mypanel
left=0:top=0
width=500:height=500
end object ` mypanel
showmodal
end object ` MyForm
newpanel.getvisible
showmessage newpanel.isvisible
[end code]
"error 8 line 16 `LEFT` not declared/unknown"
Why? "left" is a propertie of panel, also propertie of mypanel too, on my opinion.
The program:
[code]
type mypanel as panel
dim isvisible as boolean `see this as an extra propertie
isvisible=false `default value
sub getvisible `this would be an extra method
isvisible=visible `variable is mypanel.visible
end sub
end type
object myform as form
autosize=true
center
object newpanel as mypanel
left=0:top=0
width=500:height=500
end object ` mypanel
showmodal
end object ` MyForm
newpanel.getvisible
showmessage newpanel.isvisible
[end code]