[Gambas-user] A Beginner's Guide to Gambas
Scott Castaline
hscast at ...407...
Mon Jul 2 23:25:20 CEST 2007
ron wrote:
> On Monday 02 July 2007 22:52, Scott Castaline wrote:
>> PUBLIC SUB hButton_Click()
>> Button.Hide
>> Label.Text = "Hey! Watch that!"
>> WAIT 2.0
>> Button.Show
>> Label.Text = "Ahh! So good!"
>> END
>>
>
> 'Button' is the type 'name' the controll object.
>
> You created it however with code as:
> hButton = NEW Button (ME) AS "hButton"
>
> How to difference eight buttons in code placed on the formt ?
>
> Now 'hButton' is your friend to act on.
> The sub routine should be where hButton is the symbolic name.
>
> PUBLIC SUB hButton_Click()
> hButton.Hide '<--- see the 'h' in front
> Label.Text = "Hey! Watch that!"
> WAIT 2.0
> hButton.Show '<--- same
> Label.Text = "Ahh! So good!"
> END
>
> --
> Ron
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
That's the way I had originally done it, and i got "Unknown identifier:
hButton at line 24 in Form1.class." Originally the code in the book had
Button1.Hide, which had generated the same error. So I knew that the
main sub had button defined as hButton, so I had originally changed it
to that and got the above message. I then got rid of that message when I
changed it to what I had sent to the list. So now I'm totally confused.
I thought that Button was a class object that had to be declared and
referenced by someother name in the DIM statement.?
More information about the User
mailing list