Xojo Tutorial - Chapter8: Issue "Too many attributes..."

I am trying to go through tutorial Introduction to Programming with Xojo and at Chapter 8 I have four issues in the code from the tutorial that I cannot adapt to web development.
One is as follows…
Please for advice

EnrollButton pressed Code:

Var theStudent As Student
Var theCourse As Course
Var newRow As String
theStudent = New Student(FirstNameField.Text, LastNameField.Text)
If CourseBox.CellTagAt(CourseBox.SelectedRowIndex, 0) IsA Course Then
theCourse = Course(CourseBox.CellTagAt(CourseBox.SelectedRowIndex, 0))
theCourse.EnrollStudent(theStudent)
newRow = theStudent.LastName + ", "
newRow = newRow + theStudent.FirstName
StudentBox.AddRow(newRow)
End If

Issue:
Too many arguments: got 1, expected only 0
theCourse.EnrollStudent(theStudent)

seems the method EnrollStudent missing the argument st As Student

Thanks Markus,
How can I add argument? only code for method EnrollStudent is:

Self.EnrolledStudents.Add(s)

EnrolledStudents seems to be a list/array of students.
example screenshot.

I have missed to define parameter s As Student.
This solved all four issues that I had with this part of the code :slight_smile:

Thanks a lot @MarkusR

1 Like
Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.