Solved

How to get the column number calling a ZPL macro?

  • 30 November 2021
  • 2 replies
  • 163 views

Hi,

In a ZPL macro one can get the object number that’s calling the macro as solve with SOSO(1), but how do I get which column that’s calling the ZPL macro?

I want to use the same macro for solving both the Z and the Y position of an object so I don’t need maintain two separate macros.

Regards,

Hans

icon

Best answer by David.Nguyen 30 November 2021, 17:25

View original

2 replies

Thanks a lot, David!

Yes, that solved my problem.

Regards,

Hans

Userlevel 7
Badge +2

Hi Hans,

 

That’s an interesting question. I don’t think a numeric function is readily available for that.

However, you could use the mechanism described in the Help File as Calling a Macro from within a Macro (The Programming Tab > About the ZPL > Calling a Macro from within a Macro).

What I would do is have a common “child” macro, which setups a return value depending on the “parent” macro. I’ve illustrated the concept in my screenshot below:

The “parent” macros are MyMacros_SolveA and MyMacros_SolveB, they both call the “child” macro MyMacros_CommonProcessing. Depending which “parent” macro is called a number 0 or 1 is buffered. The “child” macro reads that buffered number and buffers a different number 1.23 or 4.56 that is finally set as the SOLVERETURN by the “parent” macro. I’ve put SolveA on the Mechanical Semi-Diameter, and SolveB on the Conic. Now, whatever I change in CommonProcessing it will apply to both “parent” macros.

Let me know if this isn’t clear and/or if it helps you.

Take care,

 

David

Reply