A Beginner's Guide to Gambas, Revised for Version 3

Support for questions or comments about the book

Update — end of 2011

In total, there have been more than 1,700 visits to this blog, and more than 1,500 downloads of Beginner’s Guide to Gambas, Revised for Version 3.  We are delighted that programmers are showing so much interest — please let your programming friends know that this book is available as a download for free.

To purchase the paperback version of the book, you can click on the book cover to the right. ===>

Ciao!

Filed under: Comments/Questions

11 Responses

  1. stanks says:

    hi

    i d/l your book and started to try examples from book. but now i have some problems with examples. on page 55 (Defining and Using Arrays in Gambas) examples does not work. i get some error “embedded arrays…” (i am now on winblowz so i dont know exact error msg) in line DIM narMatrix[3, 3, 3] AS Integer. you have some minor issues with quoatiton mark (i think it is called that char “…try copy/paste code from pdf to ide). i get to chapter 6 (menus, modules, …) and now i have big problem. 1st example does not work. i think that this is problem with latest gambas v3. in menu editor i don’t have 8 buttons under the list of menus and menu items and subitems (buttons are next, insert, delete, up, down, left, right and 8th that i don’t know how to describe 🙂 ) do u have any idea?

    thanks for great book

    • minnesotajon says:

      Hi, stanks — Please give me a day or two, and I will look at the code and give you a real response.
      Best regards,
      minnesotajon

    • minnesotajon says:

      Hi, again, stanks — I have the solution for you.
      First, when the book was published, there were still a few changes being made to Gambas3. This is one of them. Remember this rule: When you find something that doesn’t work, you can check the Gambas Language Index, and you will probably find the answer:
      OK, about the problem that you found — Look on this page: http://gambasdoc.org/help/cat/arraydecl?v3

        Embedded arrays

      [ STATIC ] { PUBLIC | PRIVATE } Identifier [ Array dimensions … ] AS Native Datatype
      An embedded array is an array that is allocated directly inside the object where it is declared.
      Such an array cannot be shared, and is destroyed with the object.
      An embedded array cannot be public, and you cannot initialize it.
      In Gambas 3, embedded arrays cannot be used as local variables anymore. But they

        can

      be public!
      So, this is a difference between Gambas2 and Gambas3. And in Gambas3, the code looks like this, and it will run correctly:

      Public narMatrix[3, 3, 3] As Integer

      Public Sub Main()
      Dim i As Integer
      Dim ii As Integer
      Dim iii As Integer
      ‘Dim narMatrix[3, 3, 3] As Integer
      For i = 0 To 2
      For ii = 0 To 2
      For iii = 0 To 2
      Print i, ii, iii & ” ==> “; ‘note that “;” prevents a newline.
      narMatrix[i, ii, iii] = i * 9 + ii * 3 + iii
      Print narMatrix[i, ii, iii]
      Next
      Next
      Next
      End

  2. stanks says:

    thanks. this worked. about menus…i didn’t notice till today that with indent you make submenus and items 🙂
    I think that you forget to add Item1 (variable name should be Menu4Item1 not Menu4) for About item in Help menu.
    if i will have some other problems i will annoy you 😀

  3. stanks says:

    and color property for textlabel is background and foreground not backcolor/forecolor. these are some changes if i understand well from v2 to v3

    • minnesotajon says:

      Hi, stanks — I am very happy that you are working with the book and noticing so many things!

      You are right, Gambas2 allowed BOTH “BackColor”/”Background” and “ForeColor”/”Foreground”. This is redundant, so in Gambas3 they only allow “Background” and “Foreground”. Thanks for mentioning this — I have made a note to change it in a future version of the book.

  4. stanks says:

    i had to change example on page 143/144 (data conversion) in if clause. changed as stated here http://www.mail-archive.com/gambas-user@lists.sourceforge.net/msg11209.html

  5. stanks says:

    page 172 (gridview control)
    “When the IDE appears, we will need to go to the project window and bring up the ICON Editor. We will create three icons, named GridPic, GridPic1, and GridPic2, as shown above. Use the 16 pixels by 16 pixels setting, and try to get them reasonably close to what you see in the picture above if you can.”
    but in example code we load GridPic1, GridPic2 and GridPic3

    “…(Button4) and “Redo Row/Column” (Button5).”
    but then on page 175
    “Double-click on the “Erase Row/Column” button (Button 5) and enter this code:”
    On example picture it is Redo not Erase

  6. stanks says:

    page 200 (files)

    title is copy, kill and rename but in text we have MOVE not RENAME

    • minnesotajon says:

      Hi, stanks — Thank you for sending these corrections. We updated the book from the original version, and obviously we missed a few details. I hope you are enjoying working with the book!
      Best regards, minnesotajon

Leave a Question or Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

A Beginner’s Guide to Gambas, Revised for Version 3

Click on the book cover to order the paperback book at Infinity Publishing!

Click on the shrimp to go to the main website for Gambas!

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 78 other followers

%d bloggers like this: