Category : BASIC Source Code
Archive   : MGLOBAL2.ZIP
Filename : MGLOBAL.BAS
'made by George Jones
'''''''''''''''''''''
DECLARE SUB Bottom (Text$)
DECLARE SUB Center (Down%, Text$)
DECLARE SUB DatInput ()
DECLARE SUB EditOvl ()
DECLARE SUB Frame (Row%, LRow%, Col%, Wide%, Style%)
DECLARE SUB HelpFile ()
DECLARE SUB IBMProPrinter ()
DECLARE SUB KeyPress (Edit$)
DECLARE SUB Logon ()
DECLARE SUB MenuScrn ()
DECLARE SUB PrintMenuScrn ()
DECLARE SUB Spot (Down%, Over%)
DECLARE SUB SummaryPrn ()
DECLARE SUB TransPrintScrn ()
DECLARE SUB TransPrint ()
DECLARE SUB Upper (Text$)
DECLARE SUB ZZZDelete ()
DECLARE FUNCTION GetKey% ()
TYPE BondRecord
Lot AS STRING * 25
Unit AS STRING * 10
Cost AS STRING * 10
Day AS STRING * 12
Remk AS STRING * 40
CarrRetn AS STRING * 2
END TYPE
DIM SHARED Easy AS BondRecord
COMMON SHARED CurQuote, TotRec%, rn%, x%, Size%, Help$
CONST ShadColor = 0, PgUp = -&H49, PgDn = -&H51, Esc = 27, CR = 13
CONST Page$ = "MGlobal->", am$ = "$##,###.##", u$ = "#,###.###"
CONST File$ = "c:mglobal.dat", TempFile$ = "c:temp.$A$"
CONST Fund$ = "PAINE WEBBER MASTER GLOABL BONDS"
Logon
ON ERROR GOTO ErrorProc
ON KEY(10) GOSUB EndProgram
KEY(10) ON
Menu:
CLOSE
DO
MenuScrn
DO
SELECT CASE GetKey%
CASE ASC("C")
GOSUB CreateFile
CASE ASC("H")
HelpFile
EXIT DO
CASE ASC("L")
GOSUB SetScreen
CASE ASC("P")
GOSUB PrintOut
CASE ASC("Q")
GOSUB Update
CASE ASC("S")
GOSUB Summary
CASE ASC("@")
ZZZDelete
EXIT DO
CASE ASC("X")
GOSUB EndProgram
CASE ELSE
END SELECT
LOOP
LOOP
CreateFile:
GOSUB OpenFile
rn% = TotRec% + 1
DO WHILE Easy.Lot <> ""
DatInput
x% = 5: COLOR 1, 7
Center 1, "To Exit - Press
COLOR 0, 4: Center 11, "ÌÍÍ Do Not Type Past End of the Highlighted Spaces Í͹"
GOSUB SetColor
PRINT "Enter Cash Purchase, Re-investment of Dividend, etc."
x% = 20: LOCATE x%, 6: COLOR 0, 7: LINE INPUT Easy.Lot
IF Easy.Lot = STRING$(25, " ") THEN
rn% = rn% - 2
GOSUB OpenFile
GOSUB DispRecords
END IF
GOSUB SetColor
PRINT "Enter Units as units.fractions {33.112}"; SPACE$(24)
LOCATE x%, 36: COLOR 0, 7: LINE INPUT Easy.Unit
GOSUB SetColor
PRINT "Enter Cost as 888.99 - {Do Not use Commas [,], or Dollar Sign [$]"
LOCATE x%, 50: COLOR 0, 7: LINE INPUT Easy.Cost
GOSUB SetColor
PRINT "Enter date as Day-Month-Year, ie 12 Jul 90"; SPACE$(27)
Spot 2, 6: COLOR 0, 7: LINE INPUT Easy.Day
GOSUB SetColor
PRINT "This item primarily for planning, tax records, May be left Blank."
LOCATE x%, 20: COLOR 0, 7: LINE INPUT Easy.Remk
Easy.CarrRetn = CHR$(13) + CHR$(10)
PUT #1, rn%, Easy
rn% = rn% + 1
LOOP
SetColor:
LOCATE 13, 8: COLOR 14, 0
RETURN
SetScreen:
COLOR 0, 0, 8: CLS : Upper " V I E W T H E F I L E " + File$
Frame 8, 16, 4, 88, 1
GOSUB OpenFile
Center 8, "ÉÍÍ THE FILE CONTAINS" + STR$(TotRec%) + " RECORDS ÍÍ»"
Center 2, "LIST STARTING AT RECORD NUMBER": INPUT rn%
IF rn% > TotRec% THEN rn% = TotRec%
DispRecords:
COLOR 1, 1, 8: CLS : Cnt% = 1
IF rn% <= 0 THEN rn% = 1
FOR rn% = rn% TO TotRec%
PRINT TAB(73); : COLOR 15, 0: PRINT rn%
GET #1, rn%, Easy
COLOR 15, 1: PRINT TAB(3); "Description: "; : COLOR 0, 7: PRINT Easy.Lot;
COLOR 15, 1: PRINT TAB(42); "Units:"; : COLOR 6, 0: PRINT USING u$; VAL(Easy.Unit);
COLOR 15, 1: PRINT TAB(60); "Cost:"; : COLOR 2, 0: PRINT USING am$; VAL(Easy.Cost)
COLOR 15, 1: PRINT TAB(3); "PurchaseDate:"; : COLOR 1, 7: PRINT Easy.Day;
COLOR 15, 1
PRINT TAB(28); "CURRENT - Quote: "; : COLOR 14, 0: PRINT USING am$; CurQuote;
CurVal = VAL(Easy.Unit) * CurQuote
COLOR 15, 1: PRINT TAB(59); "Value:"; : COLOR 10, 0: PRINT USING am$; CurVal
COLOR 15, 1: PRINT TAB(3); "Remarks::::::"; : COLOR 1, 7: PRINT Easy.Remk;
GLoss = CurVal - VAL(Easy.Cost)
COLOR 15, 1: PRINT TAB(56); "Gain/Loss";
COLOR 0, 7
IF GLoss < 0 THEN COLOR 15, 4
PRINT USING am$; GLoss: COLOR 15, 1
IF Cnt% >= 4 THEN
Cnt% = 1
rn% = rn% + 1
EXIT FOR
END IF
Cnt% = Cnt% + 1
NEXT
x% = 22: COLOR 0, 6
Center 1, "ÌÍÍ
COLOR 15, 4
Center 2, " ®®® Select
IF rn% > TotRec% THEN
COLOR 14, 0: Center 0, "{{ LAST ITEM - PRESS
END IF
DO
SELECT CASE GetKey%
CASE PgDn
GOSUB DispRecords
CASE ASC("E")
GOSUB Editor
CASE PgUp
rn% = rn% - 8
GOSUB DispRecords
CASE Esc
EXIT DO
CASE ELSE
END SELECT
LOOP
RETURN Menu
Editor:
LOCATE 23, 8: COLOR 15, 4: PRINT SPACE$(70)
LOCATE 23, 18: INPUT "ENTER NUMBER FOR RECORDD TO BE EDITED "; rn%
IF rn% > TotRec% OR rn% < 1 THEN rn% = TotRec%
GET #1, rn%, Easy
DatInput
EditOvl
x% = 20: LOCATE x%, 6, 1: COLOR 1, 7: Edit$ = Easy.Lot: CALL KeyPress(Edit$)
IF Edit$ <> "" THEN
LINE INPUT Easy.Lot
IF LEFT$(UCASE$(Easy.Lot), 3) = "ZZZ" THEN
Easy.Lot = "zzz{del}" + LEFT$(Edit$, 18)
PUT #1, rn%, Easy
RETURN DispRecords
END IF
END IF
LOCATE x%, 36: Edit$ = Easy.Unit: CALL KeyPress(Edit$)
IF Edit$ <> "" THEN LINE INPUT Easy.Unit
LOCATE x%, 50: Edit$ = Easy.Cost: CALL KeyPress(Edit$)
IF Edit$ <> "" THEN LINE INPUT Easy.Cost
Spot 2, 6: Edit$ = Easy.Day: CALL KeyPress(Edit$)
IF Edit$ <> "" THEN LINE INPUT Easy.Day
LOCATE x%, 20: Edit$ = Easy.Remk: CALL KeyPress(Edit$)
IF Edit$ <> "" THEN LINE INPUT Easy.Remk
Easy.CarrRetn = CHR$(13) + CHR$(10)
PUT #1, rn%, Easy
RETURN DispRecords
PrintOut:
IF CurQuote = 0 THEN GOSUB Update
PrintMenuScrn
DO
SELECT CASE GetKey%
CASE Esc
RETURN Menu
CASE ASC("S")
SummaryPrn
RETURN Menu
CASE ASC("T")
TransPrint
RETURN Menu
CASE ELSE
END SELECT
LOOP
Summary:
IF CurQuote = 0 THEN GOSUB Update
COLOR 0, 0, 8: CLS : Upper "F U N D S U M M A R Y": Frame 2, 3, 1, 88, 1
LOCATE x%, 3: PRINT "DESCRIPTION"; TAB(30); "UNITS"; TAB(42); "C O S T"
LOCATE x%, 54: PRINT "CUR VALUE"; TAB(68); "GAIN/LOSS"
COLOR 7, 0: Frame 5, 23, 1, 88, 1
GOSUB OpenFile
TotUnt = 0: TotCst = 0: TotVal = 0: TotSGL = 0: Cnt% = 1
x% = 6
FOR rn% = 1 TO TotRec%
DO
GET #1, rn%, Easy
IF LEFT$(Easy.Lot, 8) = "zzz{del}" THEN rn% = rn% + 1
IF rn% > TotRec% THEN EXIT FOR
LOOP WHILE LEFT$(Easy.Lot, 8) = "zzz{del}"
IF Cnt% >= 10 THEN
GOSUB PageAdvan
COLOR 11, 0
FOR x% = 20 TO 5 STEP -1: LOCATE x%, 3: PRINT SPACE$(76); : NEXT
x% = 6: Cnt% = 1
END IF
LOCATE x%, 3: COLOR 11: PRINT Easy.Lot;
LOCATE x%, 26: COLOR 6: PRINT USING u$; VAL(Easy.Unit);
LOCATE x%, 40: COLOR 14: PRINT USING am$; VAL(Easy.Cost);
LotValue = VAL(Easy.Unit) * CurQuote
LOCATE x%, 54: COLOR 10: PRINT USING am$; LotValue;
SGL = LotValue - VAL(Easy.Cost)
LOCATE x%, 68: COLOR 0, 7
IF SGL < 0 THEN COLOR 15, 4
PRINT USING am$; SGL: COLOR 11, 0
TotUnt = TotUnt + VAL(Easy.Unit)
TotCst = TotCst + VAL(Easy.Cost)
TotVal = TotVal + LotValue
TotSGL = TotSGL + SGL
x% = x% + 1: Cnt% = Cnt% + 1
NEXT
Spot 1, 3: COLOR 11, 0: PRINT STRING$(77, 205)
Spot 2, 12: PRINT "TOTALS........";
COLOR 6: PRINT USING u$; TotUnt
LOCATE x%, 40: COLOR 14: PRINT USING am$; TotCst
LOCATE x%, 54: COLOR 10: PRINT USING am$; TotVal
LOCATE x%, 68: COLOR 0, 7
IF TotSGL < 0 THEN COLOR 15, 4
PRINT USING am$; TotSGL
Spot 2, 20: COLOR 11, 0
PRINT "Value is based on Current Quote of "; : PRINT USING am$; CurQuote
ACPU = TotCst / TotUnt
Spot 2, 25: COLOR 0, 2
PRINT "Average Cost Per Unit is "; : PRINT USING am$; ACPU
GOSUB PageAdvan
RETURN Menu
' ======U T I L I T I E S======
PageAdvan:
LOCATE 25, 1: COLOR 14, 5: PRINT STRING$(80, 240);
LOCATE 25, 10: COLOR 15, 1: PRINT "Ý Press
LOCATE 25, 45: COLOR 0, 11: PRINT "Ý Press
DO
SELECT CASE GetKey%
CASE CR
RETURN
CASE Esc
RETURN Menu
END SELECT
LOOP
Update:
COLOR 0, 1, 8: CLS : Upper "PLEASE ENTER CURRENT QUOTE"
Frame 6, 16, 4, 88, 3
Center 5, "A quote is required for screen or printed Summaries"
Center 2, "If you have not entered current
uote, please enter it now"
Center 2, "Current quote is ͯ ": INPUT CurQuote
RETURN Menu
OpenFile:
CLOSE : OPEN File$ FOR RANDOM AS #1 LEN = LEN(Easy)
TotRec% = LOF(1) \ LEN(Easy)
RETURN
ErrorProc:
COLOR 0, 3, 4: CLS : Frame 3, 16, 8, 88, 2
SELECT CASE ERR
CASE 5, 13
Spot 2, 18: PRINT "* * * P R O G R A M M I N G E R R O R * * *"
Spot 2, 18: PRINT "Illegal Function Call or Type Mismatch"
CASE 25, 68, 71
Spot 2, 18: PRINT "* * * D E V I C E E R R O R * * *"
Spot 2, 18: PRINT "PRINTER or DISK DRIVE not ready or Not Available"
CASE 63, 64
Spot 2, 18: PRINT "* * *F I L E or R E C O R D E R R O R * * *"
Spot 2, 18: PRINT "Bad Record Number, OR Bad File Name"
CASE ELSE:
END SELECT
Spot 2, 18: PRINT "* * ERROR NUMBER * * ÉÍÍͯ ";
COLOR 15, 1: PRINT ERR: COLOR 0, 3
Spot 2, 18: LINE INPUT "PressTo Return to MENU....."; anyK$
RESUME Menu
EndProgram:
COLOR 0, 3: SYSTEM
SUB Bottom (Text$)
LOCATE 25, 1: COLOR 14, 5: PRINT STRING$(80, 240);
Text$ = "ÛÜÜ " + Text$ + " ÜÜÛ"
p% = INT((82 - LEN(Text$)) / 2)
LOCATE 25, p%: COLOR 15, 2: PRINT Text$;
END SUB
SUB Center (Down%, Text$)
x% = x% + Down%
p% = INT((82 - LEN(Text$)) / 2)
LOCATE x%, p%: PRINT Text$;
END SUB
SUB DatInput
COLOR 1, 1, 8: CLS : Upper "D A T A I N P U T S C R E E N"
Frame 3, 8, 2, 88, 1: COLOR 15, 1: Frame 11, 23, 4, 88, 1
Spot 16, 63: COLOR 11, 1: PRINT "Record -¯ "; : COLOR 15, 0: PRINT rn%
LOCATE x%, 6: COLOR 15, 4
PRINT "Description for This Lot"; TAB(36); "Num Units"; TAB(50); " Lot Cost"
Spot 2, 6: PRINT "PurchaseDate"; TAB(20); "REMARKS - { Hold, Sell, etc }" + SPACE$(11)
x% = 20: COLOR 14, 1
LOCATE x%, 6: PRINT STRING$(25, 177); TAB(36); STRING$(10, 177); TAB(50); STRING$(10, 177)
Spot 2, 6: PRINT STRING$(12, 177): LOCATE x%, 20: PRINT STRING$(40, 177)
END SUB
SUB EditOvl
Upper "YOU ARE IN EDIT MODE"
x% = 2: Center 1, "´ To Leave an Item Unchanged, PressÃ"
Center 2, " ÚÄ´ To EDIT a Field- PressKey to Enable EDITOR; then ÃÄ¿"
Center 1, " ÀÄ´ type new data - Press- Repeat for each field ÃÄÙ"
COLOR 1, 7
Center 1, "To Delete Record - EDIT in " + CHR$(34) + "ZZZ" + CHR$(34) + " as Description for this Lot"
Center 1, "Enter Dollar Amounts as 9999.88 - Do Not use comma's"
Spot 4, 6: COLOR 14, 0: PRINT Easy.Lot;
LOCATE x%, 25: PRINT USING u$; VAL(Easy.Unit)
LOCATE x%, 40: PRINT USING am$; VAL(Easy.Cost)
Spot 1, 6: PRINT Easy.Day: Spot 1, 6: PRINT Easy.Remk
Spot 6, 6: COLOR 0, 7: PRINT Easy.Lot
LOCATE x%, 36: PRINT USING u$; VAL(Easy.Unit)
LOCATE x%, 49: PRINT USING am$; VAL(Easy.Cost);
Spot 2, 6: PRINT Easy.Day; : LOCATE x%, 20: PRINT Easy.Remk
END SUB
SUB Frame (Row%, LRow%, Col%, Wide%, Style%)
ss% = 80 - (Col% * 2)
IF Wide% > 80 THEN Wide% = ss%
Rw% = Row%: LRw% = LRow%
SELECT CASE Style%
CASE 1, 11
LOCATE Row%, Col%: PRINT CHR$(218); STRING$(Wide%, 196); CHR$(191);
Side% = 179: GOSUB SideLines:
LOCATE Row%, Col%: PRINT CHR$(192); STRING$(Wide%, 196); CHR$(217);
CASE 2, 22
LOCATE Row%, Col%: PRINT CHR$(201); STRING$(Wide%, 205); CHR$(187);
Side% = 186: GOSUB SideLines
LOCATE Row%, Col%: PRINT CHR$(200); STRING$(Wide%, 205); CHR$(188);
CASE 3, 33
LOCATE Row%, Col%: PRINT CHR$(219); STRING$(Wide%, 223); CHR$(219);
Side% = 219: GOSUB SideLines
LOCATE Row%, Col%: PRINT CHR$(219); STRING$(Wide%, 220); CHR$(219);
CASE ELSE
END SELECT
IF Style% > 10 THEN
COLOR ShadColor
FOR Rw% = Rw% + 1 TO LRw% + 1
LOCATE Rw%, Col% + Wide% + 2: PRINT STRING$(2, 219);
NEXT
LOCATE Rw%, Col% + 2: PRINT STRING$(Wide% + 2, 219);
END IF
x% = 3
EXIT SUB
SideLines:
FOR Row% = Row% + 1 TO LRow%: LOCATE Row%, Col%
PRINT CHR$(Side%); SPACE$(Wide%); CHR$(Side%): NEXT
RETURN
END SUB
FUNCTION GetKey%
DO
K$ = UCASE$(INKEY$)
LOOP UNTIL LEN(K$) > 0
IF LEN(K$) = 1 THEN
GetKey% = ASC(K$)
ELSE
GetKey% = -1 * ASC(RIGHT$(K$, 1))
END IF
END FUNCTION
SUB HelpFile
COLOR 0, 3, 0: CLS
DO WHILE Help$ = ""
Frame 3, 4, 12, 88, 1: Center 1, "W O R K I N G"
HelpText = FREEFILE
OPEN "mglobal.hlp" FOR BINARY AS HelpText
Size% = LOF(HelpText)
IF Size% < 10 THEN
LOCATE 10, 30: PRINT "Help File Not Found"
SLEEP (2)
EXIT SUB
END IF
Help$ = STRING$(Size%, 32)
GET HelpText, , Help$
CLOSE HelpText
LOOP
m% = 1
DO
CLS
IF m% <= 0 THEN m% = 1
FOR x% = 1 TO 25: LOCATE x%, 1: PRINT MID$(Help$, m%, 80);
m% = m% + 80
NEXT
DO
SELECT CASE GetKey%
CASE PgDn
EXIT DO
CASE PgUp
m% = m% - 4000
EXIT DO
CASE Esc
EXIT SUB
CASE ELSE
END SELECT
LOOP
IF m% >= Size% THEN m% = Size% - 1999
LOOP
END SUB
SUB IBMProPrinter
COLOR 0, 1, 4: CLS : Upper "Select Print Quality"
COLOR 0, 3: Frame 6, 15, 6, 88, 22
LPRINT CHR$(27); CHR$(88); CHR$(2); CHR$(80);
LPRINT CHR$(27); CHR$(73); CHR$(0);
Center 6, "Pressfor etter Quality Print"
Center 2, "Otherwise pressto continue in Draft Mode"
DO
SELECT CASE GetKey%
CASE CR
EXIT SUB
CASE ASC("L")
EXIT DO
CASE ELSE
END SELECT
LOOP
LPRINT CHR$(27); CHR$(73); CHR$(2);
LPRINT CHR$(27); CHR$(69);
END SUB
SUB KeyPress (Edit$)
x% = CSRLIN
p% = POS(0)
ss% = LEN(Edit$)
LOCATE x%, p%: COLOR 7, 0: PRINT Edit$
LOCATE x%, p%
DO
SELECT CASE GetKey%
CASE CR
COLOR 0, 7: PRINT Edit$
Edit$ = ""
EXIT SUB
CASE Esc
COLOR 15, 4: PRINT SPACE$(ss%)
LOCATE x%, p%, 1
EXIT SUB
CASE ELSE
END SELECT
LOOP
END SUB
SUB Logon
COLOR 1, 4, 8: CLS
COLOR 1, 7: Frame 7, 18, 12, 88, 33
Center 6, Fund$
p% = 26
Spot 2, p%: PRINT "ÛÛÛÛÛÛÛ ÛÛ ÛÛ ÛÛ ÛÛ ÛÛÛÛÛÛ"
Spot 1, p%: PRINT " ÛÛ Û ÛÛ ÛÛ ÛÛÛ ÛÛ ÛÛ ÛÛ "
Spot 1, p%: PRINT " ÛÛ Û ÛÛ ÛÛ ÛÛÛÛ ÛÛ ÛÛ ÛÛ "
Spot 1, p%: PRINT " ÛÛÛÛ ÛÛ ÛÛ ÛÛ ÛÛÛÛ ÛÛ ÛÛ "
Spot 1, p%: PRINT " ÛÛ Û ÛÛ ÛÛ ÛÛ ÛÛÛ ÛÛ ÛÛ "
Spot 1, p%: PRINT " ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ "
Spot 1, p%: PRINT "ÛÛÛÛ ÛÛÛÛÛ ÛÛ ÛÛ ÛÛÛÛÛÛ"
COLOR 11, 4: Center 6, " ® Press any Key ¯ "
Bottom "Copyright 1990 by George A. Jones"
SLEEP (5)
END SUB
SUB MenuScrn
COLOR 0, 3, 8: CLS : Bottom "Version 2.0": COLOR 14, 2: Frame 1, 2, 1, 88, 2
x% = 1: COLOR 0, 2: Center 1, Fund$
COLOR 4, 7: Frame 5, 6, 12, 88, 3: Center 3, " P R O G R A M S E L E C T I O N "
COLOR 1: Frame 9, 20, 6, 88, 33
p% = 10
Spot 8, p%: PRINT "reate Fund File Data"; TAB(42); " uote: Enter Current Quote"
Spot 2, p%: PRINT "ist ®¯ Edit ®¯ Delete"; TAB(42); " ummary of Holdings"
Spot 2, p%: PRINT "elp - See Help Files"; TAB(42); " rint Transactions / Summary"
Spot 2, 28: PRINT "{{ eit The Program }}"
x% = 9: p% = 11: COLOR 14
Spot 2, p%: PRINT "C": LOCATE x%, 43: PRINT "Q"
Spot 2, p%: PRINT "L": LOCATE x%, 43: PRINT "S"
Spot 2, p%: PRINT "H": LOCATE x%, 43, 0: PRINT "P"
Spot 2, 33: PRINT "X"
Frame 18, 19, 14, 88, 1
COLOR 1: Center 16, " SELECT C - H - L - P - Q - S - or - X [ @ ]"
END SUB
SUB PrintMenuScrn
COLOR 1, 1, 8: CLS : Upper "PRINT SELECTION MENU": Frame 4, 14, 4, 88, 3
Center 2, "ummary of Holdings - Current Value"
Center 2, "ransactions - History of Purchases"
Center 2, "ape - Return to Menu - Do Not Print"
COLOR 1, 7: Center 3, "Choose,, or "
END SUB
SUB Spot (Down%, Over%)
x% = x% + Down%: LOCATE x%, Over%
END SUB
SUB SummaryPrn
COLOR 0, 3, 1: CLS
IBMProPrinter
LPRINT CHR$(14); TAB(3); Fund$
LPRINT TAB(26); "Current as of: "; DATE$
LPRINT CHR$(13)
LPRINT STRING$(77, 205)
LPRINT TAB(3); "DESCRIPTION"; TAB(32); "UNITS"; TAB(41); "C O S T";
LPRINT TAB(52); "CURR VALUE"; TAB(66); "GAIN/LOSS"
LPRINT STRING$(77, 205)
LPRINT CHR$(13)
CLOSE : OPEN File$ FOR RANDOM AS #1 LEN = LEN(Easy)
TotRec% = LOF(1) \ LEN(Easy)
TotUnt = 0: TotCst = 0: TotVal = 0: TotSGL = 0
FOR rn% = 1 TO TotRec%
DO
GET #1, rn%, Easy
IF LEFT$(Easy.Lot, 8) = "zzz{del}" THEN rn% = rn% + 1
IF rn% > TotRec% THEN EXIT FOR
LOOP WHILE LEFT$(Easy.Lot, 8) = "zzz{del}"
COLOR 0, 3: PRINT TAB(20); Easy.Lot: PRINT
LPRINT Easy.Lot;
TotUnt = TotUnt + VAL(Easy.Unit)
LPRINT TAB(28); USING u$; VAL(Easy.Unit);
LPRINT TAB(38); USING am$; VAL(Easy.Cost);
LotValue = VAL(Easy.Unit) * CurQuote
SGL = LotValue - VAL(Easy.Cost)
LPRINT TAB(51); USING am$; LotValue;
LPRINT TAB(65); USING am$; SGL: COLOR 0, 7
TotCst = TotCst + VAL(Easy.Cost)
TotVal = TotVal + LotValue
TotSGL = TotSGL + SGL
NEXT
CLOSE
LPRINT CHR$(13)
LPRINT TAB(11); "TOTALS..........."; USING u$; TotUnt;
LPRINT TAB(38); USING am$; TotCst; : LPRINT TAB(51); USING am$; TotVal;
LPRINT TAB(65); USING am$; TotSGL; : LPRINT : LPRINT : LPRINT
LPRINT TAB(18); "Value is based on Current Quote of ";
LPRINT USING am$; CurQuote
LPRINT
ACPU = TotCst / TotUnt
LPRINT TAB(24); "Average Cost Per Unit is "; : LPRINT USING am$; ACPU
LPRINT CHR$(12)
END SUB
SUB TransPrint
CLOSE : OPEN File$ FOR RANDOM AS #1 LEN = LEN(Easy)
TotRec% = LOF(1) \ LEN(Easy)
IBMProPrinter
TransPrintScrn
LOCATE 14, 34: COLOR 4, 7: INPUT rn%: LOCATE 14, 60: INPUT LastNum%
IF LastNum% > TotRec% THEN LastNum% = TotRec%
x% = 15
COLOR 15, 4: Center 1, "You Can Cancel Printing Now by Pressingape"
COLOR 0, 3: Center 2, "DO YOU WANT A HEADING -es o "
DO
SELECT CASE GetKey%
CASE ASC("Y")
LPRINT TAB(4); CHR$(14); Fund$
LPRINT TAB(22); "Record of Purchases as of "; DATE$;
pg = 1
EXIT DO
CASE ASC("N")
x% = 15: COLOR 1, 7
Center 1, "INDICATE STARTING PAGE NUMBER FOR YOUR PRINT-OUT"
Center 2, SPACE$(20) + "STARTING PAGE NUMBER IS": INPUT pg
EXIT DO
CASE Esc
EXIT SUB
CASE ELSE
END SELECT
LOOP
LineCnt% = 53
LPRINT CHR$(10)
DO WHILE rn% < LastNum%
LOCATE 10
IF rn% <= 0 THEN rn% = 1
FOR rn% = rn% TO rn% + 9
IF INKEY$ = CHR$(27) THEN EXIT DO
LineCnt% = LineCnt% - 5
IF rn% > LastNum% THEN EXIT DO
GET #1, rn%, Easy
PRINT TAB(76); : COLOR 15, 0: PRINT rn%; : COLOR 0, 3
PRINT TAB(3); Easy.Lot; TAB(42); Easy.Unit
LPRINT "Descrip: "; Easy.Lot; TAB(36); "Units: "; : LPRINT USING u$; VAL(Easy.Unit);
LPRINT TAB(58); "Cost: "; : LPRINT USING am$; VAL(Easy.Cost);
LPRINT "DatePur: "; : LPRINT Easy.Day;
LPRINT TAB(26); "CURRENT Quote:"; : LPRINT USING am$; CurQuote;
CurVal = VAL(Easy.Unit) * CurQuote
LPRINT TAB(58); "Value:"; : LPRINT USING am$; CurVal
LPRINT "Remarks: "; Easy.Remk;
GLoss = CurVal - VAL(Easy.Cost)
LPRINT TAB(53); "Gain/(Loss)"; : LPRINT USING am$; GLoss
LPRINT CHR$(13)
NEXT
GOSUB PageNumber: pg = pg + 1
LineCnt% = 53
LOOP
IF LineCnt% > 1 THEN
DO
LPRINT
LineCnt% = LineCnt% - 1
LOOP UNTIL LineCnt% < 1
END IF
CLOSE
GOSUB PageNumber
EXIT SUB
PageNumber:
LPRINT CHR$(13)
LPRINT CHR$(27); CHR$(83); CHR$(1);
LPRINT TAB(66); Page$; pg
LPRINT TAB(1); "."
LPRINT CHR$(27); CHR$(84)
PRINT TAB(25); pg; " Pages Sent to Printer"
LPRINT CHR$(12)
RETURN
END SUB
SUB TransPrintScrn
COLOR 0, 1, 8: CLS : Upper " Printer Instructions for " + File$
Frame 3, 19, 4, 88, 1: Center 17, "´ Select Records to Print Ã"
x% = 4: COLOR 0, 2
Center 1, "SIZE OF PRINT FILE IS" + STR$(TotRec%) + " RECORDS"
COLOR 1, 7: Center 2, "ÇÄTHERE WILL BE 10 RECORDS TO EACH PAGEĶ"
Spot 2, 10: COLOR 0, 2: PRINT "RECORDS 1 TO 40 IS FOUR PAGES "
Spot 2, 10: PRINT "RECORDS 41 TO 80 IS EIGHT PAGES, ETC "
COLOR 1, 7: Center 3, "START PRINT AT RECORD [ ] ®¯ END PRINT AT [ ]"
END SUB
SUB Upper (Text$)
LOCATE 1, 1: COLOR 14, 4: PRINT STRING$(80, 196);
Text$ = "´ " + Text$ + " Ã"
p% = INT((82 - LEN(Text$)) / 2)
LOCATE 1, p%: PRINT Text$;
COLOR 0, 7
END SUB
SUB ZZZDelete
COLOR 0, 1, 8: CLS : Upper "REMOVE DELETED RECORDS": Frame 4, 22, 2, 88, 2
COLOR 15, 4: Center 2, "W A R N I N G": COLOR 0, 7
Spot 2, 4
PRINT "This function OVER-WRITES data files. If you have not Backed up DATA"
Spot 1, 4
PRINT "on Separate disk, you may pressKey to abort function. If you elect"
Spot 1, 4
PRINT "to continue, data is copied to a temporary file, removing records tagged"
Spot 1, 4
PRINT "for deletion by EDITOR."
Spot 2, 4: COLOR 1, 7
PRINT "Temporary File is "; TempFile$; " - Current Records will be extracted from"
Spot 1, 4
PRINT File$; " and this file will be over-written with current data."
Spot 2, 4: COLOR 0, 7
PRINT "If named drive is not available, or there is insufficient disk space, THEN"
Spot 1, 4
PRINT "data could be lost."
COLOR 0, 2: Center 3, "Pressto Abort ®®¯¯ Press to Continue"
DO
SELECT CASE GetKey%
CASE CR
EXIT DO
CASE Esc
EXIT SUB
CASE ELSE
END SELECT
LOOP
COLOR 0, 0: CLS : Bottom "Writing Records to " + TempFile$
COLOR 0, 7: Frame 10, 14, 4, 88, 2
Center 9, "EXTRACTING CURRENT RECORDS FROM " + File$
Spot 6, 1: COLOR 0, 3
OPEN "i", 1, File$
OPEN "o", 2, TempFile$
DO WHILE NOT EOF(1)
LINE INPUT #1, n$
IF LEFT$(n$, 7) <> "zzz{del" THEN
PRINT #2, n$
END IF
IF LEFT$(n$, 7) = "zzz{del" THEN
PRINT : PRINT n$: PRINT "Above Record Deleted from File"
END IF
Cnt = Cnt + 1: PRINT Cnt;
LOOP
CLOSE
SLEEP (1)
COLOR 0, 0: CLS : COLOR 1, 7: Frame 6, 12, 10, 88, 3
Center 5, SPACE$(6) + "Copying " + TempFile$ + " to " + File$
Spot 2, 12: SHELL "copy " + TempFile$ + " " + File$
SLEEP (1)
END SUB
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/