Welcome to %s forums

BrainModular Users Forum

Login Register

Data lenght = -1

Create your own modules in C++
Post Reply
Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 24 May 2009, 15:37

Hi,

when the pass event flow or stop event flow don't output anythng, the lenght of the array is set to [-1].
Why [-1] and not [0]?
and why a module doesn't receive this change of data lenght?
I would like to do a module where if the lenght of the input is >= 1, do something, else do something else.
No matter if I set the lenght of the input = 0 at the end of every process function. But, is it normal? I mean, if a cable is not connected or a "pass" module doesn't pass anything, logically the input data lenght of my module would be automatically set to 0...

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 24 May 2009, 21:37

the -1 length is define in Usine as a NULL_EVT as well as length=0.
it means that, if you receive this event you should do.. nothing...

we choose -1 because some array modules can accept array's with a length = 0.
so you can make a distinction.

Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 26 May 2009, 11:03

Thanks!

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 56 guests