; Macro: Clears every Xth row in a range of columns
;
; Clear all Memory Registers
CM
;
; Input Dialog Box:
alpha     "Initial Column to be Cleared"
STOa 0
alpha     "Last Column to be Cleared"
STOa 1
alpha     "Xth Row to Clear"
STOa 2
alpha     "Clear Macro - Multiple Columns"
inpt 3
;
; Storage Locations
; 00 - First column getting cleared
; 01 - Last column getting cleared
; 02 - Xth Row
; 03 - Column Counter
; 04 - Row Counter
; 05 - Number of rows in the data window
; 06 - Row and Column # in decimal form (ex. 9.003 is row 9, col 3)
;
ibase
size     ; Returns the size of the data window
STO 05   ; Stores the number of rows that are in the data window
RCL 00   ; Recall column number
STO 03   ; Set Column Counter
GTO 50   ; Store address in decimal form, set row counter
;
LBL 10
XEQ 20
RCL 01   ; Recall final column value
ISG 03   ; Increment counter by 1, are contents of 03 <= 01
GTO 50   ; Yes - Increase column
STOP     ; No - Stop program
;
LBL 20
XEQ 80   ; Test to see if the last row has been reached
x = y    ; Check to see if current address = # of rows
RTN      ; If data cell is empty go to next column, otherwise continue
RCLi 06  ; Recall data from cell specified in mem. reg. 06
const     0.000000000e+00
DSE 04   ; Decrement counter by 1; Are contents of 02 > 0.0
GTO 40   ; Yes - Increase row number by 1
;
LBL 30
CLRi 06  ; Clear the cell specified in 06
XEQ 60   ; Reset Row Counter
XEQ 70   ; Increase current address
GTO 20
;
LBL 40
XEQ 70   ; Increase current address
GTO 20
;
LBL 50
RCL 03   ; Recall current column
1000
 /       ; Divide column by 1000
STO 06   ; Store column in decimal format
XEQ 60   ; Reset Row Counter
GTO 10
;
LBL 60
RCL 02
STO 04   ; Reset Row Counter
RTN
;
LBL 70
const     1.000000000e+00
ADD 06   ; Increase address by 1
RTN
;
LBL 80
RCL 05   ; Recall the number of rows
RCL 06   ; Recall the current address
int      ; Get the integer portion of the address
RTN      ; Return to the XEQ statement and test 05 = 06
;
; Version 1.2 - August 10, 1993
; by Steve Wilson
