call DBG_AUTOTAG 'AutoTagging is ' || YorN2OnorOff(AutoTagOn) || '. Have ' || ((AutoTagLast - AutoTagFirst) + 1) || ' tags available in state #' ||AutoTagStateCnt||DbgText1
call DBG 'Infinite loop detected, debug forced on for a few loops'
call DBGIND 1
call DBG InfiniteLoopWhen|| ' loops detected, possible actions:'
call DBGIND 1
call DBG 'Have have you forgotten to use "#option DefineMacroReplace=ON" somewhere?'
call DBG 'Use "/define:INFINITE_MACRO_LOOP_WHEN=0" to turn off detection'
call DBG 'Use "/define:INFINITE_MACRO_LOOP_WHEN=1000" to increase detection threshold'
call DBGIND-2
say ''
call DebugStateChanged
end
say ''
if ReplLoop>InfiniteLoopWhen+50 then
CryAndDie("Infinite loop detected (debug turned on above), current line now:", "",HashDefineString)
end
end
ReplLoop=ReplLoop+1
end
if InfiniteLoopDetected='Y' then
CryAndDie("Increase your loop detection value from " || InfiniteLoopWhen || ' with "/define:INFINITE_MACRO_LOOP_WHEN=Value"', "Increase to at least " || ReplLoop || '!')
if pos(StartsStdSymbolReplacement,HashDefineString)<>0 then
call DBG_DEFINING 'No such REXX or PPWIZARD symbol!'
else
call DBG_DEFINING kb!RepType|| ' symbol contained: ' ||kb!RepWith
call DBGIND-1
end
if kb!RepType='' then
do
if kb!MacName=kb!MacNameO then
kb!Show=kb!MacName
else
kb!Show=kb!MacName|| ' <= "' ||kb!MacNameO
CryAndDie("Could not find a REXX variable or PPWIZARD macro matching:", ' ' || kb!M, 'In the macro reference:', ' ' ||kb!Show)
end
kb!MacName=kb!L||kb!RepWith||kb!R
if OptionDebugOn='Y' then
call DBG_DEFINING 'New macro reference is "' ||DebugRightArrow||kb!MacName||DebugLeftArrow
kb!RbPos=pos(MacroIndRight,kb!MacName)
end
if OptionDebugOn='Y' then
call DBGIND-1
end
if pos(MacroIndLeft,kb!MacName)<>0 then
CryAndDie('Could not find a matching "' || MacroIndRight || '" character for "' || MacroIndLeft || '"', 'The invalid macro is:', ' ' ||kb!MacName)
yb!MN=kb!MacName
if CsReplacement='N' then
yb!SA='MACRO?.M?'||c2x(translate(kb!MacName))
else
yb!SA='MACRO?.M?'||c2x(kb!MacName)
if symbol(yb!SA)='VAR' then
return(_valueG(yb!SA))
if arg(1)=yb!MN then
yb!New=''
else
yb!New=' ("' || yb!MN || '")'
CryAndDie('Macro named "' || arg(1) || '"' || yb!New || ' does not exist!',_MacroBitNotFoundText())
_SpecialPrm:
call DebugOutputVariableInfo_FOUNDVARPARMS "This is a special variable, it's value is: " ||arg(1)
return
_DieInvPrm:
CryAndDie('The "' || StartsMacroParm || ThisParmName || EndsMacroParm || '" parameter was not supplied (and there is no default value)', '', 'Did you mean to use "' || HidesMacroParm || ThisParmName || EndsMacroParm || '" to hide the reference?',_MacroBitNotFoundText())
call DebugOutputVariableInfo_FOUNDVARPARMS 'The "' || ParmName.ParmIndex || '" parameter was not referred to by the "' || VariableName || '" macro (either invalid or referenced only in unused default value of another parameter).'
call DBG_IMPORT 'Field information not supplied, reading the first record!'
call DBGIND 1
if lines(FullImportName)=0 then
CryAndDie("Can't extract field information from an empty file!")
bd!Line=ImportOneLine('Y')
ad!L=bd!Line
ad!Del=arg(1)
ad!MinF=0
ad!MaxF=0
ad!FC=0
ad!Q='"'
ad!Q2='""'
do while ad!L<> ''
ad!Fc=ad!Fc+1
if left(ad!L,1)<>ad!Q then
do
ad!DelPos=pos(ad!Del,ad!L)
if ad!DelPos<>0 then
do
ad!F=left(ad!L,ad!DelPos-1)
ad!L=substr(ad!L,ad!DelPos+1)
end
else
do
ad!F=ad!L
ad!L=''
end
end
else
do
ad!LookFrom=2
do forever
ad!QPos=pos(ad!Q,ad!L,ad!LookFrom)
if ad!QPos=0 then
do
if lines(FullImportName)=0 then
do
CryAndDie('Import of line ' || ImportFileLine || ' failed','A record spans more than one line however there are no more lines!',, 'RECORD', '~~~~~~', bd!Line, 'DETECTED AT', '~~~~~~~~~~~',ad!L)
CryAndDie('Import of line ' || ImportFileLine || ' failed','A record spans more than one line however there are no more lines!',, 'RECORD', '~~~~~~', CurrentRecord, 'DETECTED AT', '~~~~~~~~~~~',ad!L)
call DBG_EVALUATE 'Separate key array built and passed by caller - ' ||oe!From
oe!D=oe!KEY.0
oe!K=_valueG(oe!From|| "0")
if oe!D<>oe!K then
CryAndDie("User supplied sort key array does not have correct number of elements!", "The data array has " || oe!D || " elements while the key array has " ||oe!K)
do oe!I=1 to oe!KEY.0
oe!KEY.oe!I=_valueG(oe!From||oe!I)
end
end
else
do
call DBG_EVALUATE 'Separate key array built by translation'
CryAndDie(StartsStdSymbolReplacement_x||substr(RightBit,StartPos+3,(EndPos-StartPos)-3)||EndsMacroReplacement|| ' is not defined (use "#RexxVar =x=" command)!')
parse value IncludeFileOpen(IncludeFileName,ef!ForceLoad2Mem)with IncludeEofLine ';' IncludeMemHandle
if MemUpdateIndex<>0 then
do
_IncludeMemHandle.MemUpdateIndex=IncludeMemHandle
_IncludeEofLine.MemUpdateIndex=IncludeEofLine
end
if IncludeFragmentS<> '' then
do
call DBG 'Looking for the start of the fragment: ' ||IncludeFragmentS
do while IncludeFileLines()<>0
InputLines=InputLines+1
FileLine=IncludeFileLineIn()
if pos(IncludeFragmentS,FileLine)<>0 then
leave
end
if IncludeFileLines()=0 then
do
ef!FR=IncludeFragmentS
ef!FN=IncludeFileName
ef!LP=IncludeLineNumber
IncludeLevel=IncludeLevel-1
if IncludeLevel<>0 then
call RecursiveIncludeRestore
CryAndDie('Did not find the START of the code fragment "' || ef!FR || '" (searched ' || AddCommasToDecimalNumber(ef!LP) || ' lines in "' || ef!FN || '")')
end
call DBG 'Found it'
end
do forever
LastLineAfterMacroRep=''
select
when IncludeLoopMemBufferNextLine\=='' then
do
ef!LC='<<#{'
parse var IncludeLoopMemBufferNextLine FileLine (MarksNewLine) IncludeLoopMemBufferNextLine