Gesbanq : Gestion bancaire (~1986 à 1992) pour Apple IIGS (Version Basic AppleSoft)

0POKE1010,73: POKE1011,9: POKE1012,1721PRINT  CHR$ (4)"BLOAD/GESBANQ/RESET"5PRINT  CHR$ (4)"PR#3"10 VER$ = "8.0"30 N$ =  CHR$ (14):S$ =  CHR$ (24): PRINT N$S$40 I$ =  CHR$ (15):LI$ =  CHR$ (29):D$ =  CHR$ (4)
 41PRINT D$"CLOSE"45GOSUB10020: GOSUB10030: GOSUB1004065  ONERR  GOTO379070PRINT D$"OPEN/GESBANQ/CODE,L10"80PRINT D$"READ/GESBANQ/CODE,R0"90INPUT CC$(0)
 100PRINT D$105POKE216,0106PRINT D$"OPEN/GESBANQ/FICHIER": PRINT D$"READ/GESBANQ/FICHIER": INPUT FI$: PRINT D$"CLOSE/GESBANQ/FICHIER"110PRINT D$"OPEN/GESBANQ/COMPTE/"FI$",L74"120FOR I = 1 TO 5:DO$ = DO$ +  CHR$ ( PEEK (234 + I)): NEXT130 DS$ = DO$
 140POKE6,0: POKE7,0: POKE8,0: POKE9,0: POKE206,0150GOSUB10040155  VTAB 16: GOSUB10320160 OP$ = A$:P =  INT (( VAL ( MID$ (OP$,18,4)) - 1) * 10000 / 1894) / 100:P$ =  STR$ (P): IF P < 1THEN P$ = "0" + P$170  VTAB 24: POKE1403,0: PRINT"COMPTE No " LEFT$ (A$,12);: POKE1403,28: PRINT"DATE SYSTEME :"DO$;: POKE1403,52: PRINT P$"% PLEIN"LI$;: POKE1403,68: PRINT"GESBANQ "VER$;: VTAB 1: PRINT180  VTAB 1: POKE1403,0: PRINT I$" No  DATE    TYPE       OBJET                 CREDIT    DEBIT    CODE      MARQ."N$190 SU =  VAL ( MID$ (OP$,18,4)): VTAB 2195IF SU = 1THEN230200 D = SU - 11:F = SU - 1:VB = 2210IF SU < 12THEN D = 1:VB = 14 - SU
 220GOSUB11090230  VTAB 1: PRINT : POKE1403,0: VTAB 14:SR = ( VAL ( MID$ (OP$,35,13)) + .005) * 100:SR$ =  STR$ ( INT (SR) / 100):SB = ( VAL ( MID$ (OP$,22,13)) + .005) * 100:SB$ =  STR$ ( INT (SB) / 100)
 235 SR =  VAL (SR$):SB =  VAL (SB$)
 240PRINT I$"FICHIER:"N$" "FI$;: POKE1403,25: PRINT I$"SOLDE BANQUE: "SB$N$LI$;: POKE1403,54: PRINT I$"SOLDE REEL: "SR$N$LI$250IFLEN (SR$) < 13THEN SR$ = SR$ + " ": GOTO250260IFLEN (SB$) < 13THEN SB$ = SB$ + " ": GOTO260270 M$(0) = "DEBIT       ":M$(1) = "CREDIT      ":M$(2) = "MARQUAGE    ":M$(3) = "MODIFICATION":M$(4) = "RECHERCHE   ":M$(5) = "LISTING     ":M$(6) = "FICHIER     ":M$(7) = "FIN         "280 P(0) = 0:P(1) = 20:P(2) = 40:P(3) = 60:P(4) = 0:P(5) = 20:P(6) = 40:P(7) = 60290  VTAB 21: PRINT :C =  PEEK (6):CA = 0300  VTAB 21: POKE1403,0: PRINT M$(0);: POKE1403,20: PRINT M$(1);: POKE1403,40: PRINT M$(2);: POKE1403,60: PRINT M$(3): POKE1403,0310  VTAB 22: PRINT M$(4);: POKE1403,20: PRINT M$(5);: POKE1403,40: PRINT M$(6);: POKE1403,60: PRINT M$(7)
 330  VTAB 21 +  INT (C / 4): POKE1403,P(C): PRINT I$M$(C)N$340 CC = 0350GOSUB10000: IF KY = 21THEN  VTAB 21 +  INT (C / 4): POKE1403,P(C): PRINT N$M$(C):C = C + 1 - 8 * (C = 7): GOTO330360IF KY = 1THEN CA = 128:KY = 13: VTAB 21 +  INT (C / 4): POKE1403,P(C): PRINT N$M$(C):C =  PEEK (6): VTAB 21 +  INT (C / 4): POKE1403,P(C): PRINT I$M$(C)N$370IF KY = 18 AND  PEEK (6) < 2THEN CA = 255:KY = 13: VTAB 21 +  INT (C / 4): POKE1403,P(C): PRINT N$M$(C):C =  PEEK (6): VTAB 21 +  INT (C / 4): POKE1403,P(C): PRINT I$M$(C)N$:CC = 2380IF KY = 8THEN  VTAB 21 +  INT (C / 4): POKE1403,P(C): PRINT N$M$(C):C = C - 1 + 8 * (C = 0): GOTO330390IF KY = 32 OR KY = 10 OR KY = 11THEN  VTAB 21 +  INT (C / 4): POKE1403,P(C): PRINT M$(C):C = C + 4 - 8 * (C > 3): GOTO330400IF KY <  > 13THENCALL2355: GOTO350410POKE6,C
 420 A =  FRE (0)
 430ON C + 1GOSUB600,1040,450,3700,2080,2230,3410,3600440GOSUB10010: GOTO290450GOSUB10040: GOSUB10440: GOSUB10040460IF C =  - 1THENRETURN470IFLEN (A$) = 80THEN  VTAB 16: PRINT"LE MARQUAGE A DEJA ETE OPERE SUR CETTE DONNEE": CALL2441: RETURN480  VTAB 19: PRINT I$A$N$490  VTAB 15: PRINT"ENTREZ LA DATE DU MARQUAGE"LI$: GOSUB10110500IF T$ =  CHR$ (27) THENGOSUB10040: RETURN510GOSUB10410:A$(0) = A$:L = I
 520 A$ = A$(0) + " " + DA$: GOSUB10360530 A =  VAL ( MID$ (OP$,22,13)) +  VAL ( MID$ (A$(0),47,8)) +  VAL ( MID$ (A$(0),56,9))
 540 SB$ =  STR$ (A)
 550IFLEN (SB$) < 13THEN SB$ = SB$ + " ": GOTO550560 OP$ =  LEFT$ (OP$,21) + SB$ +  RIGHT$ (OP$,39)
 570 I = 0:A$ = OP$: GOSUB10360: GOSUB10040: VTAB 15: PRINT"MARQUAGE EFFECTUE"LI$580  POP : GOSUB10020: GOTO155600GOSUB10040: IF SU = 1895THEN  VTAB 15: PRINT"PLUS DE PLACE DISPONIBLE.": RETURN610 X$ = "": PRINT D$620 T$ =  STR$ (SU)
 630IFLEN (T$) < 4THEN T$ = T$ + " ": GOTO630640 X$ = T$650GOSUB10110:X$ = X$ + " " + DA$: IF T$ =  CHR$ (27) THENGOSUB10040: RETURN660GOSUB10040: VTAB 15: PRINT"DATE :";DA$670GOSUB10980: IF C <  > 0THEN T$ = PM$(C): GOTO720680IF CA = 255THEN T$ =  STR$ ( VAL (CD$) + 1):CA = 128: GOTO710690POKE1403,0: VTAB 16: PRINT PM$(C)LI$;:VB = 16:HB = 9: GOSUB10050700IF T$ =  CHR$ (27) THENGOSUB10040: RETURN705IFVAL (T$) <  > 0THEN T$ =  RIGHT$ ("0000000" +  STR$ ( VAL (T$)),7)
 710IFLEN (T$) > 8THEN690720IFLEN (T$) < 8THEN T$ = T$ + " ": GOTO720730  VTAB 16: POKE1403,0: PRINT PM$(C)LI$;: IF C = 0THENPRINT"  "T$;
 740 CD$ = T$750 X$ = X$ + " " + T$: PRINT760POKE1403,0: VTAB 17:VB = 17:HB = 26: PRINT"OBJET (25 CARACTS. MAX.)"LI$;: GOSUB10050770IF T$ = "ANNULE"THEN AN = 12775IF T$ =  CHR$ (27) AND CC = 2THEN CD$ =  STR$ ( VAL (CD$) - 1)
 780IF T$ =  CHR$ (27) THENGOSUB10040: RETURN790IFLEN (T$) < 25THEN T$ = T$ + " ": GOTO790800 T$ =  LEFT$ (T$,25)
 810 O$ = T$820 X$ = X$ + " " + T$830IF AN = 12THEN X$ = X$ + " 0        0         ANNULE    " +  MID$ (X$,6,5):AN = 0:C$ = "": GOTO960840POKE1403,0: VTAB 18:VB = 18:HB = 7: PRINT"DEBIT "LI$;: GOSUB10050: IF T$ =  CHR$ (27) AND CC = 2THEN CD$ =  STR$ ( VAL (CD$) - 1)
 845IF T$ =  CHR$ (27) THENGOSUB10040: RETURN850IFVAL (T$) > 0THEN T$ =  STR$ ( -  VAL (T$))
 860IFLEN (T$) < 9THEN T$ = T$ + " ": GOTO860870IFLEN (T$) > 9THEN840880 C$ = T$:T$ = "0        " + T$890 X$ = X$ + " " + T$900POKE1403,0: VTAB 19:VB = 19:HB = 32: PRINT"CODE COMPTA. (9 CARACTS. MAX.)"LI$;: GOSUB10050: IF T$ =  CHR$ (27) AND CC = 2THEN CD$ =  STR$ ( VAL (CD$) - 1)
 905IF T$ =  CHR$ (27) THENGOSUB10040: RETURN910IFLEN (T$) < 9THEN T$ = T$ + " ": GOTO910920IFLEN (T$) > 9THEN900930GOSUB12000940IF T =  - 1THENCALL2441: VTAB 20: PRINT"CODE COMPTA INCORRECT": GOTO900950 X$ = X$ + " " + T$960 A$ = X$:I = SU: GOSUB10360: GOSUB10040970  POP :SU = SU + 1:SU$ =  STR$ (SU)
 980IFLEN (SU$) < 4THEN SU$ = SU$ + " ": GOTO980990 SR =  VAL (SR$):SR = SR +  VAL (C$):SR$ =  STR$ (SR)
 1000IFLEN (SR$) < 13THEN SR$ = SR$ + " ": GOTO10001010 OP$ =  LEFT$ (OP$,17) + SU$ + SB$ + SR$ +  RIGHT$ (OP$,26)
 1020 A$ = OP$:I = 0: GOSUB103601030GOSUB10020: GOTO1501040GOSUB10040: IF SU = 1895THEN  VTAB 15: PRINT"PLUS DE PLACE DISPONIBLE.": RETURN1050 X$ = "": PRINT D$1060 T$ =  STR$ (SU)
 1070IFLEN (T$) < 4THEN T$ = T$ + " ": GOTO10701080 X$ = T$1090GOSUB10110:X$ = X$ + " " + DA$: IF T$ =  CHR$ (27) THENGOSUB10040: RETURN1100GOSUB10040: VTAB 15: PRINT"DATE :"DA$1110GOSUB10980: IF C <  > 0THEN T$ = PM$(C): GOTO11501120IF CA = 255THEN T$ =  STR$ ( VAL (CD$) + 1):CA = 128: GOTO11401130POKE1403,0: VTAB 16: PRINT PM$(C)LI$;:VB = 16:HB = 9: GOSUB10050: IF T$ =  CHR$ (27) THENGOSUB10040: RETURN1140IFLEN (T$) > 8THEN11301150IFLEN (T$) < 8THEN T$ = T$ + " ": GOTO11501160  VTAB 16: POKE1403,0: PRINT PM$(C)LI$;: IF C = 0THENPRINT"  "T$;
 1170 CD$ = T$1180 X$ = X$ + " " + T$: PRINT1190POKE1403,0: VTAB 17:VB = 17:HB = 26: PRINT"OBJET (25 CARACTS. MAX.)"LI$;: GOSUB100501200IF T$ = "ANNULE"THEN AN = 121205IF T$ =  CHR$ (27) AND CC = 2THEN CD$ =  STR$ ( VAL (CD$) - 1)
 1210IF T$ =  CHR$ (27) THENGOSUB10040: RETURN1220IFLEN (T$) < 25THEN T$ = T$ + " ": GOTO12201230 T$ =  LEFT$ (T$,25)
 1240 X$ = X$ + " " + T$1250IF AN = 12THEN X$ = X$ + " 0        0         ANNULE    " +  MID$ (X$,6,5):AN = 0:C$ = "": GOTO13701260POKE1403,0: VTAB 18:VB = 18:HB = 8: PRINT"CREDIT "LI$;: GOSUB10050: IF T$ =  CHR$ (27) AND CC = 2THEN CD$ =  STR$ ( VAL (CD$) - 1)
 1265IF T$ =  CHR$ (27) THENGOSUB10040: RETURN1270IFLEN (T$) < 8THEN T$ = T$ + " ": GOTO12701280IFLEN (T$) > 8THEN12601290 C$ = T$:T$ = T$ + " 0        "1300 X$ = X$ + " " + T$1310POKE1403,0: VTAB 19:VB = 19:HB = 32: PRINT"CODE COMPTA. (9 CARACTS. MAX.)"LI$;: GOSUB10050: IF T$ =  CHR$ (27) AND CC = 2THEN CD$ =  STR$ ( VAL (CD$) - 1)
 1315IF T$ =  CHR$ (27) THENGOSUB10040: RETURN1320IFLEN (T$) < 9THEN T$ = T$ + " ": GOTO13201330IFLEN (T$) > 9THEN13101340GOSUB120001350IF T =  - 1THENCALL2441: VTAB 20: PRINT"CODE COMPTA INCORRECT": GOTO13101360 X$ = X$ + " " + T$1370 A$ = X$:I = SU: GOSUB10360: GOSUB100401380  POP :SU = SU + 1:SU$ =  STR$ (SU)
 1390IFLEN (SU$) < 4THEN SU$ = SU$ + " ": GOTO13901400 SR =  VAL (SR$):SR = SR +  VAL (C$):SR$ =  STR$ (SR)
 1410IFLEN (SR$) < 13THEN SR$ = SR$ + " ": GOTO14101420 OP$ =  LEFT$ (OP$,17) + SU$ + SB$ + SR$ +  RIGHT$ (OP$,26)
 1430 A$ = OP$:I = 0: GOSUB103601440GOSUB10020: GOTO1501450GOSUB10040:XE = 1: GOSUB10440:XE = 0: GOSUB100401460IF C =  - 1THENRETURN1470POKE206,0:CA = 01490 A$ = A$(1): GOSUB103601500  VTAB 19: PRINT I$A$(1)N$LI$: VTAB 15: PRINT LI$: VTAB 18: PRINT LI$1510  VTAB 15: PRINT"QUE VOULEZ-VOUS MODIFIER ?"LI$1520 PM$(0) = "DATE            ":PM$(1) = "TYPE DE PAIEMENT":PM$(2) = "OBJET           ":PM$(4) = "DEBIT           ":PM$(3) = "CREDIT          ":PM$(5) = "CODE COMPTA.    ":PM$(6) = "MARQUAGE        "1530 PM$(7) = "RETOUR MENU     "1540  VTAB 16: POKE1403,0: PRINT PM$(0)LI$;: POKE1403,20: PRINT PM$(1);: POKE1403,40: PRINT PM$(2);: POKE1403,60: PRINT PM$(3)
 1550  VTAB 17: POKE1403,0: PRINT PM$(4)LI$;: POKE1403,20: PRINT PM$(5);: POKE1403,40: PRINT PM$(6);: POKE1403,60: PRINT PM$(7)
 1560 C =  PEEK (206)
 1570  VTAB 16 +  INT (C / 4): POKE1403,(C - 4 * (C > 3)) * 20: PRINT I$PM$(C)N$: VTAB 18: PRINT1580  VTAB 24: POKE1403,28: PRINT"DATE SYSTEME :"DO$;: VTAB 17: PRINT1590GOSUB10000: IF KY = 21THEN  VTAB 16 +  INT (C / 4): POKE1403,(C - 4 * (C > 3)) * 20: PRINT PM$(C):C = C + 1 - 8 * (C = 7): GOTO15701600IF KY = 8THEN  VTAB 16 +  INT (C / 4): POKE1403,(C - 4 * (C > 3)) * 20: PRINT PM$(C):C = C - 1 + 8 * (C = 0): GOTO15701610IF KY = 32 OR KY = 10 OR KY = 11THEN  VTAB 16 +  INT (C / 4): POKE1403,(C - 4 * (C > 3)) * 20: PRINT PM$(C):C = C + 4 - 8 * (C > 3): GOTO15701620IF KY = 27THEN C = 7:KY = 131630IF KY <  > 13THENCALL2355: GOTO15901640POKE206,71650IF C = 6 AND  LEN (A$(1)) < 80THENCALL2441: GOTO14901660IF C <  > 7THEN16901670IF I > SU - 12THEN  POP : GOSUB10020: GOTO1501680  POP : GOSUB10040: GOTO2301690 B(0) = 6:Z(0) = 5:B(1) = 12:Z(1) = 8:B(2) = 21:Z(2) = 25:B(3) = 47:Z(3) = 8:B(4) = 56:Z(4) = 9:B(5) = 66:Z(5) = 9:B(6) = 76:Z(6) = 51700 Z$ =  MID$ (A$(1),B(C),Z(C))
 1710GOSUB10040: VTAB 19: PRINT I$A$(1)N$1720  VTAB 15: PRINT"MODIFICATION DE "I$Z$N$1730IF C = 0THENGOSUB10110:A$(1) =  LEFT$ (A$(1),B(C) - 1) + DA$ +  RIGHT$ (A$(1), LEN (A$(1)) - B(C) - Z(C) + 1)
 1740IF C = 6THEN M = 1: GOSUB10110:A$(1) =  LEFT$ (A$(1),B(C) - 1) + DA$:M = 01750IF (C = 6 OR C = 0) AND T$ =  CHR$ (27) THENGOSUB10040: RETURN1760IF C = 6 AND M$ = "" AND J$ = ""THEN A$(1) =  LEFT$ (A$(1),B(C) - 2):SB =  VAL (SB$) -  VAL ( MID$ (A$(1),47,8)) -  VAL ( MID$ (A$(1),56,9)):T$ = "":SR =  VAL (SR$): GOTO19601770IF C = 6 OR C = 0THEN14901780IF C = 1THENGOSUB10980:T$ = PM$(C):C = 11790IF C <  > 1THEN18401800IFLEN (T$) = 0THEN14901810IF T$ = PM$(0) THEN PM$(1) = T$: GOTO18401820IFLEN (T$) < 8THEN T$ = T$ + " ": GOTO18201830 A$(1) =  LEFT$ (A$(1),B(C) - 1) + T$ +  RIGHT$ (A$(1), LEN (A$(1)) - B(C) - Z(C) + 1): GOTO14901840IF C = 4THEN SR =  VAL (SR$) -  VAL ( MID$ (A$(1),56,9))
 1850IF C = 3THEN SR =  VAL (SR$) -  VAL ( MID$ (A$(1),47,8))
 1860IF C = 4 AND  LEN (A$(1)) >  = 80THEN SB =  VAL (SB$) -  VAL ( MID$ (A$(1),56,9))
 1870IF C = 3 AND  LEN (A$(1)) >  = 80THEN SB =  VAL (SB$) -  VAL ( MID$ (A$(1),47,8))
 1880  VTAB 17: PRINT PM$(C)LI$;:VB = 17:HB =  LEN (PM$(C)) + 2:NU = 1: GOSUB10050:NU = 01890IF T$ =  CHR$ (27) THENGOSUB10040: RETURN1900IFLEN (T$) = 0THEN14901910IFVAL (T$) > 0 AND C = 4THEN T$ =  STR$ ( -  VAL (T$))
 1920IFLEN (T$) > Z(C) THEN18801930IFLEN (T$) < Z(C) THEN T$ = T$ + " ": GOTO19301940IF C <  > 3 AND C >  < 4THEN20301950IFLEN (A$(1)) < 80THEN19801960 SB = SB +  VAL (T$):SB$ =  STR$ (SB): VTAB 14: POKE1403,25: PRINT I$"SOLDE BANQUE: "SB$N$LI$1970IFLEN (SB$) < 13THEN SB$ = SB$ + " ": GOTO19701980 SR = SR +  VAL (T$):SR$ =  STR$ (SR): VTAB 14: POKE1403,54: PRINT I$"SOLDE REEL: "SR$N$LI$1990IFLEN (SR$) < 13THEN SR$ = SR$ + " ": GOTO19902000 OP$ =  LEFT$ (OP$,21) + SB$ + SR$ +  RIGHT$ (OP$,26):A$ = OP$:X = I:I = 02010GOSUB103602020 I = X
 2030IF C <  > 5THEN20602040GOSUB12000: IF T =  - 1THENCALL2441: VTAB 18: PRINT"CODE COMPTA INCORRECT": GOTO18802050IF C = 5 AND  LEN (A$(1)) = 74THEN A$(1) =  LEFT$ (A$(1),B(C) - 1) + T$: GOTO14902060IF C = 6THEN14902070 A$(1) =  LEFT$ (A$(1),B(C) - 1) + T$ +  RIGHT$ (A$(1), LEN (A$(1)) - B(C) - Z(C) + 1): GOTO14902080GOSUB10040:XE = 1: GOSUB10440:XE = 0: GOSUB100402090IF C =  - 1THENRETURN2100 VB = 2:D = I - 10: IF I < 12THEN VB = 13 - I:D = 12110 F = I: GOSUB10020: GOSUB110902120  VTAB 15: PRINT : GOSUB100002130IF KY = 11 AND SU < 12 AND  PEEK (49249) > 127THEN I = SU - 1: GOTO21002140IF KY = 11 AND  PEEK (49249) > 127THEN I = 11: GOTO21002150IF KY = 10 AND  PEEK (49249) > 127THEN I = SU - 1: GOTO21002160IF KY = 10 AND I <  > SU - 1THEN I = I + 1: GOTO21002170IF KY = 11 AND I <  > 1THEN I = I - 1: GOTO21002180IF KY = 27THENRETURN2190IF KY <  > 32 OR I = SU - 1THENCALL2355: GOTO21202200 I = I + 112210IF I >  = SU THEN I = SU - 12220GOTO21002230GOSUB10040:PM$(0) = "IMPRIMANTE ":PM$(1) = "ECRAN      ":C = 02235POKE30, PEEK (48688): POKE31, PEEK (48689)
 2240IF CA = 128THEN C =  PEEK (8): GOTO23102250  VTAB 15: POKE1403,0: PRINT PM$(0);: POKE1403,20: PRINT PM$(1)
 2260  VTAB 15: POKE1403,20 * (C = 1): PRINT I$PM$(C)N$2270GOSUB10000: IF KY = 8 OR KY = 21THEN  VTAB 15: POKE1403,20 * (C = 1): PRINT PM$(C):C = C + 1 - 2 * (C = 1): GOTO22602290IF KY = 27THENGOSUB10040: RETURN2300IF KY <  > 13THENCALL2355: GOTO22602310POKE8,C
 2320POKE1403,0: VTAB 15:CH = C: PRINT"EDITION SUR L'"PM$(C)LI$2330PRINT D$2340  VTAB 16: PRINT"VOULEZ-VOUS UN TRI (O/N)";:VB = 16:HB = 26: GOSUB100502345 T$ =  LEFT$ (T$,1)
 2350IF T$ = "O" OR T$ = "o"THEN26802360IF T$ =  CHR$ (27) THENGOSUB10040: RETURN2370IF T$ <  > "N" AND T$ <  > "n"THEN23402380  VTAB 16: PRINT"ENTREZ LES BORNES DES INTERVALLES"LI$2390  VTAB 17: PRINT"BORNE INFERIEURE  ";:VB = 17:HB = 19: GOSUB100502400IF T$ =  CHR$ (27) THENGOSUB10040: RETURN2410IFVAL (T$) < 1 OR  VAL (T$) >  = SU THEN23902420 BI =  VAL (T$)
 2430  VTAB 18: PRINT"BORNE SUPERIEURE  ";:VB = 18:HB = 19: GOSUB100502440IF T$ =  CHR$ (27) THENGOSUB10040: RETURN2450IFVAL (T$) < 1 OR  VAL (T$) >  = SU THEN24302460IFVAL (T$) < BI THEN24302470 BS =  VAL (T$): GOSUB10040: VTAB 15: PRINT"EDITION SUR L'"PM$(C)LI$2480IF CH = 0THENPOKE48688,0: POKE48689,193: PRINT : PRINT"LISTING DES LIGNES "BI" A "BS" LE :"DS$: PRINT : PRINT2490IF CH = 0THENPRINT"No   DATE    TYPE       OBJET                 CREDIT   DEBIT     CODE      MARQ.": PRINT"---- ----- -------- ------------------------- -------- --------- --------- -----": GOTO25102500 VB = 2: VTAB 1: POKE1403,0: PRINT I$" No  DATE    TYPE       OBJET                 CREDIT    DEBIT    CODE      MARQ."N$2510IF CH = 1THENGOSUB100202520 VB = 22530FOR J = 0 TO BS - BI
 2540IFPEEK ( - 16384) = 155THEN I = BS: GOTO26202550IFINT (J / 11) = J / 11 AND J <  > 0THEN VB = 2: IF CH = 1THEN25702560GOTO26002570GOSUB10000: IF KY = 27THEN J = BS: GOTO26202580IF KY <  > 32THENCALL2355: GOTO25702590GOSUB100202600 I = J + BI: GOSUB104102610  VTAB VB: POKE1403,0: PRINT A$2620 VB = VB + 1: NEXT2630IF CH = 0THENPRINT : PRINT"SOLDE BANQUE : "SB$: PRINT"SOLDE REEL   : "SR$: PRINT : PRINT : PRINT2640IF CH = 1THENGOSUB10000: GOSUB100202650  VTAB 15: POKE48688, PEEK (30): POKE48689, PEEK (31)
 2660PRINT : GOSUB100402670  POP : GOTO1802680 T$(0) = "N. DE CHEQUE":T$(1) = "CB.         ":T$(2) = "CODE COMPTA.":T$(3) = "NON DEBITE  ":C = 02690  VTAB 16: PRINT"TRI SUR QUOI ?"LI$2700  VTAB 17: POKE1403,0: PRINT T$(0);: POKE1403,20: PRINT T$(1);: POKE1403,40: PRINT T$(2);: POKE1403,60: PRINT T$(3)
 2710  VTAB 17: POKE1403,C * 20: PRINT I$T$(C)N$2720GOSUB10000: IF KY = 8THEN  VTAB 17: POKE1403,C * 20: PRINT T$(C):C = C - 1 + 4 * (C = 0): GOTO27102730IF KY = 21THEN  VTAB 17: POKE1403,C * 20: PRINT T$(C):C = C + 1 - 4 * (C = 3): GOTO27102740IF KY = 27THENGOSUB10040: RETURN2750IF KY <  > 13THENCALL2355: GOTO27202760 C(0) = 12:C(1) = 12:C(2) = 66:CO = 02770IF C <  > 2THEN28102780GOSUB10040: VTAB 15: PRINT"TOUS LES CODES COMPTA (O/N) ? ";:VB = 15:HB = 31: GOSUB10050:T$ =  LEFT$ (T$,1)
 2790IF T$ = "O" OR T$ = "o"THEN33602795IF T$ =  CHR$ (27) THENGOSUB10040: RETURN2800IF T$ <  > "N" AND T$ <  > "n"THENCALL2355: GOTO27802810IF C = 3 OR C = 1THEN Y$ =  LEFT$ (T$(C),8): GOTO29002820GOSUB100402830 VB = 15:HB = 14: VTAB VB: POKE1403,0: PRINT T$(C)LI$;: GOSUB100502840IF T$ =  CHR$ (27) THENGOSUB10040: RETURN2850IFLEN (T$) < 8 + 1 * (C = 2) THEN T$ = T$ + " ": GOTO28502860IFLEN (T$) > 8 + 1 * (C = 2) THEN28202870IF C = 0THEN29092880GOSUB120002890IF T =  - 1THENCALL2441: VTAB 16: POKE1403,0: PRINT"CODE COMPTA INEXISTANT": GOTO28302895GOTO29092900GOSUB10040: VTAB 16:VB = 16:HB = 43: POKE1403,0: PRINT"A PARTIR DE QUEL NUMERO D'ENREGISTREMENT ?";: GOSUB100502901IF T$ =  CHR$ (27) THENGOSUB10040: RETURN2905IFVAL (T$) = 0 OR  VAL (T$) > SU - 1THEN29002906 T =  VAL (T$)
 2907IF C = 1THEN T$ = Y$2909IF CH = 0THENPOKE48688,0: POKE48689,193: PRINT : PRINT"TRI SUR "T$(C): PRINT"LE :"DS$2910IF CH = 0THENPRINT : PRINT"No   DATE    TYPE       OBJET                 CREDIT   DEBIT     CODE      MARQ.": PRINT"---- ----- -------- ------------------------- -------- --------- --------- -----"2920 CR = 0:DB = 02930IF C = 3THEN31202940 CZ = 2: IF CH = 1THENGOSUB100202950FOR I = T TO SU - 12960IFPEEK ( - 16384) = 155THEN I = SU: GOTO30502970GOSUB10410: IF  MID$ (A$,C(C),8 + 1 * (C = 2)) <  > T$THENNEXT : GOTO30602980IF CH = 0THEN30352990IF CZ <  > 13THEN30303000GOSUB10000: IF KY = 27THEN I = SU: GOTO30503010IF KY <  > 32THEN30003020 CZ = 2: GOSUB100203030  VTAB CZ
 3035PRINT A$:CZ = CZ + 1:CO = CO + 13040 CR = CR +  VAL ( MID$ (A$,47,8)):DB = DB +  VAL ( MID$ (A$,56,9))
 3050NEXT3060IF ZZ = 123THEN ZZ = 0: RETURN3070IF CH = 0 AND CO = 0THENPRINT"AUCUNE DONNEE TROUVEE"3080IF CH = 0THENPRINT : PRINT"CREDIT : "CR: PRINT"DEBIT  : "DB: PRINT"SOLDE  : "CR + DB
 3090POKE48688, PEEK (30): POKE48689, PEEK (31)
 3100  VTAB 16: PRINT : GOSUB100403110RETURN3120 CZ = 2: IF CH = 1THENGOSUB100203130FOR I = T TO SU - 13140IFPEEK ( - 16384) = 155THEN I = SU: GOTO32303150GOSUB10410: IFLEN (A$) > 79THENNEXT : GOTO30703160 CO = CO + 13170IF CH = 0THEN32253180IF CZ <  > 13THEN32203190GOSUB10000: IF KY = 27THEN I = SU: GOTO32303200IF KY <  > 32THEN31903210 CZ = 2: GOSUB100203220  VTAB CZ
 3225PRINT A$:CZ = CZ + 1:CR = CR +  VAL ( MID$ (A$,47,8)):DB = DB +  VAL ( MID$ (A$,56,9)):CO = CO + 13230NEXT3240GOTO30603360IF CH = 0THENPOKE48688,0: POKE48689,193: PRINT : PRINT"LISTING AVEC TRI SUR TOUS LES CODES COMPTA.": PRINT"LE :"DS$3370IF CH = 0THENPRINT : PRINT"No   DATE    TYPE       OBJET                 CREDIT   DEBIT     CODE      MARQ.": PRINT"---- ----- -------- ------------------------- -------- --------- --------- -----"3380 CR = 0:CO = 0:DB = 0: FOR LL = 1 TO  VAL (CC$(0))
 3385 I = LL: GOSUB12100: IF CH = 1THEN  VTAB 16: PRINT LI$3386IF CH = 1THEN  VTAB 15: PRINT LI$"CODE COMPTA : "CC$3390 T$ = CC$:ZZ = 123: GOSUB29403391IFPEEK ( - 16384) = 155THEN LL = 500: GOTO33963392IF CH = 1 AND CO = 0THEN  VTAB 16: PRINT"AUCUNE DONNEE TROUVEE"3395IF CH = 1THENGOSUB10000: IF KY = 27THEN LL = 5003396NEXT3400GOTO30703410GOSUB10040: VTAB 163420  VTAB 16:VB = 16:HB = 16: PRINT"NOM DU FICHIER";: GOSUB100503430IFLEN (T$) > 15THENCALL2355: GOTO34203435IF T$ =  CHR$ (27) THENGOSUB10040: RETURN3440  ONERR  GOTO35903450PRINT D$"UNLOCK/GESBANQ/COMPTE/"T$3460POKE216,03470 FI$ = T$3480PRINT D$"OPEN/GESBANQ/FICHIER"3490PRINT D$"WRITE/GESBANQ/FICHIER": PRINT FI$3500PRINT D$"CLOSE"3510RUN3590CALL2345: POKE216,0: VTAB 18: PRINT"FICHIER NON EXISTANT": CALL23553595GOTO34203600GOSUB100403601POKE1403,0: VTAB 16: PRINT"VOULEZ-VOUS VRAIMENT QUITTER (O/N) ?";: GOSUB10000:T$ =  CHR$ (KY)
 3602IF T$ = "n" OR T$ = "N" OR T$ =  CHR$ (27) THENGOSUB10040: RETURN3604IF T$ <  > "O" AND T$ <  > "o"THENCALL2355: GOTO36013605GOSUB100403610POKE1403,0: VTAB 16: PRINT"VOULEZ-VOUS IMPRIMER L'ETAT (O/N) ?";: GOSUB10000:T$ =  CHR$ (KY)
 3611IF T$ = "n" OR T$ = "N"THEN36303612IF T$ =  CHR$ (27) THENGOSUB10040: RETURN3613IF T$ <  > "O" AND T$ <  > "o"THENCALL2355: GOTO36103615PRINT D$"PRœ1": PRINT"Etat au "DO$
 3616PRINT"FICHIER: "FI$; SPC( 15 -  LEN (FI$));: PRINT"SOLDE BANQUE: "SB$;: PRINT"SOLDE REEL: "SR$3617PRINT D$"PRœ3"3630PRINT D$"CLOSE": HOME
 3635PRINT  CHR$ (4)"BYE"3700GOSUB10040: VTAB 16: PRINT"QUE VOULEZ-VOUS MODIFIER ?"3710 PM$(0) = "DONNEE GESBANQ":PM$(1) = "CODES COMPTA. "3715 C = 03720  VTAB 18: PRINT PM$(0);: POKE1403,20: PRINT PM$(1)
 3730  VTAB 18: POKE1403,C * 20: PRINT I$PM$(C)N$3745GOSUB100003750IF KY = 8 OR KY = 21THEN  VTAB 18: POKE1403,C * 20: PRINT PM$(C):C = C + 1 - 2 * (C = 1): GOTO37303760IF KY = 27THENGOSUB10040: RETURN3770IF KY <  > 13THENCALL2355: GOTO37303780IF C = 0THEN14503790PRINT D$"CLOSE": PRINT D$"RUN/GESBANQ/COMPTA."10000WAIT  - 16384,128,127: POKE  - 16368,0:KY =  PEEK ( - 16384): RETURN10010FOR Z = 21 TO 23: POKE1403,0: VTAB Z: PRINT LI$: NEXT : RETURN10020FOR Z = 2 TO 13: POKE1403,0: VTAB Z: PRINT LI$: NEXT : RETURN10030  VTAB 14: POKE1403,0: PRINT LI$: RETURN10040FOR Z = 15 TO 20: POKE1403,0: VTAB Z: PRINT LI$: NEXT : RETURN10050  VTAB VB: POKE1403,HB - 1: PRINT LI$;
 10060CALL2082,HB,VB - 1,NU
 10070 T$ = "":NU = 010080IFPEEK (26) = 0THEN1010010090FOR KY = 1 TO  PEEK (26):T$ = T$ +  CHR$ ( PEEK (KY + 2472) - 128): NEXT10095IF T$ =  CHR$ (27) THENPOKE1403,HB - 1: VTAB VB: PRINT"==> "LI$: RETURN10100POKE1403,HB - 1: VTAB VB: PRINT"==> "T$LI$: RETURN10110 NU = 1: VTAB 16: POKE1403,0: PRINT"MOIS (2 CARACTS. MAX.)";:VB = 16:HB = 24: GOSUB1005010120IF T$ =  CHR$ (27) THENGOSUB10040: RETURN10140IF T$ = "" AND M <  > 1THEN T$ =  RIGHT$ (DO$,2): GOTO1016510142IF T$ = "" AND  PEEK (49249) < 128THEN T$ =  RIGHT$ (DO$,2): GOTO1016510145IF T$ = ""THEN VB = VB + 1:M$ = "": GOTO1023010150IFVAL (T$) < 1 OR  VAL (T$) > 12THEN1011010155IFLEN (T$) = 2 AND  VAL (T$) < 10THEN T$ =  STR$ ( VAL (T$))
 10160IFLEN (T$) > 2THEN1011010165 M$ = T$: VTAB VB: HTAB HB + 4: PRINT M$LI$10170 NU = 1: VTAB 17: POKE1403,0: PRINT"JOUR (2 CARACTS. MAX.)";:VB = 17:HB = 24: GOSUB1005010180IF T$ =  CHR$ (27) THENGOSUB10040: RETURN10200IF T$ = ""THEN T$ =  LEFT$ (DO$,2): GOTO1023010210IFVAL (T$) < 1 OR  VAL (T$) > 31THEN1017010215IFLEN (T$) = 2 AND  VAL (T$) < 10THEN T$ =  STR$ ( VAL (T$))
 10220IFLEN (T$) > 2THEN1017010230 J$ = T$: VTAB VB: HTAB HB + 4: PRINT J$LI$10240IF J$ = "" AND M$ = ""THEN DA$ = DO$: RETURN10270IFVAL (M$) < 10 AND  LEN (M$) <  > 2THEN M$ = "0" + M$10280IFVAL (J$) < 10 AND  LEN (J$) <  > 2THEN J$ = "0" + J$10290 DA$ = J$ + "/" + M$10300DO$ = DA$10310RETURN10320PRINT D$"READ/GESBANQ/COMPTE/"FI$",R0"10340INPUT A$: PRINT D$10350RETURN10360PRINT D$"WRITE/GESBANQ/COMPTE/"FI$",R"I
 10380IF I <  > 0THENGOSUB1114010390PRINT A$: PRINT D$"FLUSH/GESBANQ/COMPTE/"FI$10400RETURN10410  VTAB 13: PRINT D$"READ/GESBANQ/COMPTE/"FI$",R"I
 10430INPUT A$: PRINT D$: GOTO1112010440 PM$(2) = "TYPE DE PAIEMENT   ":PM$(1) = "DATE               ":PM$(0) = "N. D'ENREGISTREMENT":PM$(3) = "CREDIT/DEBIT       ":PM$(4) = "CODE COMPTA.       "10450 C(2) = 8:C(1) = 5:C(0) = 4:C(4) = 910460 B(2) = 12:B(1) = 6:B(4) = 6610470 Z(2) = 8:Z(1) = 5:Z(4) = 910480IF CA = 128THEN C =  PEEK (7): GOTO1059010490  VTAB 15: POKE1403,0: PRINT"CHOISISSEZ LE MOYEN D'IDENTIFICATION"LI$10500  VTAB 16: PRINT PM$(0);: POKE1403,20: PRINT PM$(1);: POKE1403,40: PRINT PM$(2)
 10510POKE1403,0: PRINT PM$(3);: POKE1403,20: PRINT PM$(4)
 10520 C = 010530  VTAB 16 +  INT (C / 3): POKE1403,20 * (C - 3 * (C > 2)): PRINT I$PM$(C)N$: IF C < 3THENPRINT10540GOSUB10000: IF KY = 21THEN  VTAB 16 +  INT (C / 3): POKE1403,20 * (C - 3 * (C > 2)): PRINT PM$(C):C = C + 1 - 5 * (C = 4): GOTO1053010550IF KY = 8THEN  VTAB 16 +  INT (C / 3): POKE1403,20 * (C - 3 * (C > 2)): PRINT PM$(C):C = C - 1 + 5 * (C = 0): GOTO1053010560IF (KY = 32 OR KY = 10 OR KY = 11) AND C >  < 2THEN  VTAB 16 +  INT (C / 3): POKE1403,20 * (C - 3 * (C > 2)): PRINT PM$(C):C = C + 3 - 6 * (C > 2): GOTO1053010570IF KY = 27THENGOSUB10040: POP : RETURN10580IF KY <  > 13THENCALL2355: GOTO1053010584IF C = 0THEN1059010585GOSUB10040: VTAB 16: POKE1403,0: PRINT"A partir de quel enregistrement ?";:VB = 16:HB = 38: GOSUB1005010586IFVAL (T$) = 0 AND T$ <  > ""THEN1058510587 MAX =  VAL (T$): IF T$ = ""THEN MAX = 110590POKE7,C
 10600  VTAB 16: PRINT LI$: PRINT LI$10610IF C = 2THENGOSUB10980:WX = C:C = 2: IF WX <  > 0THEN T$ = PM$(WX): GOTO1077010620GOSUB1004010630PRINT D$:Z$(2) = "N. DE CHEQUE ":Z$(0) = PM$(0):Z$(4) = "CODE COMPTA."10640 Z$(1) = "DATE "10650IF C = 1THENGOSUB10110: IF T$ <  >  CHR$ (27) THEN T$ = DA$: GOTO1077010660IF C = 1THENGOSUB10040: POP : RETURN10670IF C <  > 3THEN1074010680  VTAB 15: PRINT"(C)REDIT OU (D)EBIT ?": GOSUB1000010690IF KY = 27THENGOSUB10040: POP : RETURN10700IF KY <  > 99 AND KY <  > 100THENCALL2355: GOTO1068010710IF KY = 99THEN Z$(3) = "CREDIT ":B(3) = 47:Z(3) = 810720IF KY = 100THEN Z$(3) = "DEBIT ":B(3) = 56:Z(3) = 910730 C(3) = Z(3): GOSUB1004010740  VTAB 15: PRINT Z$(C);:VB = 15:HB =  LEN (Z$(C)) + 2: GOSUB1005010750IFVAL (T$) > 0 AND C = 3 AND C(3) = 9THEN T$ =  STR$ ( -  VAL (T$))
 10760IF T$ =  CHR$ (27) THENGOSUB10040: POP : RETURN10765IFVAL (T$) <  > 0 AND C = 2THEN T$ =  RIGHT$ ("0000000" +  STR$ ( VAL (T$)),7)
 10770GOSUB10040: POKE1403,0: VTAB 15: PRINT Z$(C)" ==> "T$LI$: PRINT LI$10780IFLEN (T$) > C(C) THEN1061010790IFLEN (T$) < C(C) THEN T$ = T$ + " ": GOTO1079010795IF C <  > 4THEN1080010796 T1$ = "": FOR L = 1 TO  LEN (T$):L1 = 0: IFASC ( MID$ (T$,L,1)) > 96THEN L1 = 3210797 T1$ = T1$ +  CHR$ ( ASC ( MID$ (T$,L,1)) - L1): NEXT10798 T$ = T1$10800IF C = 0 AND ( VAL (T$) >  = SU OR  VAL (T$) < 1) THEN1061010810IF C = 0THEN I =  VAL (T$): GOSUB10410:A$(1) = A$: RETURN10830 I = SU - 1: IF SU = 1THEN1090010840PRINT D$"READ/GESBANQ/COMPTE/"FI$",R"I
 10850INPUT A$: PRINT D$: GOSUB11120: IF  MID$ (A$,B(C),Z(C)) = T$THENGOSUB1091010860  VTAB 17: PRINT A$LI$10870IFPEEK ( - 16384) = 155THENGOSUB10040: POP : RETURN10880 I = I - 1: IF I >  = MAX THEN1084010890PRINT D$10900CALL2441: GOSUB10040: VTAB 15: PRINT"LA DONNEE RECHERCHEE N'A PAS ETE TROUVEE.": POP : RETURN10910IFLEN (A$) >  = 80 AND XE <  > 1THENRETURN10920  VTAB 15: POKE1403,0: PRINT A$: VTAB 17: PRINT LI$: VTAB 1610925 M$ = T$10930PRINT"Est-ce la bonne fiche (O/N)";:VB = 16:HB = 29: GOSUB1005010935IF T$ =  CHR$ (27) THENGOSUB10040: POP : POP : RETURN10936 T$ =  LEFT$ (T$,1)
 10940IF T$ = "N" OR T$ = "n"THENGOSUB10040:T$ = M$: VTAB 15: PRINT Z$(C)"==> "T$LI$: RETURN10950IF T$ <  > "O" AND T$ <  > "o"THENCALL2355: GOTO1092010970 A$(1) = A$: POP : RETURN10980POKE1403,0: VTAB 16: PRINT"TYPE DE PAIEMENT"10990 PM$(0) = "CHEQUE ":PM$(1) = "CB.    ":PM$(2) = "PREL.  ":PM$(3) = "VIR.   ":PM$(4) = "AUTRE  "11000IF CA <  > 0THEN C =  PEEK (9): GOTO1108011010 C = 0: PRINT I$PM$(0)N$;: POKE1403,18: PRINT PM$(1);: POKE1403,36: PRINT PM$(2);: POKE1403,54: PRINT PM$(3);: POKE1403,72: PRINT PM$(4)
 11020  VTAB 17: POKE1403,18 * C: PRINT I$PM$(C)N$11030GOSUB1000011040IF KY = 21THEN  VTAB 17: POKE1403,18 * C: PRINT N$PM$(C):C = C + 1 - 5 * (C = 4): GOTO1102011050IF KY = 8THEN  VTAB 17: POKE1403,18 * C: PRINT N$PM$(C):C = C - 1 + 5 * (C = 0): GOTO1102011060IF KY = 27THEN C =  - 1: POP : GOSUB10040: RETURN11070IF KY <  > 13THENCALL2355: GOTO1103011080POKE9,C: VTAB 17: POKE1403,0: PRINT LI$: RETURN11090FOR Z = D TO F
 11095  VTAB 2311100PRINT D$"READ/GESBANQ/COMPTE/"FI$",R"Z: INPUT A$: GOSUB11120: VTAB Z - D + VB: PRINT A$: NEXT11110  VTAB 23: PRINT D$: RETURN11120 B$ =  LEFT$ (A$,4) + " " +  MID$ (A$,5,5) + " " +  MID$ (A$,10,8) + " " +  MID$ (A$,18,25) + " " +  MID$ (A$,43,8) + " " +  MID$ (A$,51,9) + " " +  MID$ (A$,60,9): IFLEN (A$) = 73THEN B$ = B$ + " " +  RIGHT$ (A$,5)
 11130 A$ = B$: RETURN11140 B$ =  LEFT$ (A$,4) +  MID$ (A$,6,5) +  MID$ (A$,12,8) +  MID$ (A$,21,25) +  MID$ (A$,47,8) +  MID$ (A$,56,9) +  MID$ (A$,66,9): IFLEN (A$) = 80THEN B$ = B$ +  RIGHT$ (A$,5)
 11150 A$ = B$: RETURN12000 IN = 1:SI =  VAL (CC$(0)):T = 012002 T1$ = "": FOR L = 1 TO  LEN (T$):L1 = 0: IFASC ( MID$ (T$,L,1)) > 96THEN L1 = 3212003 T1$ = T1$ +  CHR$ ( ASC ( MID$ (T$,L,1)) - L1): NEXT12010IF IN > SI THEN T =  - 1: RETURN12020 MI =  INT ((IN + SI) / 2)
 12030PRINT D$"READ/GESBANQ/CODE,R"MI: INPUT CC$: PRINT D$12040IF T1$ = CC$THEN T$ = T1$: RETURN12050IF T1$ < CC$THEN SI = MI - 1: GOTO1201012060IF T1$ > CC$THEN IN = MI + 1: GOTO1201012100PRINT D$"READ/GESBANQ/CODE,R"I
 12120INPUT CC$: PRINT D$12130RETURN50010 D$ =  CHR$ (4)
 50020PRINT D$"open ges1"50030PRINT D$"write ges1"50040  LIST
 50050PRINT D$"close": END