Take a look at the following bit of code:
[VarDef, A, ""] [RoutineCall, GetActiveLayer, A][Note, [StrMerge, "A", A]]
[Note, [StrMerge, "Restored Current Tool ", currentTool]]
[IClick, Layer:Clear]
[IPress, Stroke:DragDot]
[CanvasClick, x, y]
[TransformSet, x, y, z, xs, ys, zs, xRot, yRot, zRot]
[IPress, Transform:Edit]
[VarDef, B, ""] [RoutineCall, GetActiveLayer, B][Note, [StrMerge, "B", B]]
The first line is a debug statement to ensure that the active layer at that point is layer 1.
The next few lines do things to layer 1 (supposedly).
The final line is to confirm the active layer is still layer 1.
The problems are:
-
The first debug line indicates that the active layer is in fact layer 1; but the second debug indicates it has been changed to layer 3, even though none of the intermediate instructions should have caused a layer change.
-
The Layer:Clear command has no effect on any layer.
-
The CanvasClick command does, however, draw correctly on layer 1.
-
After execution, the active layer is in fact layer 3. If I remove the lines after and including the Layer:Clear command, the active layer is left at layer 1. In other words, I’m pretty sure that my get active layer routine is functioning correctly.
So I don’t know what the heck is going on. Any insights?
Thanks,
Ken
