0

I have the following piece of x++ code:

static void Datatypes_class_variable(Args _args)
{
    // Declare a class variable from the RentalInfo class
    RentalInfo   rentalInfo;
    ;
    // An object is created and referenced by the
    // class variable rentalInfo
    rentalInfo = new RentalInfo();
    // Call methods to set/get data to/from the object
    rentalInfo.setCar("BMW 320");
    info(strfmt("The car is a %1", rentalInfo.getCar()));
}

I don't understand why the compiler is throwing me the error:

The RentalInfo variable was not declared.

As you can see, the variable has been already declared at the beginning. Thank you!

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
AlinPaul8806
  • 327
  • 2
  • 15

1 Answers1

0

The type RentalInfo does not exist as a class.

That is why the error is in line 4 column 4.

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50