Re: Simple Arp
Posted: Tue Feb 19, 2019 7:05 pm
The error message tells you that the event method calls another method in which a variable is used to add something to, although that variable is not defined (it's NIL, short for "not in list", Ruby can't find a valid variable definition). Of course, Ruby can only do a + b if both a and b are capable of being added. if a is, say, a range it wouldn't work. And NIL also doesn't support adding.
This happens a lot in FS, because FS tends to send values to a RubyEdit, before the variables are defined. That is less of a Ruby issue, but more of a communication issue between both. I think Maik has changed this in FS 4 by adding a method called "ready" or similar, which you use to not accept incoming values until the RubyEdit is fully initialized. I hacked a similar solution for 3.0.6, but can't find it in my library (too many moves between PCs).
An arp is a complex code. If it's written by another it is even more difficult to understand the other one's thinking (trust me, I know what I'm talking about). Therefore, although I might be able to solve it, I won't touch the arp. It simply is too much effort, and I can't even make good progress with the current tasks I'm working on, so I would additionally disappoint other people when giving this arp priority.
This happens a lot in FS, because FS tends to send values to a RubyEdit, before the variables are defined. That is less of a Ruby issue, but more of a communication issue between both. I think Maik has changed this in FS 4 by adding a method called "ready" or similar, which you use to not accept incoming values until the RubyEdit is fully initialized. I hacked a similar solution for 3.0.6, but can't find it in my library (too many moves between PCs).
An arp is a complex code. If it's written by another it is even more difficult to understand the other one's thinking (trust me, I know what I'm talking about). Therefore, although I might be able to solve it, I won't touch the arp. It simply is too much effort, and I can't even make good progress with the current tasks I'm working on, so I would additionally disappoint other people when giving this arp priority.