|
Post by honky on Feb 14, 2023 16:38:29 GMT
Good morning, The soft is here--->: libertybasic.fr/forum/topic-668+client-collab.phpThe goal: I would like when; "Save", the software closes and reopens. I tried with a "[ret]" before the three gosub at the begin: gosub [chargeesp] gosub [doubles] gosub [aff] wait
And a: "goto [ret]" after the: "gosub [savo]", In: "[save]". it returns me: "Primitive falled". I also tried with: if opt=1 then opt=0: close #t Close #main goto [reopen]
After the: "gosub [savo]", In: "[save]"; with the: "[reopen]" just after: "nomainwin" And the same: "Primitive faulted". In the debugger, it lights up the line: "dim definitif$(nbcases)" (line 179). Go, courage, there are only 234 lines. And thanks for.
|
|
|
Post by plus on Feb 14, 2023 23:22:01 GMT
What happens if you open the new and then close the old?
|
|
|
Post by Brandon Parker on Feb 15, 2023 0:19:57 GMT
In this case, you would need to open the program programmatically after saving it and before completely closing the original program.
'Pseudocode Steps Call saveProgram Call reopenProgram Call endProgram
{:0)
Brandon Parker
|
|
|
Post by honky on Feb 15, 2023 0:50:12 GMT
@:"plus" and: "Brandon Parker": There is no old and new. if I open before closing, I get: "Handle.main already in use", which makes sense. And if then I close, well it's "bye bye" the program. I used to do this kind of procedure of: close and reopen, and it always worked. I don't understand why it doesn't work for this program.
|
|
|
Post by xxgeek on Feb 15, 2023 4:57:07 GMT
If you run it through the debugger you will see where things go wrong.
It is giving the system primitive error due to dim statements not being redimmed. Once that is fixed, it gives system primitive errors on a couple of variables needing reset because (I believe) they are getting too large.
This code works for #main, and it closes and reopens with the updated text, I tried it. I didn't go any further.
[start] if flag = 1 then nbcases = 0 close #main redim nom$(1000) redim liste$(1000) redim tri$(1000) redim definitif$(500) redim k$(1000) redim tria$(1000) redim defin$(500) redim kk$(1000) nbmots = 0 casevide = 0 end if nomainwin ForegroundColor$ = "Black" BackgroundColor$ = "Buttonface" TextboxColor$ = "Buttonface" WindowWidth = 850: WindowHeight = 560 UpperLeftX = int((DisplayWidth - WindowWidth) / 2) 'Centre la fenêtre horizontalement UpperLeftY = int((DisplayHeight - WindowHeight) / 2) 'Centre la fenêtre verticalement statictext #main.statictext1, "Client", 10, 15, 120, 30 statictext #main.statictext2, "Collab", 200, 15, 90, 30 statictext #main.statictext3, "Jour", 377, 15, 90, 30 statictext #main.statictext4, "Heure Début", 530, 15, 70, 30 statictext #main.statictext5, "Heure Fin", 650, 15, 90, 30 Button #main.save, "Save", [save], UL, 770, 15, 60, 30 Button #main.stat, "Stats", [stat], UL, 770, 60, 60, 30 TEXTEDITOR #main.text, 10, 52, 750, 350 ' graphicbox #main.gbox, 885, 10, 120, 120 MENU #main, "Aide", "Voir", [aide] Open "Gestion Magasin" For Window_nf as #main #main, "trapclose [quit]" #main.text, "!font Courier New 16" #main.save, "!font courrier 12 bold": #main.stat, "!font courrier 12 bold" for x=1 to 5 hand$="#main.statictext";str$(x) #hand$ "!font courier 12 bold" next x if flag = 1 then [byPass] dim nom$(1000),liste$(1000) dim tri$(1000),definitif$(500),k$(1000) dim tria$(1000),defin$(500),kk$(1000) [byPass] flag = 0 '--------------- gosub [chargeesp] gosub [doubles] gosub [aff] wait '-------------------------------------- [stat] maptw=580: mapth= 500 WindowWidth=maptw+15: WindowHeight=mapth+60 UpperLeftX = 2: UpperLeftY = 5 Button #t.save, "Save", [savstat], UL, 260, 10, 60, 30 TEXTEDITOR #t.cuma, 17, 50, 270, 440 TEXTEDITOR #t.cumb, 300, 50, 270, 440 GRAPHICBOX #t.g, 5, 5, maptw, mapth if opt=1 then [passt] OPEN "Statistiques ";selected$ FOR window_nf AS #t [passt] ' pour mémoire: k$()=clients...kk$()=collab opt=1: de=2: fi=n #t, "TRAPCLOSE [closet]" #t.g, "down;fill darkblue;color white;backcolor darkblue" #t.cuma, "!font courrier 12 bold": #t.cumb, "!font courrier 12 bold" #t.g, "font courrier 12 bold": #t.save, "!font courrier 12 bold" #t.g, "place 50 20": #t.g, "\Cumul par Client" #t.g, "place 330 20": #t.g, "\Cumul par Collaborateurs" for r=1 to k tot=0 for x=1 to n '------client if word$(nom$(x),1)=k$(r) then tdeb=val(left$(word$(nom$(x),4),2))*60+val(right$(word$(nom$(x),4),2)) tfin=val(left$(word$(nom$(x),5),2))*60+val(right$(word$(nom$(x),5),2)) t=tfin-tdeb heur=int(t/60) min=t mod 60 #t.cuma, word$(nom$(x),1);" ";word$(nom$(x),2);" ";heur;" h ";min'************** tot=tot+t end if next x heure=int(tot/60) minu=tot mod 60 #t.cuma, "******** Total: ";str$(heure);" h ";str$(minu);" *******" #t.cuma, "------------------------------------------------" ' tot=0 next r '----------------collab for r=1 to kk tot=0 for x=1 to n '------client if word$(nom$(x),2)=kk$(r) then tdeb=val(left$(word$(nom$(x),4),2))*60+val(right$(word$(nom$(x),4),2)) tfin=val(left$(word$(nom$(x),5),2))*60+val(right$(word$(nom$(x),5),2)) t=tfin-tdeb heur=int(t/60) min=t mod 60 #t.cumb, word$(nom$(x),1);" ";word$(nom$(x),2);" ";heur;" h ";min'************** tot=tot+t end if next x heure=int(tot/60) minu=tot mod 60 #t.cumb, "******** Total: ";str$(heure);" h ";str$(minu);" *******" #t.cumb, "------------------------------------------------" ' tot=0 next r wait [chargeesp] n = 0 open "Fichiers\donnees.txt" for input as #2 while eof(#2) = 0 n=n+1 input #2, donn$ if donn$="" then n=n-1: goto [passtour] nom$(n) = donn$ [passtour] wend close #2 return [aff] '--------------------format affichage------------- for x=1 to n if nom$(x)="" then [passfora] nom1$=word$(nom$(x),1): w1$=word$(nom$(x),2): c1$=word$(nom$(x),3): s1$=word$(nom$(x),4) dl$=word$(nom$(x),5): nl$=word$(nom$(x),6): a1$=word$(nom$(x),7): a2$=word$(nom$(x),8) nom$(x) = nom1$ + space$(15-len(nom1$)) +_ w1$ + space$(15-len(w1$))+_ c1$ + space$(12-len(c1$))+_ s1$ + space$( 10-len(s1$)) +_ dl$ +space$( 12-len(dl$)) +_ nl$ + space$( 15-len(nl$)) + _ a1$ +space$( 7-len(a1$)) + _ a2$+space$(12-len(a2$)) [passfora] next x for x=1 to n #main.text, nom$(x) next x return wait [save] '------------------------save---------------- gosub [savo] flag = 1 : goto [start] 'Notice,"Notice"+chr$(13)+"Pour voir les modifs"+chr$(13)+_ ' "Fermer le soft et relancer.": wait ' wait [savo] #main.text, "!contents? strinh$" open "Fichiers\donnees.txt" for output as #h print #h, strinh$ close #h return [savstat] #t.cuma, "!contents? statclie$" open "Fichiers\H Clients.txt" for output as #b print #b, statclie$ close #b #t.cumb, "!contents? statcoll$" open "Fichiers\H Collabs.txt" for output as #c print #c, statcoll$ close #c notice, "Notice"+chr$(13)+"C'est sauvé dans: 'Fichiers'": wait wait [doubles]'-----------------------DOUBLES----------------------- nbmots=n '-----------clients for x=1 to n liste$(x)=word$(nom$(x),1) next x for ref=0 to nbmots-1 motRef$=liste$(ref) for compare=0 to nbmots-1 if ref<>compare then motCompare$=liste$(compare) if motRef$<>motCompare$ then lettre=1 difference=0 while difference=0 a=asc(mid$(motRef$,lettre,1)) b=asc(mid$(motCompare$,lettre,1)) if a>96 then a=a-32 if b>96 then b=b-32 if a=b then lettre=lettre+1 else difference=1 wend if a>b then apres=apres+1 else avant=avant+1 end if end if next tri$(apres)=motRef$ avant=0:apres=0 next for a=0 to nbmots-1 if tri$(a)="" then casevide=casevide+1 next nbcases=nbmots-casevide redim definitif$(nbcases) actuel=0 for a=0 to nbmots-1 if tri$(a)<>"" then definitif$(actuel)=tri$(a):actuel=actuel+1 next for a=0 to actuel-1 k$(a)=definitif$(a): k=a+1 ': print k$(a) next '(((((((((((((( nbmots=n '-----------collab for x=1 to n liste$(x)=word$(nom$(x),2) next x for ref=0 to nbmots-1 motRef$=liste$(ref) for compare=0 to nbmots-1 if ref<>compare then motCompare$=liste$(compare) if motRef$<>motCompare$ then lettre=1 difference=0 while difference=0 a=asc(mid$(motRef$,lettre,1)) b=asc(mid$(motCompare$,lettre,1)) if a>96 then a=a-32 if b>96 then b=b-32 if a=b then lettre=lettre+1 else difference=1 wend if a>b then apres=apres+1 else avant=avant+1 end if end if next tria$(apres)=motRef$ avant=0:apres=0 next casevide=0 for a=0 to nbmots-1 if tria$(a)="" then casevide=casevide+1 next nbcases=nbmots-casevide redim defin$(nbcases) actuel=0 for a=0 to nbmots-1 if tria$(a)<>"" then defin$(actuel)=tria$(a):actuel=actuel+1 next for a=0 to actuel-1 kk$(a)=defin$(a): kk=a+1 ': print kk$(a) next return [closet] opt=0: close #t wait [quit] if opt=1 then opt=0: close #t Close #main End
|
|
|
Post by honky on Feb 15, 2023 11:03:53 GMT
Thank you very much, I did not know this obligation. Your way works very well, again thank.
|
|
|
Post by xxgeek on Feb 15, 2023 19:03:59 GMT
Thank you very much, I did not know this obligation. Your way works very well, again thank. You're right Honky, the system primitive was not caused by the dim statements, it was the variables only. Check this code. [start] if flag = 1 then nbcases = 0 close #main 'redim nom$(1000) 'redim liste$(1000) 'redim tri$(1000) 'redim definitif$(500) 'redim k$(1000) 'redim tria$(1000) 'redim defin$(500) 'redim kk$(1000) 'nbmots = 0 casevide = 0 end if nomainwin ForegroundColor$ = "Black" BackgroundColor$ = "Buttonface" TextboxColor$ = "Buttonface" WindowWidth = 850: WindowHeight = 560 UpperLeftX = int((DisplayWidth - WindowWidth) / 2) 'Centre la fenêtre horizontalement UpperLeftY = int((DisplayHeight - WindowHeight) / 2) 'Centre la fenêtre verticalement statictext #main.statictext1, "Client", 10, 15, 120, 30 statictext #main.statictext2, "Collab", 200, 15, 90, 30 statictext #main.statictext3, "Jour", 377, 15, 90, 30 statictext #main.statictext4, "Heure Début", 530, 15, 70, 30 statictext #main.statictext5, "Heure Fin", 650, 15, 90, 30 Button #main.save, "Save", [save], UL, 770, 15, 60, 30 Button #main.stat, "Stats", [stat], UL, 770, 60, 60, 30 TEXTEDITOR #main.text, 10, 52, 750, 350 ' graphicbox #main.gbox, 885, 10, 120, 120 MENU #main, "Aide", "Voir", [aide] Open "Gestion Magasin" For Window_nf as #main #main, "trapclose [quit]" #main.text, "!font Courier New 16" #main.save, "!font courrier 12 bold": #main.stat, "!font courrier 12 bold" for x=1 to 5 hand$="#main.statictext";str$(x) #hand$ "!font courier 12 bold" next x if flag = 1 then [byPass] dim nom$(1000),liste$(1000) dim tri$(1000),definitif$(500),k$(1000) dim tria$(1000),defin$(500),kk$(1000) [byPass] flag = 0 '--------------- gosub [chargeesp] gosub [doubles] gosub [aff] wait '-------------------------------------- [stat] maptw=580: mapth= 500 WindowWidth=maptw+15: WindowHeight=mapth+60 UpperLeftX = 2: UpperLeftY = 5 Button #t.save, "Save", [savstat], UL, 260, 10, 60, 30 TEXTEDITOR #t.cuma, 17, 50, 270, 440 TEXTEDITOR #t.cumb, 300, 50, 270, 440 GRAPHICBOX #t.g, 5, 5, maptw, mapth if opt=1 then [passt] OPEN "Statistiques ";selected$ FOR window_nf AS #t [passt] ' pour mémoire: k$()=clients...kk$()=collab opt=1: de=2: fi=n #t, "TRAPCLOSE [closet]" #t.g, "down;fill darkblue;color white;backcolor darkblue" #t.cuma, "!font courrier 12 bold": #t.cumb, "!font courrier 12 bold" #t.g, "font courrier 12 bold": #t.save, "!font courrier 12 bold" #t.g, "place 50 20": #t.g, "\Cumul par Client" #t.g, "place 330 20": #t.g, "\Cumul par Collaborateurs" for r=1 to k tot=0 for x=1 to n '------client if word$(nom$(x),1)=k$(r) then tdeb=val(left$(word$(nom$(x),4),2))*60+val(right$(word$(nom$(x),4),2)) tfin=val(left$(word$(nom$(x),5),2))*60+val(right$(word$(nom$(x),5),2)) t=tfin-tdeb heur=int(t/60) min=t mod 60 #t.cuma, word$(nom$(x),1);" ";word$(nom$(x),2);" ";heur;" h ";min'************** tot=tot+t end if next x heure=int(tot/60) minu=tot mod 60 #t.cuma, "******** Total: ";str$(heure);" h ";str$(minu);" *******" #t.cuma, "------------------------------------------------" ' tot=0 next r '----------------collab for r=1 to kk tot=0 for x=1 to n '------client if word$(nom$(x),2)=kk$(r) then tdeb=val(left$(word$(nom$(x),4),2))*60+val(right$(word$(nom$(x),4),2)) tfin=val(left$(word$(nom$(x),5),2))*60+val(right$(word$(nom$(x),5),2)) t=tfin-tdeb heur=int(t/60) min=t mod 60 #t.cumb, word$(nom$(x),1);" ";word$(nom$(x),2);" ";heur;" h ";min'************** tot=tot+t end if next x heure=int(tot/60) minu=tot mod 60 #t.cumb, "******** Total: ";str$(heure);" h ";str$(minu);" *******" #t.cumb, "------------------------------------------------" ' tot=0 next r wait [chargeesp] n = 0 open "Fichiers\donnees.txt" for input as #2 while eof(#2) = 0 n=n+1 input #2, donn$ if donn$="" then n=n-1: goto [passtour] nom$(n) = donn$ [passtour] wend close #2 return [aff] '--------------------format affichage------------- for x=1 to n if nom$(x)="" then [passfora] nom1$=word$(nom$(x),1): w1$=word$(nom$(x),2): c1$=word$(nom$(x),3): s1$=word$(nom$(x),4) dl$=word$(nom$(x),5): nl$=word$(nom$(x),6): a1$=word$(nom$(x),7): a2$=word$(nom$(x),8) nom$(x) = nom1$ + space$(15-len(nom1$)) +_ w1$ + space$(15-len(w1$))+_ c1$ + space$(12-len(c1$))+_ s1$ + space$( 10-len(s1$)) +_ dl$ +space$( 12-len(dl$)) +_ nl$ + space$( 15-len(nl$)) + _ a1$ +space$( 7-len(a1$)) + _ a2$+space$(12-len(a2$)) [passfora] next x for x=1 to n #main.text, nom$(x) next x return wait [save] '------------------------save---------------- gosub [savo] flag = 1 : goto [start] 'Notice,"Notice"+chr$(13)+"Pour voir les modifs"+chr$(13)+_ ' "Fermer le soft et relancer.": wait ' wait [savo] #main.text, "!contents? strinh$" open "Fichiers\donnees.txt" for output as #h print #h, strinh$ close #h return [savstat] #t.cuma, "!contents? statclie$" open "Fichiers\H Clients.txt" for output as #b print #b, statclie$ close #b #t.cumb, "!contents? statcoll$" open "Fichiers\H Collabs.txt" for output as #c print #c, statcoll$ close #c flag = 1 : goto [start] notice, "Notice"+chr$(13)+"C'est sauvé dans: 'Fichiers'": wait wait [doubles]'-----------------------DOUBLES----------------------- nbmots=n '-----------clients for x=1 to n liste$(x)=word$(nom$(x),1) next x for ref=0 to nbmots-1 motRef$=liste$(ref) for compare=0 to nbmots-1 if ref<>compare then motCompare$=liste$(compare) if motRef$<>motCompare$ then lettre=1 difference=0 while difference=0 a=asc(mid$(motRef$,lettre,1)) b=asc(mid$(motCompare$,lettre,1)) if a>96 then a=a-32 if b>96 then b=b-32 if a=b then lettre=lettre+1 else difference=1 wend if a>b then apres=apres+1 else avant=avant+1 end if end if next tri$(apres)=motRef$ avant=0:apres=0 next for a=0 to nbmots-1 if tri$(a)="" then casevide=casevide+1 next nbcases=nbmots-casevide dim definitif$(nbcases) actuel=0 for a=0 to nbmots-1 if tri$(a)<>"" then definitif$(actuel)=tri$(a):actuel=actuel+1 next for a=0 to actuel-1 k$(a)=definitif$(a): k=a+1 ': print k$(a) next '(((((((((((((( nbmots=n '-----------collab for x=1 to n liste$(x)=word$(nom$(x),2) next x for ref=0 to nbmots-1 motRef$=liste$(ref) for compare=0 to nbmots-1 if ref<>compare then motCompare$=liste$(compare) if motRef$<>motCompare$ then lettre=1 difference=0 while difference=0 a=asc(mid$(motRef$,lettre,1)) b=asc(mid$(motCompare$,lettre,1)) if a>96 then a=a-32 if b>96 then b=b-32 if a=b then lettre=lettre+1 else difference=1 wend if a>b then apres=apres+1 else avant=avant+1 end if end if next tria$(apres)=motRef$ avant=0:apres=0 next casevide=0 for a=0 to nbmots-1 if tria$(a)="" then casevide=casevide+1 next nbcases=nbmots-casevide dim defin$(nbcases) actuel=0 for a=0 to nbmots-1 if tria$(a)<>"" then defin$(actuel)=tria$(a):actuel=actuel+1 next for a=0 to actuel-1 kk$(a)=defin$(a): kk=a+1 ': print kk$(a) next return [closet] opt=0: close #t wait [quit] if opt=1 then opt=0: close #t Close #main End
|
|
|
Post by xxgeek on Feb 15, 2023 19:36:22 GMT
So there is no need for the flag now, and the only code needed is under [save] with [start] at the top of the code.
[save] '------------------------save---------------- gosub [savo] nbcases = 0 casevide = 0 close #main : goto [start]
[start] nomainwin ForegroundColor$ = "Black" BackgroundColor$ = "Buttonface" TextboxColor$ = "Buttonface" WindowWidth = 850: WindowHeight = 560 UpperLeftX = int((DisplayWidth - WindowWidth) / 2) 'Centre la fenêtre horizontalement UpperLeftY = int((DisplayHeight - WindowHeight) / 2) 'Centre la fenêtre verticalement statictext #main.statictext1, "Client", 10, 15, 120, 30 statictext #main.statictext2, "Collab", 200, 15, 90, 30 statictext #main.statictext3, "Jour", 377, 15, 90, 30 statictext #main.statictext4, "Heure Début", 530, 15, 70, 30 statictext #main.statictext5, "Heure Fin", 650, 15, 90, 30 Button #main.save, "Save", [save], UL, 770, 15, 60, 30 Button #main.stat, "Stats", [stat], UL, 770, 60, 60, 30 TEXTEDITOR #main.text, 10, 52, 750, 350 ' graphicbox #main.gbox, 885, 10, 120, 120 MENU #main, "Aide", "Voir", [aide] Open "Gestion Magasin" For Window_nf as #main #main, "trapclose [quit]" #main.text, "!font Courier New 16" #main.save, "!font courrier 12 bold": #main.stat, "!font courrier 12 bold" for x=1 to 5 hand$="#main.statictext";str$(x) #hand$ "!font courier 12 bold" next x dim nom$(1000),liste$(1000) dim tri$(1000),definitif$(500),k$(1000) dim tria$(1000),defin$(500),kk$(1000) '--------------- gosub [chargeesp] gosub [doubles] gosub [aff] wait '-------------------------------------- [stat] maptw=580: mapth= 500 WindowWidth=maptw+15: WindowHeight=mapth+60 UpperLeftX = 2: UpperLeftY = 5 Button #t.save, "Save", [savstat], UL, 260, 10, 60, 30 TEXTEDITOR #t.cuma, 17, 50, 270, 440 TEXTEDITOR #t.cumb, 300, 50, 270, 440 GRAPHICBOX #t.g, 5, 5, maptw, mapth if opt=1 then [passt] OPEN "Statistiques ";selected$ FOR window_nf AS #t [passt] ' pour mémoire: k$()=clients...kk$()=collab opt=1: de=2: fi=n #t, "TRAPCLOSE [closet]" #t.g, "down;fill darkblue;color white;backcolor darkblue" #t.cuma, "!font courrier 12 bold": #t.cumb, "!font courrier 12 bold" #t.g, "font courrier 12 bold": #t.save, "!font courrier 12 bold" #t.g, "place 50 20": #t.g, "\Cumul par Client" #t.g, "place 330 20": #t.g, "\Cumul par Collaborateurs" for r=1 to k tot=0 for x=1 to n '------client if word$(nom$(x),1)=k$(r) then tdeb=val(left$(word$(nom$(x),4),2))*60+val(right$(word$(nom$(x),4),2)) tfin=val(left$(word$(nom$(x),5),2))*60+val(right$(word$(nom$(x),5),2)) t=tfin-tdeb heur=int(t/60) min=t mod 60 #t.cuma, word$(nom$(x),1);" ";word$(nom$(x),2);" ";heur;" h ";min'************** tot=tot+t end if next x heure=int(tot/60) minu=tot mod 60 #t.cuma, "******** Total: ";str$(heure);" h ";str$(minu);" *******" #t.cuma, "------------------------------------------------" ' tot=0 next r '----------------collab for r=1 to kk tot=0 for x=1 to n '------client if word$(nom$(x),2)=kk$(r) then tdeb=val(left$(word$(nom$(x),4),2))*60+val(right$(word$(nom$(x),4),2)) tfin=val(left$(word$(nom$(x),5),2))*60+val(right$(word$(nom$(x),5),2)) t=tfin-tdeb heur=int(t/60) min=t mod 60 #t.cumb, word$(nom$(x),1);" ";word$(nom$(x),2);" ";heur;" h ";min'************** tot=tot+t end if next x heure=int(tot/60) minu=tot mod 60 #t.cumb, "******** Total: ";str$(heure);" h ";str$(minu);" *******" #t.cumb, "------------------------------------------------" ' tot=0 next r wait [chargeesp] n = 0 open "Fichiers\donnees.txt" for input as #2 while eof(#2) = 0 n=n+1 input #2, donn$ if donn$="" then n=n-1: goto [passtour] nom$(n) = donn$ [passtour] wend close #2 return [aff] '--------------------format affichage------------- for x=1 to n if nom$(x)="" then [passfora] nom1$=word$(nom$(x),1): w1$=word$(nom$(x),2): c1$=word$(nom$(x),3): s1$=word$(nom$(x),4) dl$=word$(nom$(x),5): nl$=word$(nom$(x),6): a1$=word$(nom$(x),7): a2$=word$(nom$(x),8) nom$(x) = nom1$ + space$(15-len(nom1$)) +_ w1$ + space$(15-len(w1$))+_ c1$ + space$(12-len(c1$))+_ s1$ + space$( 10-len(s1$)) +_ dl$ +space$( 12-len(dl$)) +_ nl$ + space$( 15-len(nl$)) + _ a1$ +space$( 7-len(a1$)) + _ a2$+space$(12-len(a2$)) [passfora] next x for x=1 to n #main.text, nom$(x) next x return wait [save] '------------------------save---------------- gosub [savo] nbcases = 0 casevide = 0 close #main : goto [start] 'Notice,"Notice"+chr$(13)+"Pour voir les modifs"+chr$(13)+_ ' "Fermer le soft et relancer.": wait ' wait [savo] #main.text, "!contents? strinh$" open "Fichiers\donnees.txt" for output as #h print #h, strinh$ close #h return [savstat] #t.cuma, "!contents? statclie$" open "Fichiers\H Clients.txt" for output as #b print #b, statclie$ close #b #t.cumb, "!contents? statcoll$" open "Fichiers\H Collabs.txt" for output as #c print #c, statcoll$ close #c flag = 1 : goto [start] notice, "Notice"+chr$(13)+"C'est sauvé dans: 'Fichiers'": wait wait [doubles]'-----------------------DOUBLES----------------------- nbmots=n '-----------clients for x=1 to n liste$(x)=word$(nom$(x),1) next x for ref=0 to nbmots-1 motRef$=liste$(ref) for compare=0 to nbmots-1 if ref<>compare then motCompare$=liste$(compare) if motRef$<>motCompare$ then lettre=1 difference=0 while difference=0 a=asc(mid$(motRef$,lettre,1)) b=asc(mid$(motCompare$,lettre,1)) if a>96 then a=a-32 if b>96 then b=b-32 if a=b then lettre=lettre+1 else difference=1 wend if a>b then apres=apres+1 else avant=avant+1 end if end if next tri$(apres)=motRef$ avant=0:apres=0 next for a=0 to nbmots-1 if tri$(a)="" then casevide=casevide+1 next nbcases=nbmots-casevide dim definitif$(nbcases) actuel=0 for a=0 to nbmots-1 if tri$(a)<>"" then definitif$(actuel)=tri$(a):actuel=actuel+1 next for a=0 to actuel-1 k$(a)=definitif$(a): k=a+1 ': print k$(a) next '(((((((((((((( nbmots=n '-----------collab for x=1 to n liste$(x)=word$(nom$(x),2) next x for ref=0 to nbmots-1 motRef$=liste$(ref) for compare=0 to nbmots-1 if ref<>compare then motCompare$=liste$(compare) if motRef$<>motCompare$ then lettre=1 difference=0 while difference=0 a=asc(mid$(motRef$,lettre,1)) b=asc(mid$(motCompare$,lettre,1)) if a>96 then a=a-32 if b>96 then b=b-32 if a=b then lettre=lettre+1 else difference=1 wend if a>b then apres=apres+1 else avant=avant+1 end if end if next tria$(apres)=motRef$ avant=0:apres=0 next casevide=0 for a=0 to nbmots-1 if tria$(a)="" then casevide=casevide+1 next nbcases=nbmots-casevide dim defin$(nbcases) actuel=0 for a=0 to nbmots-1 if tria$(a)<>"" then defin$(actuel)=tria$(a):actuel=actuel+1 next for a=0 to actuel-1 kk$(a)=defin$(a): kk=a+1 ': print kk$(a) next return [closet] opt=0: close #t wait [quit] if opt=1 then opt=0: close #t Close #main End
|
|
|
Post by honky on Feb 16, 2023 8:24:33 GMT
Indeed, it deserved to be studied.
|
|
|
Post by Brandon Parker on Feb 17, 2023 2:21:00 GMT
@:"plus" and: "Brandon Parker": There is no old and new. I completely misunderstood what you were asking. I thought you were talking about restarting the program from within the program. {:0) Brandon Parker
|
|