//==============================================================================
//                               Makro G104
// Makro indeksowania osi A w trybie zapętlenia programu
// Parametry:
// P - liczba powtórzeń jeśli zero praca w nieskończoność
// Q - skok indeksowania osi "A"
//==============================================================================
const
INIT_POSITION = 10;  // Indeks przechowujący pozycję wyjściową osi "A"

%
  if not IsArg('Q')  then UserError('Brak argumentu "Q" !');
  if (LoopIteration()=0) then SetVar(INIT_POSITION,PosA);
  SetA((GetArg('Q')*(LoopIteration()+1))+GetVar(INIT_POSITION));
  ExeMove(0);
  if isArg('P') then  GotoLabel('TEST_DONE');
  Return;

:TEST_DONE
  if (GetArg('P')<=LoopIteration()+1) and (GetArg('P')>0) then UserError('Gotowe !');
  Return;


