Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Basic (no pun intended) Gambas Query

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  
Author Message
TonyBradley



Joined: Thu Jul 13, 2006 2:40 pm
Posts: 22
Location: Plymouth

PostPosted: Wed May 21, 2014 4:08 pm    Post subject: Basic (no pun intended) Gambas Query Reply with quote

I'm trying to build a GUI to access MySQL, as described on page 94 of issue 71, but am running into difficulties.

I enter the following code, and hit the run button as instucted...

PUBLIC SUB Form_Open()
combobox1.Add("Fred Jones")
combobox1.Add("Mary Smith")
combobox1.Add("Tony Bradley")
END

...only to get the following error message:
Unknown Identifier:combobox1 at line 6 in FMain.class

What am I doing wrong?
Back to top
View user's profile Send private message Send e-mail
roseway
LXF regular


Joined: Thu Jan 18, 2007 2:27 pm
Posts: 445

PostPosted: Wed May 21, 2014 6:45 pm    Post subject: Reply with quote

I don't know anything about Gambas, but presumably you first have to drop a combobox on the form before writing code which refers to it.
_________________
Eric
Back to top
View user's profile Send private message
Ram
LXF regular


Joined: Thu Apr 07, 2005 10:44 pm
Posts: 1667
Location: Guisborough

PostPosted: Thu May 22, 2014 2:49 am    Post subject: Reply with quote

Hi,

I've just installed Gambas3 and created a new graphical project.

Dropped a textbox & combox on the form. Checked it ran ok.

Double clicked the form to show the source code and added the text from the tutorial.

This is what I have
Code:

' Gambas class file

Public Sub _new()

End

Public Sub Form_Open()
        combobox1.Add("Fred Jones")
        combobox1.Add("Mary Smith")
        combobox1.Add("Tony Bradley")
End


Which runs and displays the names once the combobox down arrow is clicked.
_________________

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
Back to top
View user's profile Send private message MSN Messenger
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast