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
Bug found? How to fix it?
3 posts
• Page 1 of 1
Bug found? How to fix it?
I dont know why this happens all the time but when Im programming in FlowStone-Ruby it happens that I get this error:
NoMethodError: (in method 'event') undefined method '/' for nil:NilClass
And yes the var is a Number: lty = @ins[16] / 2 - Input 16 is a float. If I reconnect the ruby-comp and paste the EXACTLY same code I dont get the error again
Hope my english is not too bad greetings, Marvin
NoMethodError: (in method 'event') undefined method '/' for nil:NilClass
And yes the var is a Number: lty = @ins[16] / 2 - Input 16 is a float. If I reconnect the ruby-comp and paste the EXACTLY same code I dont get the error again
Hope my english is not too bad greetings, Marvin
- Attachments
-
- mains.fsm
- Thats the File with the error
- (2.55 KiB) Downloaded 766 times
- MarvinMeller
- Posts: 3
- Joined: Thu Nov 07, 2013 5:46 pm
Re: Bug found? How to fix it?
It happens probably because the array @ins is not fully initialized, when the event comes in.
BTW: you don't need all the "xyz = @ins[n]"... when your connectors are named, you can directly access them with their name, eg. @ltx, @lty, @rtx,... also you should think about the triggers that call the event procedure. Right now you execute all the code in event, when any of the input changes. Since you've got a high frequency trigger connected to this, you probably don't want this, and only execute that code, when the trigger comes in. So you can wrap everything in event like this:
BTW: you don't need all the "xyz = @ins[n]"... when your connectors are named, you can directly access them with their name, eg. @ltx, @lty, @rtx,... also you should think about the triggers that call the event procedure. Right now you execute all the code in event, when any of the input changes. Since you've got a high frequency trigger connected to this, you probably don't want this, and only execute that code, when the trigger comes in. So you can wrap everything in event like this:
- Code: Select all
def event i,v,t
if i == "trigger"
...
end
end
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Bug found? How to fix it?
Ok Ill change some things but I need all the stuff in the event... (XBox360 Controller).
But how can I initial @ins correctly?
PS: thanks for the fast answer but wasnt at home
But how can I initial @ins correctly?
PS: thanks for the fast answer but wasnt at home
- MarvinMeller
- Posts: 3
- Joined: Thu Nov 07, 2013 5:46 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 58 guests