PRODUCT : QUATTRO PRO NUMBER : 532 VERSION : ALL OS : PC DOS DATE : April 18, 1991 PAGE : 1/6 TITLE : DELMAKER: DELIMITED OUTPUT MACRO DELMAKER is a macro that lets you create a delimited format file from a range of cells in the current spreadsheet. The delimited formats can be Comma & Quote, Comma Only, or x delimited (where x is any label you specify). How to enter the DELMAKER macro: Before typing the commands listed below, place the following block names in column A, next to the cell addresses listed. Block names needed by DELMAKER: WIDTH B1 HEIGHT B2 ANSWER B3 BLOCKASK B5..B7 DELIMITER B8 WARNABORT B9..B11 COUNTER1 B13 COUNTER2 B14 FILENAME B15 CURRENTNUM B16 CURRENTWIND B17 QUOTES? B18 NUM_TYPE? B19 USE_QUOTES? B20 BLANKS_AS? B21 CELL_TYPE B22 DO_IT B24 WIDTHLOOP B27 HEIGHTLOOP B29 DONE B31 WRITETOFILE B37 DOROW B42 WRITECELL B44 WRITENUMBER B53 SAVEAS B60 VALUETYPE B65 \D B70 BLANKTYPE B75 TYPECELL B80 PRODUCT : QUATTRO PRO NUMBER : 532 VERSION : ALL OS : PC DOS DATE : April 18, 1991 PAGE : 2/6 TITLE : DELMAKER: DELIMITED OUTPUT MACRO Note that some block names point to more than one cell. These block names must be created using . After you have entered all block name in column A, choose , type A1..A80 and press . This creates all of the block names the macro needs. Some of the macro commands will return ERR after you enter them. This is okay, since some formulas won't evaluate properly until you run the macro. After you enter the block names, enter the macro commands listed at the end of this document into a spreadsheet in the cell addresses indicated. Some macro commands will wrap to the next line, which is okay. Enter the entire command into one cell. After you enter the macro, the spreadsheet must be designated as a macro library file ( ), and saved with the file extension of .WQ1 (for example, DELMAKER.WQ1). The DELMAKER macro: B1: 2 B2: 3 B3: 'Y B5: ^Enter B6: ^Your B7: ^Range B8: ', B9: ^Invalid B10: ^File B11: ^(press ENTER) B16: ' 3 B17: +"["&@CURVALUE("File","Save")&"]_HERBERT" B18: '" B19: 'Numbers B20: (CELL_TYPE = "Value"#AND#NUM_TYPE? = "Labels")#OR#(CELL_TYPE = "Label")#OR#(CELL_TYPE = "Blank"#AND#BLANKS_AS? = "Empty Labels") B21: 'Empty Labels B22: 'Label PRODUCT : QUATTRO PRO NUMBER : 532 VERSION : ALL OS : PC DOS DATE : April 18, 1991 PAGE : 3/6 TITLE : DELMAKER: DELIMITED OUTPUT MACRO B24: '{/ Name;Create}_HERBERT~ B25: '{MESSAGE BLOCKASK,100,100,0}{?}~ B26: '{LET WIDTH,0}{LET HEIGHT,0} B27: '{IF @ISERR(@CELLINDEX("type",[]_HERBERT,WIDTH+1,0))}{LET WIDTH,WIDTH+1}{BRANCH HEIGHTLOOP} B28: '{LET WIDTH,WIDTH+1}{BRANCH WIDTHLOOP} B29: '{IF @ISERR(@CELLINDEX("type",[]_HERBERT,0,HEIGHT+1}{LET HEIGHT,HEIGHT+1}{BRANCH DONE} B30: '{LET HEIGHT,HEIGHT+1}{BRANCH HEIGHTLOOP} B31: '{GETLABEL "Enter the filename to print to: ",FILENAME} B32: '{LET ANSWER,"Y"} B33: '{IF @FILEEXISTS(FILENAME)}{GETLABEL "Overwrite Old File? (Y/N): ",ANSWER} B34: '{IF @LEFT(@UPPER(ANSWER),1)="Y"}{BRANCH WriteToFile} B35: '{CLOSE FILENAME}{BRANCH DONE} B37: '{OPEN FILENAME,W}{BEEP 2}{MESSAGE WARNABORT,0,0,0}{BRANCH DONE} B38: '{FOR COUNTER1,0,HEIGHT-1,1,DoRow} B39: '{CLOSE FILENAME} B40: '{MENUBRANCH SaveAs} B42: '{FOR counter2,0,WIDTH-1,1,WriteCell} B44: '{TypeCell}{IF USE_QUOTES?}{WRITE QUOTES?} B45: '{IF CELL_TYPE="Label"}{WRITE @CELLINDEX("contents",[]_HERBERT,counter2,counter1)} B46: '{IF BLANKS_AS?="Zeros" #AND# CELL_TYPE="Blank"}{WRITE "0"} B47: '{IF CELL_TYPE="Value"}{CALC}{WriteNumber} B48: '{IF USE_QUOTES?}{WRITE QUOTES?} B49: '{IF counter2=WIDTH-1}{WRITELN ""}{BEEP 1} B50: '{IF counter2