ex.hlp (Topic list)
USING Keyword Example
                        Example                Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
' This example uses the LPRINT USING statement to print a receipt on the
' printer. Note: To run this program, you must have a printer connected to
' LPT1.
 
' To try this example:
' 1. Choose New Project from the File menu
' 2. Copy the code example below to the code window
' 3. Press F5 to run the example
 
 CLS                                   ' Clear the screen
 Total = 0
 LPRINT "Your receipt:"
 LPRINT
 DO
     INPUT "Enter quantity (0 to end): ", Quantity
     IF Quantity = 0 THEN EXIT DO
     INPUT "Item name: ", Item$
     INPUT "Amount: ", Amount
     PRINT
     Amount = Amount * Quantity        ' Calculate subtotal
     Total = Total + Amount
 
     LPRINT USING "###  "; Quantity;   ' Print line of receipt
     LPRINT USING "\                        \"; Item$;
     LPRINT USING "$$######,.##"; Amount
 LOOP
 
 LPRINT                                ' Finish receipt
 LPRINT TAB(12); "Total amount paid: ";
 LPRINT USING "$$#######,.##"; Total