Another this shouldn't compile problem.
shr00m-dew
Posts: 394
Want to semi-crash a master?
I haven't tested whether it was the code inside the timeline_event using timeline.id that crashed it or not. That code right there might crash it on it's own. Stupid copy/paste mistake dropped the "_timeline" from my timeline events. The master appeared to be working fine, but the entire event table didn't appear to be running.
The help file for timeline ID's states:
Kind of makes sense, but I never saw a runtime error. I'm assuming the compiler doesn't through an error because REBUILD_EVENT could change the timeline.id value. I would assume DEV's are constants and there could be some check if a timeline_event for a constant is used, make sure the constant is valid.
Wasted two hours thinking the TPC ipad app wasn't working right..
Kevin D.
DEFINE_DEVICE test=10128:1:0 DEFINE_CONSTANT long test_timeline=10128 DEFINE_EVENT timeline_event[test] {}
I haven't tested whether it was the code inside the timeline_event using timeline.id that crashed it or not. That code right there might crash it on it's own. Stupid copy/paste mistake dropped the "_timeline" from my timeline events. The master appeared to be working fine, but the entire event table didn't appear to be running.
The help file for timeline ID's states:
The NetLinx compiler will not semantic check the type of the timeline ID, and the NetLinx runtime system will attempt to cast the contents of the timeline ID constant, to a long constant. A runtime error will occur if the cast is unsuccessful.
Kind of makes sense, but I never saw a runtime error. I'm assuming the compiler doesn't through an error because REBUILD_EVENT could change the timeline.id value. I would assume DEV's are constants and there could be some check if a timeline_event for a constant is used, make sure the constant is valid.
Wasted two hours thinking the TPC ipad app wasn't working right..
Kevin D.
0
Comments
Be grateful you only wasted two hours. I declared the ID as a variable, and lost the event table. Took me a day to figure that one out. Very frustrating but I won't be making that mistake again.
Paul
Just a shot in the dark but this could be because of the backward compatibility to AXcess where a device definition was an integer value, not a dps. You can still compile devices defined as integer values. Therefore maybe "test" evaluates at compile-time to both 10128 and 10128:1:0. But like I said this is just speculation.