|
|
DataMuseum.dkPresents historical artifacts from the history of: RegneCentralen RC759 "Piccoline" |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RegneCentralen RC759 "Piccoline" Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 2753 (0xac1)
Types: TextFile
Names: »MY_REP.TXT«
└─⟦6a1b9f2c5⟧ Bits:30005310/disk3.imd Open Access II v2.10 (dansk)
└─⟦this⟧ »MY_REP.TXT«
!=================================================================ø
! my_rep: prints out summary report to the console. ø
! By replacing PUT's with OUT's, and activating ø
! a printer, this could also print to a printer. ø
! Note the complex conditions used in some of the ø
! IF-ELSE statements, the 'nesting' of loops, ø
! and the use of special clauses (eg VEIL, GROUPING ...)ø
! in PUTS, and the VIEW which relationally joins ø
! two database files and uses fields from both. ø
!=================================================================ø
VIEW summary = FROM orders,products SELECT prodno,quantity,total,descrip ØØ
WHERE orders.prodno = products.prodno ORDER prodno
USE summary
line = 1
FIND summary TOP
continue = TRUE
g_total = 0
!OUTPUT HEADER
PUT AT 1,line MODE PROMPT 'PRODUCT'
PUT AT 30,line MODE PROMPT 'QUANTITY'
PUT AT 62,line MODE PROMPT 'TOTAL IN $'
PUT MODE NORMAL
line = 2
!=================== MAIN LOOP: FOR EACH DIFFERENT PRODUCT ==============
WHILE continue
cur_pn = summary.prodno
cur_quant = 0
cur_total = 0
cur_desc = summary.descrip
!---------------- FOR EACH ORDER FOR THE SAME PRODUCT ------
WHILE cur_pn = summary.prodno AND RECNO(summary) > 0
cur_quant = cur_quant + summary.quantity
cur_total = cur_total + summary.total
FIND summary NEXT
END WHILE
!--------------------------------------------------------
g_total = cur_total + g_total
!PRINT OUT SUMMARY FOR EACH PRODUCT
PUT AT 1,line cur_desc
PUT AT 30,line cur_quant PRECISION 0 WIDTH 5 RIGHT
PUT AT 60,line cur_total PRECISION 2 GROUPING WIDTH 12 RIGHT
!ALLOW USER TO QUIT EVERY 10 LINES UNLESS ON LAST LINE
line = line + 1
IF line MOD 10 = 0 AND RECNO(summary) > 0
message = ''
DO my_veri
IF NOT do_it
continue = FALSE
END IF
END IF
!IF NO MORE RECORDS, THEN QUIT
IF RECNO(summary) <= 0
continue = FALSE
END IF
END WHILE
!======================================================================
!PRINT OUT SUMMARY LINE
PUT AT 20,line + 1 MODE TITLE 'TOTAL OF ALL ORDERS LISTED IS '
PUT g_total VEIL '$______________' GROUPING PRECISION 2
b = TRUE ; GET b !pause
USE summary END
!____________________________________________________________________________