Support

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?

For general discussion related FlowStone

Bug found? How to fix it?

Postby MarvinMeller » Thu Nov 07, 2013 5:57 pm

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 :P 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?

Postby MyCo » Thu Nov 07, 2013 6:47 pm

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:

Code: Select all
def event i,v,t
  if i == "trigger"
    ...
  end
end
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Bug found? How to fix it?

Postby MarvinMeller » Sat Nov 09, 2013 8:56 pm

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 :P
MarvinMeller
 
Posts: 3
Joined: Thu Nov 07, 2013 5:46 pm


Return to General

Who is online

Users browsing this forum: No registered users and 67 guests