call DebugLine_AUTOTAG 'AutoTagging is ' || YorN2OnorOff(AutoTagOn) || '. Have ' || ((AutoTagLast - AutoTagFirst) + 1) || ' tags available in state #' ||AutoTagStateCnt||DbgText1
call DebugLine 'Infinite loop detected, debug forced on for a few loops'
call DebugIncrement 1
call DebugLine InfiniteLoopWhen|| ' loops detected, possible actions:'
call DebugIncrement 1
call DebugLine 'Have have you forgotten to use "#option DefineMacroReplace=ON" somewhere?'
call DebugLine 'Use "/define:INFINITE_MACRO_LOOP_WHEN=0" to turn off detection'
call DebugLine 'Use "/define:INFINITE_MACRO_LOOP_WHEN=1000" to increase detection threshold'
call DebugIncrement-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 DebugOutputVariableInfo_FOUNDVARPARMS 'Parameter not supplied. No default given. Default value stored?'
end
do DefaultIndex=1 to DefaultCnt
if ThisParmName=PrmDefaultName.DefaultIndex then
do
ReplaceParmWith=PrmDefaultValue.DefaultIndex
HaveDefault='Y'
leave
end
end
if OptionDebugOn='Y' then
do
if HaveDefault='N' then
Ans='Oops - not user defined!'
else
Ans='Lucky!'
call DebugOutputVariableInfo_FOUNDVARPARMS Ans
call DebugIncrement-1
end
if HaveDefault='N' then
do
if ThisParmName<> '?' then
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())
if OptionDebugOn='Y' then
call DebugOutputVariableInfo_FOUNDVARPARMS 'This is a special variable, value is all unused parms'
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).'
end
end
if pos('{',ParmLeftBit)<>0 then
do
if pos(StartsMacroParm,ParmLeftBit)<>0 then
CryAndDie('Not all "' || VariableName || '" parameters replaced!')
CryAndDie('No ending quote on field #' || FieldCounter+1 || ' of line #' || ImportFileLine || ', Failed at ' ||DebugRightArrow||CurrentRecord||DebugLeftArrow)
if substr(CurrentRecord,QuotePos+1,1)=FieldQuote then
CryAndDie('Expected delimiter after field #' || FieldCounter || ' of line #' || ImportFileLine || ', Failed at ' ||DebugRightArrow||CurrentRecord||DebugLeftArrow)
CurrentRecord=substr(CurrentRecord,2)
end
end
if FieldCounter>=NumberOfFields then
leave
end
if FieldCounter<NumberOfFields then
do
do while FieldCounter<NumberOfFields
call _AddField2Record ''
end
end
if GenerateRecordFromFields()then
leave
end
if UseCrLfRoutines='Y' then
CloseRc=CrlfClose(FullImportName)
return(ImportFileLine)
_NewRecord:
RecordType=arg(1)
if RecordType='H' then
ThisRecordsCodes=ForHeader
else
ThisRecordsCodes=ForEachRecord
FieldCounter=0
ColumnCounter=0
DroppedCounter=0
NonBlankFieldCounter=0
return
_AddField2Record:
FieldCounter=FieldCounter+1
if FieldHeading.FieldCounter='' then
do
DroppedCounter=DroppedCounter+1
Dropped.DroppedCounter=arg(1)
end
else
do
ColumnCounter=ColumnCounter+1
NewValue=arg(1)
if NewValue='' then
NewValue=RepBlankCol.ColumnCounter
else
NonBlankFieldCounter=NonBlankFieldCounter+1
SaveAsIndex=FieldColumn.FieldCounter
Column.SaveAsIndex=NewValue
end
return
GenerateRecordFromFields:
call DebugIncrement 1
if DropBlankLines='Y' then
do
if NonBlankFieldCounter=0 then
do
call DebugLine_IMPORT 'Dropping record as all fields were blank'
call DebugIncrement-1
return(0)
end
end
if RecordFilter<> '' then
do
if RecordType<> 'H' then
do
Column.0=ColumnCounter
Dropped.0=DroppedCounter
call DebugLine_IMPORT 'Calling specified filter'
call DebugIncrement 1
Remove=''
call ExecRexxCmd RecordFilter
if Remove<> '' then
do
if abbrev(Remove, "EOF:")then
do
call DebugLine_IMPORT 'This Record and all following dropped ==> ' ||Remove
CryAndDie(StartsStdSymbolReplacement_x||substr(RightBit,StartPos+3,(EndPos-StartPos)-3)||EndsMacroReplacement|| ' is not defined (use "#RexxVar =x=" command)!')
if pos(StartsStdSymbolReplacement_x,FileLine)<>0 then
FileLine=ReplaceTheXCodesWeKnowExist(FileLine)
end
end
if TransformCode<> '' then
do
BeforeLine=FileLine
call ExecRexxCmd TransformCode
if OptionDebugOn='Y' then
do
if BeforeLine==FileLine then
call DebugLine 'Line was not transformed'
else
call DebugLine 'Line transformed to ' ||DebugRightArrow||FileLine||DebugLeftArrow
end
end
if LineSrc='M' then
do
LineQueued=LineQueued||FileLine
iterate
end
do until FileLine == ''; parse var FileLine This1 (MarksNewLine) FileLine; if OptionCodeType = 'REXX' then call OutputRexxLine This1; else do; if OptionCodeType <> 'HTML' then call GenerateOneLine This1; else do; call GenerateOneLine This1; end; end; end
end
end
EofForced=''
call IncludeFileClose
if IncludeFragmentText<> '' then
CryAndDie('Did not find the END of the code fragment "' || IncludeFragmentText || '"!')
IncludeLevel=IncludeLevel-1
if OptionDebugOn='Y' then
call DebugLine 'Finished processing the input file'
do until FileLine == ''; parse var FileLine This1 (MarksNewLine) FileLine; if OptionCodeType = 'REXX' then call OutputRexxLine This1; else do; if OptionCodeType <> 'HTML' then call GenerateOneLine This1; else do; call GenerateOneLine This1; end; end; end