new to crystal can someone pls explain me briefly what each line is doing.
numberVar a ;
stringVar pos2;
a := instr ({RESULT.REPORTED_NAME}, "-Btl ");
if a > 0 then pos2:= Mid ({RESULT.REPORTED_NAME}, a + 5, 1)
else if instr({RESULT.REPORTED_NAME}, "Ster") > 0 then pos2 := '4'
else if instr({RESULT.REPORTED_NAME}, "TSA") > 0 then pos2 := '5'
else if instr({RESULT.REPORTED_NAME}, "PBS") > 0 then pos2 := '6'
else if (instr({RESULT.REPORTED_NAME}, "Received") = 7 or instr({RESULT.REPORTED_NAME}, "Tested") = 7
or instr({RESULT.REPORTED_NAME}, "Read") = 7 or instr({RESULT.REPORTED_NAME}, "Conf") = 7)
then pos2 := '7'
else if instr({RESULT.REPORTED_NAME}, "Gram") > 0 or instr({RESULT.REPORTED_NAME}, "Bact") > 0
then pos2 := '8'
else pos2 := '9';
pos2
numberVar a ;
stringVar pos2;
a := instr ({RESULT.REPORTED_NAME}, "-Btl ");
if a > 0 then pos2:= Mid ({RESULT.REPORTED_NAME}, a + 5, 1)
else if instr({RESULT.REPORTED_NAME}, "Ster") > 0 then pos2 := '4'
else if instr({RESULT.REPORTED_NAME}, "TSA") > 0 then pos2 := '5'
else if instr({RESULT.REPORTED_NAME}, "PBS") > 0 then pos2 := '6'
else if (instr({RESULT.REPORTED_NAME}, "Received") = 7 or instr({RESULT.REPORTED_NAME}, "Tested") = 7
or instr({RESULT.REPORTED_NAME}, "Read") = 7 or instr({RESULT.REPORTED_NAME}, "Conf") = 7)
then pos2 := '7'
else if instr({RESULT.REPORTED_NAME}, "Gram") > 0 or instr({RESULT.REPORTED_NAME}, "Bact") > 0
then pos2 := '8'
else pos2 := '9';
pos2