New compiler features
jprovan
Posts: 16
I am a programmer from the business world. I am used to writing C and C++ code. There are a features to the NetLinx compiler/interpreter that I think are lacking.
There are features that I am sure everyone would like to see.
I would like to see:
1) the ability to pass more complex objects into a DEFINE_FUNCTION. I understand that if it is passed in by value that could be a big issue, but by reference it would not be. When can we expect the ability to use structures with functions ?
2) the ability to RETURN from a function within a WAIT_UNTIL or WAIT
3) Some kind of serialization technique for a resource or lock
I would like this thread to start a dialog of other features that everyone would like to see.
Is the NetLinx compiler being developed further or is everything, on a go-forward basis, relying on Duet ?
There are features that I am sure everyone would like to see.
I would like to see:
1) the ability to pass more complex objects into a DEFINE_FUNCTION. I understand that if it is passed in by value that could be a big issue, but by reference it would not be. When can we expect the ability to use structures with functions ?
2) the ability to RETURN from a function within a WAIT_UNTIL or WAIT
3) Some kind of serialization technique for a resource or lock
I would like this thread to start a dialog of other features that everyone would like to see.
Is the NetLinx compiler being developed further or is everything, on a go-forward basis, relying on Duet ?
0
Comments
you may post your suggestion Here
I'd like returning returning function within waits and wait_until too... but it seems this is the nature of Netlinx Algorithm execution.
Thanks
Thanks again.
You can use structs as params for a function and you can use structs inside functions. The only thing that isn?t legal is to RETURN a struct but that?s easy enough to work around since you can pass the return container in as a param. Here is some sample code demonstrating you can do just about anything you want with structs and functions.
And the output when button 1 is pushed:
I don?t know how that can be accomplished logically. When a wait is encountered, the statements inside the wait are pushed into the wait list/queue (I?m not sure what it?s officially called) and the execution of code is continued at the next line after the wait block. The program itself doesn?t wait so the code will exit the function before the wait can even be checked for expiration. Maybe if you can elaborate on what you?d like to accomplish, someone can post a suggestion.
Are you referring to some sort of Mutex or Semaphore? Netlinx is not mutli-threaded. I?m pretty sure there is separate thread that runs the hardware but the Netlinx code we write runs in one thread. Or are you talking about something else?
HTH
What the orignal poster is refering to is the ability to have a variable assigned to the value returned from a function. The calling block of code essentially pauses while it calculates the value by executing the function. Only once the value has been assigned does the calling block of code procede with its execution.
I too would love to have that added to NetLinx, its a very handy technique.