Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#771 Can't execute private method from class method

v4.0beta
closed
Rick McGuire
5
2012-08-14
2009-07-20
oorexxpert
No

The example under “Public and Private Methods” is exactly what I’m trying to do but I get an error message that the instance method was not found. The instance method does exist and I’m trying to invoke it from a class method of the same class.

I then tried the example in the book:

a = .savings~newcheckingaccount;
::class Savings
::method newCheckingAccount CLASS
instance = .self~new
instance~makeChecking
return instance
::method makeChecking private
expose checking
checking = .true

And I got message:

Error 97 running C:\Documents and Settings\John Bodoh\my documents\IMDB\testrexx.REX line 4: Object method not found
Error 97.1: Object ".SELF" does not understand message "NEW"

Which I don’t understand either.

Can someone explain or is this a bug.

I’m running:

Open Object Rexx Version 4.0.0
Build date: Jun 30 2009
Addressing Mode: 32

Discussion

  • Rick McGuire
    Rick McGuire
    2009-07-20

    I've answered this question twice already on the RexxLA list. The example in the docs had a typo, which has already been corrected. Change ".self" to "self" and the example will work.

     


Anonymous


Cancel   Add attachments