home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / APPS / DATABASE / LEDGER.ZIP / SKEL.BAS < prev    next >
Encoding:
BASIC Source File  |  1986-02-14  |  1.9 KB  |  66 lines

  1. 10 DEFDBL A-Z
  2. 20 OPEN "test.ldg" FOR OUTPUT AS 1
  3. 30 GOTO 80
  4. 40 INPUT "more";A$
  5. 50 IF A$="Y" GOTO 80
  6. 60 CLOSE#1
  7. 70 SYSTEM
  8. 80 INPUT "year";YEAR
  9. 90 INPUT "month";MONTH
  10. 100 INPUT "day";DAY
  11. 110 INPUT "account";ACCOUNT
  12. 120 INPUT "transaction type";TYPE$
  13. 130 INPUT "transaction number";TNUMB
  14. 140 INPUT "comment";COMMENT$
  15. 150 INPUT "amount";AMOUNT
  16. 160 GOSUB 190
  17. 170 PRINT#1,RECORD$
  18. 180 GOTO 40
  19. 190 REM--***************************************************************
  20. 200 REM--sets up a transaction record from the following
  21. 210 REM-- year:the year, month:the month, day:the day
  22. 220 REM-- account:the account number, comment$:the comment
  23. 230 REM-- type$:the transaction type, tnumb:the transaction number
  24. 240 REM-- amount: the amount
  25. 250 RECORD$=STRING$(59," ")
  26. 260 MID$(RECORD$,1,1)="J"
  27. 270 NUMBER=YEAR
  28. 280 GOSUB 510
  29. 290 MID$(RECORD$,2,2)=MID$(NUMB$,8,2)
  30. 300 NUMBER=MONTH
  31. 310 GOSUB 510
  32. 320 MID$(RECORD$,4,2)=MID$(NUMB$,8,2)
  33. 330 NUMBER=DAY
  34. 340 GOSUB 510
  35. 350 MID$(RECORD$,6,2)=MID$(NUMB$,8,2)
  36. 360 NUMBER=ACCOUNT
  37. 370 GOSUB 510
  38. 380 MID$(RECORD$,8,5)=MID$(NUMB$,5,5)
  39. 390 IF LEN(TYPE$)>0 GOTO 410
  40. 400 TYPE$=" "
  41. 410 MID$(RECORD$,15,1)=MID$(TYPE$,1,1)
  42. 420 NUMBER=TNUMB
  43. 430 GOSUB 510
  44. 440 MID$(RECORD$,16,5)=MID$(NUMB$,5,5)
  45. 450 MID$(RECORD$,21,25)=COMMENT$
  46. 460 NUMBER=AMOUNT
  47. 470 GOSUB 510
  48. 480 MID$(RECORD$,49,11)=NUMB$
  49. 490 RETURN
  50. 500 REM--***************************************************************
  51. 510 REM--converts "number" to "numb$", with leading zeros and sign
  52. 520 N1=INT(NUMBER*100)
  53. 530 T$=STR$(N1)
  54. 540 NUMB$="00000000000"
  55. 550 MID$(NUMB$,12-LEN(T$))=T$
  56. 560 IF MID$(NUMB$,12-LEN(T$),1)=" " GOTO 590
  57. 570 MID$(NUMB$,1)="-"
  58. 580 GOTO 600
  59. 590 MID$(NUMB$,1)="+"
  60. 600 MID$(NUMB$,12-LEN(T$))="0"
  61. 610 RETURN
  62. 620 REM--***************************************************************
  63. ,1)="+"
  64. 600 MID$(NUMB$,12-LEN(T$))="0"
  65. 610 RETURN
  66. 620 REM--*********************************