[SOLVED] Issue with OpenFileRquester and OpenConsole (Finally the problem was Goto within Select:EndSelect)
Posted: Wed Sep 04, 2024 8:58 pm
Hello,
This snippet works perfectly:
But the following crashes when calling OpenFileRequester.
I think the problem is probably due to the use of labels.
I'm well aware that the code can be arranged differently, but in principle, I'd like to understand why it doesn't work.
In theory, nothing seems to stand in the way...
This snippet works perfectly:
Code: Select all
If OpenConsole("Offres fournisseurs :",#PB_UTF8)
Fichier.s=OpenFileRequester("Ouvrir un fichier HTML MeteoJob","Fichier.html","Fichiers HTML|*.html",0)
CloseConsole()
EndIf
I think the problem is probably due to the use of labels.
I'm well aware that the code can be arranged differently, but in principle, I'd like to understand why it doesn't work.
In theory, nothing seems to stand in the way...
Code: Select all
If OpenConsole("Offres fournisseurs :",#PB_UTF8)
Define.s Fichier,TexteHTML,Req
Define.s Retour=LSet("",3,Chr(8))
RequeteTraitement:
Print("Quel traitement lancer (1=Fournisseur 1 / 2=Fournisseur 2 / Q=Quitter) ? : ")
Req=LCase(Input())
Select Req
;Case "1":Goto OffresF1
Case "1","2":Goto OffresF2
Case "","q":Goto Fin
Default
Print("Quitter (O/N) ? : ")
Select LCase(Input())
Case "n":Goto RequeteTraitement
Default:Goto Fin
EndSelect
EndSelect
;══ FOURNISSEUR 1 ════════════════════════
OffresF1:
Goto RequeteTraitement
;══ FOURNISSEUR 2 ══════════════════════════════
OffresF2:
;{
PrintN("Récupération des offres fournisseur 2 :")
Fichier=OpenFileRequester("Ouvrir un fichier HTML fournisseur","Fichier.html","Fichiers HTML|*.html",0)
If Fichier="":Goto RequeteTraitement:EndIf
Print("Ouverture du fichier...")
PrintN(Retour+" : OK")
; Pc_TraitementDonnees()
Goto RequeteTraitement
Fin:
PrintN("")
PrintN("Traitement terminé !")
Input()
EndIf