Is there a pre-existing thread somewhere specific to answering questions related to the Introduction to Xojo eBook?
I’ve run into some errors with the book and can’t seem to solve them. I’m having trouble even figuring out how to find out how to solve the problems.
I’m wondering if others have run into similar issues? Maybe some of the code has been updated since the book was published? (Specifically in the Database section.)
If you don’t state your issue in the form of a question, then its doubtful anyone here can provide an answer.
But to the direct question you DID ask, “No there is not a pre-existing thread related to 'Intro to Xojo” e-book"
and remember books (“e” or other types) are fairly static, while the programming languages move on, causing the data in those books to become outdated quickly…
I figured I was running into some stale code with the ebook.
For example…
I’m getting a “Expecting(Integer, Integer) but these arguments are (String, String)” bug error on the following code on the “s.SetName(FirstNameField.Text, LastNameField.Text)” line:
Dim t As Teacher
Dim s As Student
Dim newName As String
newName = FirstNameField.Text + " " + LastNameField.Text
If TypeMenu.Text = "Student" Then
s = New Student
s.SetName(FirstNameField.Text, LastNameField.Text)
PeopleList.AddRow(newName)
PeopleList.CellTag(PeopleList.LastIndex, 0) = s
Else
t = New Teacher
t.SetName(FirstNameField.Text, LastNameField.Text)
PeopleList.AddRow(newName)
PeopleList.CellTag(PeopleList.LastIndex, 0) = t
End If
FirstNameField.Text = ""
LastNameField.Text = ""
FirstNameField.SetFocus
I double-checked the Return type for the SetName method and it is set as String. Not sure where the disconnect is. I’ve established the two parameters for the SetName method as the book describes (FirstName = fName, LastName = lName). Perhaps the problem is somewhere in there?
if so… are the INPUT parameters for SETNAME both STRING?
based on the error message, something is expecting TWO Integers, and you are giving it TWO strings… so start by looking at places that require TWO arguments, and see if they are the correct types.
The Person class has a SetName method. Make sure you made both parameters to that method “as String”. You appear to have made an error when you set that class up.
The book was last updated in July 2016 and the download includes source code for the projects, which you can compare with your own projects to help you find any issues:
Landscape instead of Portrait, many pictures, etc.
Nota: I find this a bit strange. Example: Add this code to AddButtons Action event. Nice, but where do you tell Joe Newbie it have to add an Action event ?
I nearly forgot: Page 210, I found MiddleName. But that Variable is unused. [critics are easier that doing]
[quote=285386:@Emile Schwarz]In the New iBook (and PDF), this is:
13.2 Classes and Subclasses, Pages 210 to 214.
Landscape instead of Portrait, many pictures, etc.
Nota: I find this a bit strange. Example: Add this code to AddButtons Action event. Nice, but where do you tell Joe Newbie it have to add an Action event ?
I nearly forgot: Page 210, I found MiddleName. But that Variable is unused. [critics are easier that doing][/quote]
You should file a bug report in feedback.
Thanks, everyone, for your help. I really appreciate it! I should’ve mentioned what tutorial I was working on. It was the “Subclasses” tutorial from the most recent ebook download from the Xojo site.
Your help lead me to my mistake: I set the parameters incorrectly for the SetName method. Once I added “as String” to FName and LName that fixed the problem.
Thanks, again!
(I tried to check “This answers my question” for more than one respondent but it’ll only let me choose one. Thanks to everyone!)