Search found 3 matches

by Sense
Sat Mar 09, 2024 5:48 pm
Forum: Support and Development
Topic: Method doesn't see self variable when called by other method (hump.class)
Replies: 8
Views: 2040

Re: Method doesn't see self variable when called by other method (hump.class)

Many thanks. it works!
I came across this Class library on the Harvard CS50 Gaming course. Is there another one you’d recommend/are using?
by Sense
Sat Mar 09, 2024 3:34 pm
Forum: Support and Development
Topic: Method doesn't see self variable when called by other method (hump.class)
Replies: 8
Views: 2040

Method doesn't see self variable when called by other method (hump.class)

Newbie question. I created a class with hump.class and try to access one of its variables in a method called by another method. The sub-method doesn't see the self. variable (nil). What do I miss? Output of the program below: Var in main 5 Var in sub nil Class = require 'lib/class' MyObject = Class ...