And a few more PROC commands for the die-hards: (I love them ! (sorry Wally !!) (from memory - I think I got it OK) BTW: H = "Hollerith" O=Output literal display text that follows Sn -set input buffer position to n (no blanks allowed in most flavours - a bit like var<-1>="xx") IP: - Input (key data) at current input buffer position with a colon prompt IP %1 input (key data) into input buffer position 1
%n - input buffer position n #n - output buffer position n &m.n - file buffer m, attribute n - attribute 0 is the ID !n - Select buffer n M - a "mark" cann be used to go FORWARD (G F) or BACKWARD (G B) to previous or next mark (bad practice - but you can do it) C - a comment RI / RO - reset input or output buffer F-CLEAR n - clear file buffer n F-OPEN n - open file buffer n to the specified file - if the open fails the next statement is executed otherwise it skips one statement F-READ n - reads specified record into file buffer n - if the read fails the next statement is executed otherwise it skips one statement STON - stack on X - exit with message MV x y- move into buffer x as specified in y (buffer or literal) F;%1;C1;+;?%1 - example of RPN math - adding one to input buffer 1 in this example: e.g. PUSH %1; PUSH character 1; ADD top two stack entries - POPPING them and PUSHING the result on the stack; Store the top stack entry in %1 IF- (test) - accepts one imperative and no ELSE. Multivalued lists of conditions and simple actions allowed T - (type a literal or buffer) - he optional "Sn" displays n spaces, a B displays a BELL, a + inhibits CRLF at the end of a display, a comma is concatenate. PQN C Proc to test file pointers to see if they work and do count F and DIR pointers. C C %1 holds count of files selected, %2 holds count of good file pointers C %3 holds count of bad file pointers, %4 folds count of "F" pointers C %5 holds count of DIR pointers, %6 is a work variable for the current file name being processed C C Not run to check - so please be gentle on typos etc - just an example of power C if you want you can count multi-level files as well and say how many sub-files in each one as an exercise (if you want to !) C T "Starting file pointer verify at ",+ HDATE P RI RO F-CLEAR 1 F-OPEN 1 VOC XBad Account - can't open VOC file MV %1 "0" MV %2 "0" MV %3 "0" MV %4 "0" MV %5 "0" HSSELECT VOC WITH F1 = "F" "f" "DIR" "dir" STON HPQ-SELECT 1 PH 10 MV %6 !1 IF # %6 G 30 F-READ 1 %6 G 20 IF &2.1 = F^253f^253DIR^253dir G 15^25315^25317^25317 G F 15 F;%4;C1;+;?%4 G F 17 F;%5;C1;+;?%5 M F;%1;C1;+;?%1 F-CLEAR 2 F-OPEN 2 %6 G 20 F;%2;C1;+,?%2 G 10 20 F;%3,C1,+,?%3 T "File ,"%6," failed to open !",B G 10 30 T S1 T "Run complete at ",+ HDATE P T "Checked ",%1," files: ",%2," good pointers and ", %3," bad pointers" T %4," hashed files, ",%5," Directory files." Regards JayJay ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
