Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: Pb Button_picture avec compilateur Lun 5 Aoû 2019 - 21:43 | |
| Là y a un souci : - Code:
-
' SOFT AMIGO ' Yannick GERONIMI ' 01/08/2019 ' ============================================================================== ' VARIABLES ' ============================================================================== dim Vs$ ' incrémentation des objets dim no% ' gestion des datas dim dat$,fr$,PNum%(28,2),idgain$,TGain%(23,3),hlp$ ' gestion des boutons de choix de numéro dim EtatButCx%(28),z%,cx%,MaSelection%(7) ' gestion des messages dim mess%,t$ ' gestion des gains dim mise%,wallet%,bet%,NbJaune%,NbBleu%,GainManche%,coeff% ' gestion des tirages dim NbrTirs%,Partie%(12),PartBleu%(7),PartJaune%(5),cell%(28,2),LineNum$ ' ============================================================================== ' CONSTANTES ' ============================================================================== ' Fichiers dim ImgAmigo$ dim ButtImg1$(28) dim ButtImg2$(28) dim ImgCaseEmpty$ dim ImgCaseFull$ dim ImgList$ dim ImgAbout$ dim ImgHelp$ dim ImgAnnonce1$ dim ImgAnnonce2$ dim ImgVictoire$ dim ImgWin$ dim ImgLoose$ dim DirTemp$ dim ExTmpWallet$ dim ExMemoTirages$ dim TmpWallet$ dim MemoTirages$ ' Objets ' form principal dim F_or% dim F_ow% dim Frame%(5) dim Pub1% dim ButtCx%(28) dim Alph%(10) dim ContMise% dim OptMise%(5) dim ContTirs% dim OptTirs%(4) dim ButtValid% dim ButtRazGrille% dim Scene1% dim PictAnnonce% dim PictGain% dim TableGains% dim PictVictoire% dim BaseTir% dim ButtListe% dim ButtAbout% dim ButtHelp% ' form liste des tirages dim FenMess% dim ListTir% dim ButtRaZ% dim ButtClose% ' form a propos dim FenAbout% ' form aide dim FenHelp% dim TextHelp% dim ButtClose2% ' ============================================================================== ' LABELS ' ============================================================================== label CLIC label FIN ' ============================================================================== ' DATAS ' solution provisoire en attendant une version du compilateur corrigé ' ============================================================================== idgain$= "0400002,1300002,2200002,3100002,4000005," idgain$= idgain$+"0500003,1400003,2300003,3200003,4100008,5000040," idgain$= idgain$+"1500015,2400015,3300015,4200020,5100055,6000500," idgain$= idgain$+"2500100,3400100,4300105,5200140,6100600,7025000," ' ------------------------------------------------------------------------------ dat$= "040035,120035,200035,280035,360035,440035,5200035," dat$= dat$+"040115,120115,195115,275115,355115,435115,515115," dat$= dat$+"035195,115195,195195,275195,355195,435195,515195," dat$= dat$+"035275,115275,195275,275275,355275,435275,515275," ' ------------------------------------------------------------------------------ hlp$= "1)|" hlp$= hlp$+" |" hlp$= hlp$+"Sélectionnez 7 numéros.|" hlp$= hlp$+" |" hlp$= hlp$+"2)|" hlp$= hlp$+" |" hlp$= hlp$+"Sélectionnez vôtre mise:|" hlp$= hlp$+"2,4,6,8 ou 10 €.|" hlp$= hlp$+" |" hlp$= hlp$+"3)|" hlp$= hlp$+" |" hlp$= hlp$+"Sélectionnez le nombre de tirage.|" hlp$= hlp$+" 1,2,3 ou 4.|" hlp$= hlp$+" |" hlp$= hlp$+"4)|" hlp$= hlp$+" |" hlp$= hlp$+"Validez votre grille.|" hlp$= hlp$+"Bouton ''Valider''.|" ' ============================================================================== ' PROGRAMME ' ============================================================================== Application_title "SOFT AMIGO" InitAdrFichiers() InitNoObjets() MajTemp() InitDatas() InitWallet() Gui() end ' ============================================================================== ' SOUS PROGRAMMES ' ============================================================================== CLIC: for z%=1 to 28 if number_click =ButtCx%(z%) if EtatButCx%(z%)=0 if cx%<7 EtatButCx%(z%)=1 file_load ButtCx%(z%),dir_current$+"\img\SelectionRed"+str$(z%)+".bmp" cx%=cx%+1 AddToMaSelection(z%) else mess%= message_warning_ok("Sélection complète !") end_if else EtatButCx%(z%)=0 file_load ButtCx%(z%),dir_current$+"\img\SelectionBlue"+str$(z%)+".bmp" cx%=cx%-1 DeleteToMaSelection(z%) end_if exit_for end_if next z% if number_click = OptMise%(1) Mise%=2 coeff%=1 MajTableGains(TableGains%,1) end_if if number_click = OptMise%(2) Mise%=4 coeff%=2 MajTableGains(TableGains%,2) end_if if number_click = OptMise%(3) Mise%=6 coeff%=3 MajTableGains(TableGains%,3) end_if if number_click = OptMise%(4) Mise%=8 coeff%=4 MajTableGains(TableGains%,4) end_if if number_click = OptMise%(5) Mise%=10 coeff%=5 MajTableGains(TableGains%,5) end_if for z%=1 to 4 if number_click = OptTirs%(z%) NbrTirs% = z% exit_for end_if next z% if number_click = ButtValid% file_load ButtValid%,ImgCaseFull$ PlayAmigo() file_load ButtValid%,ImgCaseEmpty$ end_if if number_click = ButtRazGrille% file_load ButtRazGrille%,ImgCaseFull$ RazGrille() file_load ButtRazGrille%,ImgCaseEmpty$ end_if if number_click = ButtListe% BougeFormPricipale(1) FenMessage() inactive ButtListe% end_if if number_click = ButtAbout% inactive Frame%(3) inactive Frame%(1) if object_exists(FenMess%)=1 : inactive ButtClose% : end_if FenApp() wait 5000 delete FenAbout% active Frame%(3) active Frame%(1) if object_exists(FenMess%)=1 : active ButtClose% : end_if end_if
if number_click = ButtHelp% FenAide() end_if if object_exists(FenMess%)=1 if number_click = ButtRaZ% RazListTirages() end_if if number_click = ButtClose% hide FenMess% BougeFormPricipale(2) active ButtListe% end_if end_if if object_exists(FenHelp%)=1 if number_click = ButtClose2% hide FenHelp% end_if end_if Return ' ------------------------------------------------------------------------------ FIN: file_delete TmpWallet$ if wallet%>2 file_open_write F_ow%,TmpWallet$ file_writeln F_ow%,str$(wallet%) file_close F_ow% end_if Terminate Return ' ============================================================================== ' PROCEDURES ' ============================================================================== Sub InitAdrFichiers() dim_local i% Vs$ = "099" ImgAmigo$ =dir_current$+"\img\Amigo.bmp" for i%=1 to 28 ButtImg1$(i%)=dir_current$+"\img\SelectionBlue"+str$(i%)+".bmp" ButtImg2$(i%)=dir_current$+"\img\SelectionRed"+str$(i%)+".bmp" next i% ImgCaseEmpty$=dir_current$+"\img\EmptyCase.bmp" ImgCaseFull$ =dir_current$+"\img\MarkedCase.bmp" ImgList$ =dir_current$+"\img\list.bmp" ImgAbout$ =dir_current$+"\img\About.bmp" ImgHelp$ =dir_current$+"\img\Help.bmp" ImgAnnonce1$ =dir_current$+"\img\Annonce1.bmp" ImgAnnonce2$ =dir_current$+"\img\Annonce2.bmp" ImgVictoire$ =dir_current$+"\img\bourse.bmp" ImgWin$ =dir_current$+"\img\EmoWin.bmp" ImgLoose$ =dir_current$+"\img\EmoLoose.bmp" ExTmpWallet$ = "C:\Temp\SoftAmigoWallet.txt" ExMemoTirages$ = "C:\Temp\SoftAmigoTirages.txt" DirTemp$ = "C:\Temp\SoftAmigoTemp" TmpWallet$ = DirTemp$+"SoftAmigoWalletVs"+Vs$+".txt" MemoTirages$ = DirTemp$+"SoftAmigoTiragesVs"+Vs$+".txt" End_sub ' ------------------------------------------------------------------------------ Sub InitNoObjets() dim_local i% for i%=1 to 5 : no%=no%+1 : Frame%(i%)=no% : next i% no%=no%+1 : Pub1%=no% for i%=1 to 28 : no%=no%+1 : ButtCx%(i%)=no% : next i% for i%=1 to 10 : no%=no%+1 : Alph%(i%)=no% : next i% no%=no%+1 : ContMise%=no% for i%=1 to 5 : no%=no%+1 : OptMise%(i%)=no%: next i% no%=no%+1 : ContTirs%=no% for i%=1 to 4 : no%=no%+1 : OptTirs%(i%)=no%: next i% no%=no%+1 : Scene1%=no% no%=no%+1 : PictAnnonce%=no% no%=no%+1 : PictGain%=no% no%=no%+1 : TableGains%=no% no%=no%+1 : PictVictoire%=no% no%=no%+1 : ButtValid%=no% no%=no%+1 : ButtRazGrille%=no% no%=no%+1 : F_or%=no% no%=no%+1 : F_ow%=no% no%=no%+1 : BaseTir%=no% no%=no%+1 : ButtListe%=no% no%=no%+1 : ButtAbout%=no% no%=no%+1 : ButtHelp%=no% no%=no%+1 : FenMess%=no% no%=no%+1 : ListTir%=no% no%=no%+1 : ButtRaZ%=no% no%=no%+1 : ButtClose%=no% no%=no%+1 : FenAbout%=no% no%=no%+1 : FenHelp%=no% no%=no%+1 : TextHelp%=no% no%=no%+1 : ButtClose2%=no% End_sub ' ------------------------------------------------------------------------------ ' solution provisoire en attendant une version du compilateur corrigé Sub InitDatas() dim_local i%,n$,x%,y% for i%=1 to 28 n$=left$(dat$,instr(dat$,",")-1) dat$=right$(dat$,len(dat$)-instr(dat$,",")) x%=val(left$(n$,3)) y%=val(right$(n$,3)) PNum%(i%,1)=x% PNum%(i%,2)=y% next i% for i%=1 to 23 n$= left$(idgain$,instr(idgain$,",")-1) TGain%(i%,1)= val(mid$(n$,1,1)) TGain%(i%,2)= val(mid$(n$,2,1)) TGain%(i%,3)= val(mid$(n$,3,5)) idgain$= right$(idgain$,len(idgain$)-instr(idgain$,",")) next i% end_sub ' ------------------------------------------------------------------------------ Sub InitWallet() dim_local l$ if file_exists(TmpWallet$)=1 file_open_read F_or%,TmpWallet$ l$=file_readln$(F_or%) wallet%=val(l$) file_close F_or% else file_open_write F_ow%,TmpWallet$ file_writeln F_ow%,"100" wallet%=100 file_close F_ow% end_if End_sub ' ------------------------------------------------------------------------------ Sub MajTemp() dim_local i$ if dir_exists(DirTemp$)=0 dir_make DirTemp$ end_if if file_exists(ExMemoTirages$)=1 file_delete ExMemoTirages$ end_if if file_exists(ExTmpWallet$)=1 file_open_read F_or%,ExTmpWallet$ i$ = file_readln$(F_or%) file_close F_or% file_delete ExTmpWallet$ file_open_write F_ow%,TmpWallet$ file_writeln F_ow%,i$ file_close F_ow% end_if End_sub ' ------------------------------------------------------------------------------ Sub Gui() dim_local i%,j%,n%,y%,x% height 0,600 : width 0,1000 top 0,(screen_y-height(0))/2 : left 0,(screen_x-width(0))/2 border_small 0 caption 0,"SOFT AMIGO" font_name 0,"Arial" : font_size 0,10 : font_bold 0 : font_color 0,0,0,0 on_close 0,FIN panel Frame%(1) height Frame%(1),height_client(0)-20 : width Frame%(1),300 top Frame%(1),10 : left Frame%(1),10 color Frame%(1),255,0,0 picture pub1% parent pub1%,Frame%(1) height pub1%,93 : width pub1%,243 top pub1%,5 : left pub1%,(width_client(Frame%(1))-width(pub1%))/2 file_load pub1%,ImgAmigo$
y%=110 : x%=-25 for i%=1 to 4 y%=y%+40 for j%=1 to 7 x%=x%+40 n%=n%+1 button_picture ButtCx%(n%) parent ButtCx%(n%),Frame%(1) height ButtCx%(n%),30 : width ButtCx%(n%),30 top ButtCx%(n%),y% : left ButtCx%(n%),x% file_load ButtCx%(n%),ButtImg1$(n%) cursor_point ButtCx%(n%) EtatButCx%(n%)=0 on_click ButtCx%(n%),CLIC next j% x%=-25 next i%
alpha Alph%(1) parent Alph%(1),Frame%(1) caption Alph%(1),"Mise / tirage" : font_name Alph%(1),"Arial" : font_size Alph%(1),12 : font_bold Alph%(1) font_color Alph%(1),255,255,255 top Alph%(1),top(ButtCx%(28))+50 : left Alph%(1),(width_client(Frame%(1))-width(Alph%(1)))/2 container_option ContMise% parent ContMise%,Frame%(1) height ContMise%,50 : width ContMise%,width_client(Frame%(1))-10 top ContMise%,top(Alph%(1))+height(Alph%(1))+5 : left ContMise%,5
option OptMise%(1) : parent OptMise%(1),ContMise% font_name OptMise%(1),"Arial" : font_size OptMise%(1),10 : font_bold OptMise%(1) : font_color OptMise%(1),255,255,255 top OptMise%(1),20 : left OptMise%(1),10 : caption OptMise%(1),"2 €" cursor_point OptMise%(1) : on_click OptMise%(1),CLIC mark_on OptMise%(1) option OptMise%(2) : parent OptMise%(2),ContMise% font_name OptMise%(2),"Arial" : font_size OptMise%(2),10 : font_bold OptMise%(2) : font_color OptMise%(2),255,255,255 top OptMise%(2),20 : left OptMise%(2),left(OptMise%(1))+50 : caption OptMise%(2),"4 €" cursor_point OptMise%(2) : on_click OptMise%(2),CLIC option OptMise%(3) : parent OptMise%(3),ContMise% font_name OptMise%(3),"Arial" : font_size OptMise%(3),10 : font_bold OptMise%(3) : font_color OptMise%(3),255,255,255 top OptMise%(3),20 : left OptMise%(3),left(OptMise%(2))+50 : caption OptMise%(3),"6 €" cursor_point OptMise%(3) : on_click OptMise%(3),CLIC option OptMise%(4) : parent OptMise%(4),ContMise% font_name OptMise%(4),"Arial" : font_size OptMise%(4),10 : font_bold OptMise%(4) : font_color OptMise%(4),255,255,255 top OptMise%(4),20 : left OptMise%(4),left(OptMise%(3))+50 : caption OptMise%(4),"8 €" cursor_point OptMise%(4) : on_click OptMise%(4),CLIC option OptMise%(5) : parent OptMise%(5),ContMise% width OptMise%(5),50 font_name OptMise%(5),"Arial" : font_size OptMise%(5),10 : font_bold OptMise%(5) : font_color OptMise%(5),255,255,255 top OptMise%(5),20 : left OptMise%(5),left(OptMise%(4))+50 : caption OptMise%(5),"10 €" cursor_point OptMise%(5) : on_click OptMise%(5),CLIC
alpha Alph%(2) parent Alph%(2),Frame%(1) caption Alph%(2),"Nombre de tirages :" : font_name Alph%(2),"Arial" : font_size Alph%(2),12 : font_bold Alph%(2) font_color Alph%(2),255,255,255 top Alph%(2),top(ContMise%)+70 : left Alph%(2),(width_client(Frame%(1))-width(Alph%(2)))/2
container_option ContTirs% parent ContTirs%,Frame%(1) height ContTirs%,50 : width ContTirs%,width_client(Frame%(1))-10 top ContTirs%,top(Alph%(2))+height(Alph%(2))+5 : left ContTirs%,5
option OptTirs%(1) : parent OptTirs%(1),ContTirs% font_name OptTirs%(1),"Arial" : font_size OptTirs%(1),10 : font_bold OptTirs%(1) : font_color OptTirs%(1),255,255,255 top OptTirs%(1),20 : left OptTirs%(1),50 : caption OptTirs%(1),"1" cursor_point OptTirs%(1) : on_click OptTirs%(1),CLIC mark_on OptTirs%(1) option OptTirs%(2) : parent OptTirs%(2),ContTirs% font_name OptTirs%(2),"Arial" : font_size OptTirs%(2),10 : font_bold OptTirs%(2) : font_color OptTirs%(2),255,255,255 top OptTirs%(2),20 : left OptTirs%(2),left(OptTirs%(1))+50 : caption OptTirs%(2),"2" cursor_point OptTirs%(2) : on_click OptTirs%(2),CLIC option OptTirs%(3) : parent OptTirs%(3),ContTirs% font_name OptTirs%(3),"Arial" : font_size OptTirs%(3),10 : font_bold OptTirs%(3) : font_color OptTirs%(3),255,255,255 top OptTirs%(3),20 : left OptTirs%(3),left(OptTirs%(2))+50 : caption OptTirs%(3),"3" cursor_point OptTirs%(3) : on_click OptTirs%(3),CLIC option OptTirs%(4) : parent OptTirs%(4),ContTirs% width OptTirs%(4),50 font_name OptTirs%(4),"Arial" : font_size OptTirs%(4),10 : font_bold OptTirs%(4) : font_color OptTirs%(4),255,255,255 top OptTirs%(4),20 : left OptTirs%(4),left(OptTirs%(3))+50 : caption OptTirs%(4),"4" cursor_point OptTirs%(4) : on_click OptTirs%(4),CLIC button_picture ButtValid% parent ButtValid%,Frame%(1) button_picture_target_is_object height ButtValid%,24 : width ButtValid%,80 picture_left ButtValid% button_picture_target_is_picture height ButtValid%,18 : width ButtValid%,18 file_load ButtValid%,ImgCaseEmpty$ caption ButtValid%,"Valider" top ButtValid%,height_client(Frame%(1))-(height(ButtValid%)+5) : left ButtValid%,(width_client(Frame%(1))-(width(ButtValid%)+65))/2 cursor_point ButtValid% on_click ButtValid%,CLIC button_picture ButtRazGrille% parent ButtRazGrille%,Frame%(1) button_picture_target_is_object height ButtRazGrille%,24 : width ButtRazGrille%,60 picture_left ButtRazGrille% button_picture_target_is_picture height ButtRazGrille%,18 : width ButtRazGrille%,18 file_load ButtRazGrille%,ImgCaseEmpty$ caption ButtRazGrille%,"RAZ" top ButtRazGrille%,height_client(Frame%(1))-(height(ButtRazGrille%)+5) : left ButtRazGrille%,left(ButtValid%)+width(ButtValid%)+5 cursor_point ButtRazGrille% on_click ButtRazGrille%,CLIC panel Frame%(2) height Frame%(2),height_client(0)-65 : width Frame%(2),width_client(0)-330 top Frame%(2),10 : left Frame%(2),left(Frame%(1))+310 color Frame%(2),255,0,0 picture Scene1% parent Scene1%,Frame%(2) height Scene1%,330 : width Scene1%,570 top Scene1%,10 : left Scene1%,(width_client(Frame%(2))-width(Scene1%))/2 font_name Scene1%,"Arial" : font_size Scene1%,14 : font_bold Scene1% CreationPlateau(Scene1%)
create_hide picture PictAnnonce% parent PictAnnonce%,Frame%(2) height PictAnnonce%,120 : width PictAnnonce%,350 color PictAnnonce%,0,0,255 top PictAnnonce%,((height(Scene1%)-height(PictAnnonce%))/2)+10 : left PictAnnonce%,(width_client(Frame%(2))-width(PictAnnonce%))/2 create_show
alpha Alph%(3) parent Alph%(3),Frame%(2) caption Alph%(3),"Table des gains :" : font_name Alph%(3),"Arial" : font_size Alph%(3),10 : font_bold Alph%(3) font_color Alph%(3),255,255,255 top Alph%(3),top(Scene1%)+height(Scene1%)+10 : left Alph%(3),left(Scene1%) grid TableGains% parent TableGains%,Frame%(2) height TableGains%,120 : width TableGains%,160 top TableGains%,top(Alph%(3))+20 : left TableGains%,left(Scene1%) color TableGains%,255,255,140 font_name TableGains%,"Courier" : font_color TableGains%,0,0,255 : font_size TableGains%,8 : font_bold TableGains% grid_column_fixed TableGains%,0 grid_row_fixed TableGains%,1 grid_one_row_height TableGains%,1,24 grid_fixed_color TableGains%,255,255,0 grid_column TableGains%,3 grid_row TableGains%,24 grid_row_height TableGains%,18 grid_one_column_width TableGains%,1,30 grid_one_column_width TableGains%,2,30 grid_one_column_width TableGains%,3,75 MajTableGains(TableGains%,1) picture PictVictoire% parent PictVictoire%,Frame%(2) height PictVictoire%,128 : width PictVictoire%,128 file_load PictVictoire%,ImgVictoire$ top PictVictoire%,top(Scene1%)+height(Scene1%) : left PictVictoire%,width_client(Frame%(2))-width(PictVictoire%) alpha Alph%(4) parent Alph%(4),Frame%(2) caption Alph%(4),str$(wallet%)+" €" : font_name Alph%(4),"Arial" : font_size Alph%(4),12 : font_bold Alph%(4) font_color Alph%(4),255,255,255 top Alph%(4),top(PictVictoire%)+height(PictVictoire%)-10 : left Alph%(4),left(PictVictoire%)+((width(PictVictoire%)-width(Alph%(4)))/2)
create_hide picture PictGain% parent PictGain%,Frame%(2) height PictGain%,128 : width PictGain%,128 top PictGain%,top(Scene1%)+height(Scene1%)+5 : left PictGain%,left(TableGains%)+width(TableGains%)+100 color PictGain%,0,0,255 : file_load PictGain%,ImgWin$
alpha Alph%(5) parent Alph%(5),Frame%(2) caption Alph%(5),"+ 25000 €" : font_name Alph%(5),"Arial" : font_size Alph%(5),18 : font_bold Alph%(5) font_color Alph%(5),255,255,0 top Alph%(5),top(PictGain%)+(height(PictGain%)-5) : left Alph%(5),left(PictGain%)+((width(PictGain%)-width(Alph%(5)))/2) create_show panel Frame%(3) height Frame%(3),40 : width Frame%(3),width_client(0)-330 top Frame%(3),top(Frame%(2))+height(Frame%(2))+5 : left Frame%(3),left(Frame%(1))+310 color Frame%(3),255,0,0 button_picture ButtListe% parent ButtListe%,Frame%(3) button_picture_target_is_object height ButtListe%,24 : width ButtListe%,90 picture_left ButtListe% button_picture_target_is_picture height ButtListe%,18 : width ButtListe%,18 file_load ButtListe%,ImgList$ caption ButtListe%,"Tirages" top ButtListe%,10 : left ButtListe%,((width_client(Frame%(3))-(width(ButtListe%)*3))/2)-10 cursor_point ButtListe% on_click ButtListe%,CLIC
button_picture ButtAbout% parent ButtAbout%,Frame%(3) button_picture_target_is_object height ButtAbout%,24 : width ButtAbout%,90 picture_left ButtAbout% button_picture_target_is_picture height ButtAbout%,18 : width ButtAbout%,18 file_load ButtAbout%,ImgAbout$ caption ButtAbout%,"A Propos" top ButtAbout%,10 : left ButtAbout%,left(ButtListe%)+width(ButtListe%)+5 cursor_point ButtAbout% on_click ButtAbout%,CLIC button_picture ButtHelp% parent ButtHelp%,Frame%(3) button_picture_target_is_object height ButtHelp%,24 : width ButtHelp%,90 picture_left ButtHelp% button_picture_target_is_picture height ButtHelp%,18 : width ButtHelp%,18 file_load ButtHelp%,ImgHelp$ caption ButtHelp%,"Aide" top ButtHelp%,10 : left ButtHelp%,left(ButtAbout%)+width(ButtAbout%)+5 cursor_point ButtHelp% on_click ButtHelp%,CLIC dlist BaseTir% if file_exists(MemoTirages$)=1 file_load BaseTir%,MemoTirages$ end_if item_add BaseTir%,string$(100,"=") item_add BaseTir%,chr$(32)+Date$ item_add BaseTir%,string$(100,"=") item_add BaseTir%,chr$(32)+"Heure"+string$(2,chr$(32))+"|"+chr$(32)+"Tirage"+string$(32,chr$(32))+"|"+chr$(32)+"Vos numéros" item_add BaseTir%,string$(100,"-") file_save BaseTir%,MemoTirages$ End_sub ' ------------------------------------------------------------------------------ Sub CreationPlateau(obj%) dim_local x%,y%,x2%,y2%,i%,j%,n% 2d_target_is obj% 2d_pen_color 0,0,0 n%=0 : x%=-70 : y%=-70 for i%=1 to 4 y%=y%+80 for j%=1 to 7 n%=n%+1 x%=x%+80 cell%(n%,1)=x% cell%(n%,2)=y% x2%=x%+70 y2%=y%+70 2d_rectangle x%,y%,x2%,y2% next j% x%=-70 next i% for i%=1 to 28 font_color obj%,0,0,0 print_target_is obj% print_locate PNum%(i%,1),PNum%(i%,2) print str$(i%) next i% End_sub ' ------------------------------------------------------------------------------ Sub RazPlateau() dim_local i%,j% 2d_target_is Scene1% 2d_clear End_sub ' ------------------------------------------------------------------------------ Sub AddToMaSelection(c%) dim_local i%,x%,n$ LineNum$="" for i%=1 to 7 x%=MaSelection%(i%) if x%=0 MaSelection%(i%)=c% exit_for end_if next i% for i%=1 to 7 n$ = str$(MaSelection%(i%)) n$ = string$(3-len(n$),chr$(32))+n$ n$ = right$(n$,2) LineNum$=LineNum$+chr$(32)+n$ next i% End_sub ' ------------------------------------------------------------------------------ Sub DeleteToMaSelection(c%) dim_local i%,x%,n$ LineNum$="" for i%=1 to 7 x%=MaSelection%(i%) if x%=c% MaSelection%(i%)=0 exit_for end_if next i% for i%=1 to 7 n$ = str$(MaSelection%(i%)) n$ = string$(3-len(n$),chr$(32))+n$ n$ = right$(n$,2) LineNum$=LineNum$+chr$(32)+n$ next i% End_sub ' ------------------------------------------------------------------------------ Sub MajTableGains(obj%,multi%) dim_local i%,b$,j$,g$ if object_exists(obj%)=0 then exit_sub grid_write obj%,1,1,chr$(32)+"B" grid_write obj%,1,2,chr$(32)+"J" grid_write obj%,1,3,string$(2,chr$(32))+"GAINS" for i%=1 to 23 b$=str$(TGain%(i%,1)) : grid_write obj%,25-i%,1,chr$(32)+b$ j$=str$(TGain%(i%,2)) : grid_write obj%,25-i%,2,chr$(32)+j$ g$=str$(TGain%(i%,3)*multi%) : grid_write obj%,25-i%,3,string$(7-len(g$),chr$(32))+g$ next i% End_sub ' ------------------------------------------------------------------------------ Sub Tirage() dim_local i%,j%,n%,eq%,tir$,num$,h$,m$ for i%=1 to 12 : Partie%(i%)=0 : next i% for i%=1 to 7 : PartBleu%(i%)=0 : next i% for i%=1 to 5 : PartJaune%(i%)=0 : next i% file_load PictAnnonce%,ImgAnnonce1$ show PictAnnonce% pause 3000 hide PictAnnonce% i%=0 for j%=1 to 12 : Partie%(j%)=0 : next j% while i%<>12 n%=rnd(27)+1 for j%=1 to 12 if Partie%(j%)=n% : eq%=1 : end_if next j% if eq%<>1 i%=i%+1 Partie%(i%)=n% if i%<8 ColorCaseTirage(n%,Scene1%) PartBleu%(i%)=n% else if i%=8 file_load PictAnnonce%,ImgAnnonce2$ show PictAnnonce% pause 3000 hide PictAnnonce% end_if ColorCaseBonus(n%,Scene1%) PartJaune%(i%-7)=n% end_if else eq%=0 end_if end_while for i%=1 to 12 num$ = str$(Partie%(i%)) num$ = string$(3-len(num$),chr$(32))+num$ if i%=7 tir$ = tir$+right$(num$,2)+chr$(32)+"/"+chr$(32) else tir$ = tir$+right$(num$,2)+chr$(32) end_if next i% h$ = str$(time_Hour) h$ = string$(3-len(h$),"0")+h$ h$ = right$(h$,2) m$ = str$(time_minute) m$ = string$(3-len(m$),"0")+m$ m$ = right$(m$,2) tir$ = chr$(32)+h$+":"+m$+string$(2,chr$(32))+"|"+chr$(32)+tir$+"|"+LineNum$ item_add BaseTir%,tir$
if object_exists(FenMess%)=1 and show(1)=1 item_add ListTir%,tir$ if count(ListTir%)>0 item_select ListTir%,count(ListTir%) end_if end_if
file_save BaseTir%,MemoTirages$
End_sub ' ------------------------------------------------------------------------------ Sub ColorCaseTirage(c%,obj%) dim_local i%,j%,r%,g%,b%,c$ 2d_target_is obj% font_color obj%,250,250,250 print_target_is obj% print_locate Pnum%(c%,1),Pnum%(c%,2) print str$(c%) 2d_pen_color 0,0,255 for i%=cell%(c%,1)+2 to cell%(c%,1)+66 for j%=cell%(c%,2)+2 to cell%(c%,2)+66 r%=color_pixel_red(obj%,i%,j%) g%=color_pixel_green(obj%,i%,j%) b%=color_pixel_blue(obj%,i%,j%) c$=str$(r%)+str$(g%)+str$(b%) if c$="255255255" 2d_point i%,j% end_if next j% next i% End_sub ' ------------------------------------------------------------------------------ Sub ColorCaseBonus(c%,obj%) dim_local i%,j%,r%,g%,b%,c$ 2d_target_is obj% font_color obj%,255,0,0 print_target_is obj% print_locate Pnum%(c%,1),Pnum%(c%,2) print str$(c%) 2d_pen_color 255,255,0 for i%=cell%(c%,1)+2 to cell%(c%,1)+66 for j%=cell%(c%,2)+2 to cell%(c%,2)+66 r%=color_pixel_red(obj%,i%,j%) g%=color_pixel_green(obj%,i%,j%) b%=color_pixel_blue(obj%,i%,j%) c$=str$(r%)+str$(g%)+str$(b%) if c$="255255255" 2d_point i%,j% end_if next j% next i% End_sub ' ------------------------------------------------------------------------------ Sub FenMessage() dim_local i% if object_exists(FenMess%)=0 form FenMess% border_hide FenMess% height FenMess%,200 : width FenMess%,width(0)-15 top FenMess%,top(0)+height(0) : left FenMess%,left(0)+7 caption FenMess%,"TIRAGES" panel Frame%(4) parent Frame%(4),FenMess% height Frame%(4),height_client(FenMess%)-20 : width Frame%(4),width_client(FenMess%)-20 top Frame%(4),10 : left Frame%(4),10 color Frame%(4),255,0,0 list ListTir% parent ListTir%,Frame%(4) height ListTir%,Height_client(Frame%(4))-40 : width ListTir%,width_client(Frame%(4))-10 top ListTir%,5 : left ListTir%,5 color ListTir%,255,255,140 font_name ListTir%,"Courier" : font_size ListTir%,8 : font_bold ListTir% : font_color ListTir%,0,0,255 button ButtRaZ% parent ButtRaZ%,Frame%(4) caption ButtRaZ%,"R.à.Z" width ButtRaZ%,60 font_name ButtRaZ%,"Arial" : font_size ButtRaZ%,10 : font_bold ButtRaZ% top ButtRaZ%,height_client(Frame%(4))-height(ButtRaZ%)-5 left ButtRaZ%,left(ListTir%)+((width(ListTir%)-140)/2) cursor_point ButtRaZ% on_click ButtRaZ%,CLIC button ButtClose% parent ButtClose%,Frame%(4) caption ButtClose%,"Fermer" width ButtClose%,80 font_name ButtClose%,"Arial" : font_size ButtClose%,10 : font_bold ButtClose% top ButtClose%,height_client(Frame%(4))-height(ButtClose%)-5 left ButtClose%,left(ButtRaZ%)+width(ButtRaZ%)+5 cursor_point ButtClose% on_click ButtClose%,CLIC else clear ListTir% show FenMess% end_if file_load ListTir%,MemoTirages$ if count(ListTir%)>0 item_select ListTir%,count(ListTir%) end_if end_sub ' ------------------------------------------------------------------------------ Sub PlayAmigo() dim_local i% if cx%=7 inactive Frame%(1) inactive Frame%(3) if object_exists(ButtClose%)=1 inactive ButtClose% inactive ButtRaZ% end_if else mess%= message_warning_ok("Vous devez sélectionner 7 numéros !") exit_sub end_if
bet% = NbrTirs%*mise% if wallet%>=bet% wallet%=wallet%-bet% caption Alph%(4),str$(wallet%)+" €" left Alph%(4),left(PictVictoire%)+((width(PictVictoire%)-width(Alph%(4)))/2) i%=0 while i%<>NbrTirs% i%=i%+1 RazPlateau() CreationPlateau(Scene1%) Tirage() VerifGains() end_while else if wallet%=0 t$= "Votre porte monnaie est vide !" t$= t$+chr$(13)+"Pour le recharger, vous devez redémarrer l' application." mess%=message_information_ok(t$) file_delete TmpWallet$ Terminate else t$= "Vous avez parié "+str$(bet%)+" €" t$= t$+chr$(13)+"Mais il ne vous reste que "+str$(wallet%)+" €." t$= t$+chr$(13)+"Diminuez votre mise." mess%=message_information_ok(t$) end_if end_if active Frame%(1) active Frame%(3) if object_exists(ButtClose%)=1 active ButtClose% active ButtRaZ% end_if End_sub ' ------------------------------------------------------------------------------ Sub VerifGains() dim_local i%,j%,s% NbBleu%=0 NbJaune%=0 for i%=1 to 7 s%=PartBleu%(i%) for j%=1 to 7 if MaSelection%(j%)=s% : NbBleu%=NbBleu%+1 : end_if next j% next i% for i%=1 to 5 s%=PartJaune%(i%) for j%=1 to 7 if MaSelection%(j%)=s% : NbJaune%=NbJaune%+1 : end_if next j% next i%
if NbBleu%+NbJaune%>3 for i%=1 to 23 if TGain%(i%,1)=NbBleu% and TGain%(i%,2)=NbJaune% GainManche%=TGain%(i%,3)*coeff% wallet%=wallet%+GainManche% caption Alph%(5),str$(GainManche%)+" €" left Alph%(5),left(PictGain%)+((width(PictGain%)-width(Alph%(5)))/2) caption Alph%(4),str$(wallet%)+" €" left Alph%(4),left(PictVictoire%)+((width(PictVictoire%)-width(Alph%(4)))/2) file_load PictGain%,ImgWin$ show PictGain% show Alph%(5) wait 3000 hide Alph%(5) hide PictGain% end_if next i% else GainManche%=0 file_load PictGain%,ImgLoose$ show PictGain% wait 3000 hide PictGain% end_if End_sub ' ------------------------------------------------------------------------------ Sub BougeFormPricipale(opt%) dim_local i%
if opt%=1 for i%=1 to 100 top 0,top(0)-1 display next i% else for i%=1 to 100 top 0,top(0)+1 display next i% end_if End_sub ' ------------------------------------------------------------------------------ Sub FenApp() dim_local t$
form FenAbout% border_hide FenAbout% height FenAbout%,250 : width FenAbout%,400 top FenAbout%,top(0)+((height(0)-height(FenAbout%))/2) left FenAbout%,left(0)+((width(0)-width(FenAbout%))/2) color FenAbout%,0,0,255 t$="SOFT AMIGO"+chr$(13) t$=t$+"Par Y.GERONIMI"+chr$(13) t$=t$+"Le 04/08/2019"+chr$(13)+chr$(13) t$=t$+"Avec Panoramic Vs 0.9.29i9" alpha Alph%(6) parent Alph%(6),FenAbout% font_name Alph%(6),"Arial" : font_size Alph%(6),18 : font_bold Alph%(6) font_color Alph%(6),255,255,0 caption Alph%(6),t$ top Alph%(6),40 : left Alph%(6),20 End_sub ' ------------------------------------------------------------------------------ Sub FenAide() if object_exists(FenHelp%)=0 form FenHelp% border_small FenHelp% height FenHelp%,height(0) : width FenHelp%,290 top FenHelp%,top(0) : left FenHelp%,left(0)+width(0)+1 caption FenHelp%,"AIDE" panel Frame%(5) parent Frame%(5),FenHelp% height Frame%(5),height_client(FenHelp%)-20 : width Frame%(5),width_client(FenHelp%)-20 top Frame%(5),10 : left Frame%(5),10 color frame%(5),255,0,0 Memo TextHelp% parent TextHelp%,Frame%(5) height TextHelp%,height_client(Frame%(5))-45 : width TextHelp%,width_client(Frame%(5))-10 top TextHelp%,5 : left TextHelp%,5 color TextHelp%,255,255,154 font_name TextHelp%,"Arial" : font_size TextHelp%,10 : font_bold TextHelp% RempTextHelp(TextHelp%) Button ButtClose2% parent ButtClose2%,Frame%(5) caption ButtClose2%,"Fermer" top ButtClose2%,height_client(Frame%(5))-height(ButtClose2%)-5 left ButtClose2%,(width_client(Frame%(5))-width(ButtClose2%))/2 font_name ButtClose2%,"Arial" : font_size ButtClose2%,10 : font_bold ButtClose2% cursor_point ButtClose2% on_click ButtClose2%,CLIC else show FenHelp% end_if End_sub ' ------------------------------------------------------------------------------ Sub RempTextHelp(obj%) dim_local i%,l$ for i%=1 to 18 l$=left$(hlp$,instr(hlp$,"|")-1) hlp$=right$(hlp$,len(hlp$)-instr(hlp$,"|")) item_add obj%,l$ next i% End_sub ' ------------------------------------------------------------------------------ Sub RazListTirages() clear BaseTir% item_add BaseTir%,string$(100,"=") item_add BaseTir%,chr$(32)+Date$ item_add BaseTir%,string$(100,"=") item_add BaseTir%,chr$(32)+"Heure"+string$(2,chr$(32))+"|"+chr$(32)+"Tirage"+string$(32,chr$(32))+"|"+chr$(32)+"Vos numéros" item_add BaseTir%,string$(100,"-") file_save BaseTir%,MemoTirages$ clear ListTir% file_load ListTir%,MemoTirages$ End_sub ' ------------------------------------------------------------------------------ Sub RazGrille() dim_local i% inactive ButtValid% inactive ButtListe% inactive ButtAbout% inactive ButtHelp% for i%=1 to 28 EtatButCx%(i%)=0 file_load ButtCx%(i%),ButtImg1$(i%) next i% mark_on optMise%(1) mark_on OptTirs%(1) RazPlateau() CreationPlateau(Scene1%) Cx%=0 active ButtValid% active ButtListe% active ButtAbout% active ButtHelp% End_sub ' ============================================================================== ' FONCTIONS ' ==============================================================================
- Vs Interprété:
- Vs Compilé:
| |
|