FB II COMPILER
Take care of FB's constants
I just found out the hard way not to depend on the constants in FB being the same as the constants in Think Reference (and presumably in Inside Mac). I was assigning a data handle to a window pointer. Think Reference said that the offset was 130 or so and the constant was _dataHandle. So I tried using this:
theWindow&.dataHandle&=myHandle&
Trouble is, this kept crashing the whole system any time I tried to run my test program twice in a row. After a lot of fiddling around it finally occurred to me to check the constants with the constants tool. Turns out, I should have written:
theWindow&.wDataHandle&=myHandle&
That little w makes all the difference. Turns out that the constant _dataHandle has a value of 1100 or so and _wDataHanle has the correct value.
Just thought I'd share this in case anyone runs into a similar problem, so you know what to do.
|