If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
undefined method `*' for nil:NilClass
undefined method `*' for nil:NilClass
So what am I doin wrong here?
NoMethodError: undefined method `*' for nil:NilClass
Code: Select all
rectbounds3=[@width*0.5-@ledw*0.5,@hight*0.5-@ledh*0.5,@ledw,@ledh]
fade3=LinearGradientBrush.new rectbounds3,@c3,@c4,45,true
v.drawRoundRect fade3,rectbounds3,@roundNoMethodError: undefined method `*' for nil:NilClass
Re: undefined method `*' for nil:NilClass
I found if I move the mulitpliers in front of the @ floats like this: 0.5*@hight-0.5*@ledh
I get this error instead: TypeError: (in method 'draw'): nil cant be coerced into Float
And after some googling I learned that in this case it is most likely that @ledh and @ledw is nil. Question is why?
When I edit the values in the green floats outside the code that feed theese two values the error disappears while i write a new value. But the moment i press enter to set the value, the error is back.
I get this error instead: TypeError: (in method 'draw'): nil cant be coerced into Float
And after some googling I learned that in this case it is most likely that @ledh and @ledw is nil. Question is why?
When I edit the values in the green floats outside the code that feed theese two values the error disappears while i write a new value. But the moment i press enter to set the value, the error is back.
- trogluddite
- Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
Re: undefined method `*' for nil:NilClass
tor wrote:@hight
should be
Code: Select all
@heightI do this 50 times a day! If you don't spell a variable right, it counts as undeclared and returns 'nil'.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
Re: undefined method `*' for nil:NilClass
dang... I just could not see it. Checked it over and over and over
THANK YOU TROG
This is probably going to be one of my biggest challenges with a language like Ruby, getting the spelling right.
THANK YOU TROG
This is probably going to be one of my biggest challenges with a language like Ruby, getting the spelling right.