"Intro to Xojo" ebook questions

Hello,

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.)

Thanks!
Sean

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…

Thanks, Dave, for your response.

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?

Thanks,
Sean

well without the signatures for STUDENT, TEACHER and SETNAME I don’t have enough information to offer a suggestion.

I ASSUME (since you weren’t specific) that the error is on the line

 t.SetName(FirstNameField.Text, LastNameField.Text)

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.

You are talking about Introduction to Programming with Xojo.pdf ?

So, the provided code (above) comes from page … ?

Page 318 of 363 ?

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:

http://www.xojo.com/learn

Paul:

my download pdf file dates from August 29th, 2016 (9:34) and its front cover says… Spring 2014.

I do not know from where it comes.

It is stored in a folder with data I took from developer.xojo (the three Migrating From pdfs, etc.)

Sean:
I just finished to create the project: it works “fine”. I do not found your error.

Nota: I really had hard time to create the project.

Did you add the two parameters to the SetName Method ?

FName as String , LName as String

Here’s the SetName Method:

Sub SetName(FName as String, LName as String) FirstName = FName LastName = LName End Sub

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 AddButton’s 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 AddButton’s 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!)