and hence the existing entry is not to be reclaimed. There are three possible forms of the last subscript. The first is illustrated by - A$(2,4 TO 8) -, the second by - A$(2)(4 TO 8) - and the third by - A$(2) - which is the default form and indicates that the whole string is required. RST 0018,GET-CHAR Get the present character. CP +29 Is it a ')'? JR Z,2A48,SV-DIM Jump if it is so. CP +2C Is it a ','? JR NZ,2A20,REPORT-3 Report the error if not so. 2A45 SV-SLICE CALL 2A52,SLlCING Use SLICING to modify the set of parameters. 2A48 SV-DIM RST 0020,NEXT-CHAR Fetch the next character. 2A49 SV-SLlCE? CP +28 Is It a '('? JR Z,2A45,SV-SLICE Jump back if there is a 'slice' to be considered. When finished considering the last subscript a return can be made. RES 6,(FLAGS) Signal - string result. RET Return with the parameters of the required string forming a 'last value' on the calculator stack. THE 'SLICING' SUBROUTINE The present string can be sliced using this subroutine. The subroutine is entered with the parameters of the string being present on the top of the calculator stack and in the registers A, B, C, D & E. Initially the SYNTAX/RUN flag is tested and the parameters of the string are fetched only if a line is being executed. 2A52 SLICING CALL 2530,SYNTAX-Z Check the flag. CALL NZ,2BF1,STK-FETCH Take the parameters off the stack in 'run-time'. The possibility of the 'slice' being '()' has to be considered. RST 0020,NEXT-CHAR Get the next character. CP +29 Is it a ')'? JR Z,2AAD,SL-STORE Jump forward if it is so. Before proceeding the registers are manipulated as follows: PUSH DE The 'start' goes on the machine stack. XOR A The A register is cleared PUSH AF and saved. PUSH BC The 'length' is saved briefly. LD DE,+0001 Presume that the 'slice' is to begin with the first character. RST 0018,GET -CHAR Get the first character. POP HL Pass the 'length' to HL. The first parameter of the 'slice' is now evaluated. CP +CC Is the present character a 'TO'? JR Z,2A81,SL-SECOND The first parameter, by default, will be '1' if the jump is taken. POP AF At this stage A is zero. CALL 2ACD,INT-EXP2 BC is made to hold the first parameter. A will hold +FF if there has been an 'out of range' error. PUSH AF Save the value anyway. LD D,B Transfer the first parameter LD E,C to DE. PUSH HL Save the 'length' briefly.