FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  MembresMembres  Connexion  
Derniers sujets
» Gestion d'un système client-serveur.
Gosub with while[resolu] oubli du END Emptypar Pedro Aujourd'hui à 7:20

» item_index(résolu)
Gosub with while[resolu] oubli du END Emptypar jjn4 Mar 14 Mai 2024 - 19:38

» Bataille terrestre
Gosub with while[resolu] oubli du END Emptypar jjn4 Lun 13 Mai 2024 - 15:01

» SineCube
Gosub with while[resolu] oubli du END Emptypar Marc Sam 11 Mai 2024 - 12:38

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
Gosub with while[resolu] oubli du END Emptypar Marc Sam 11 Mai 2024 - 12:22

» Philharmusique
Gosub with while[resolu] oubli du END Emptypar jjn4 Ven 10 Mai 2024 - 13:58

» PANORAMIC V 1
Gosub with while[resolu] oubli du END Emptypar papydall Jeu 9 Mai 2024 - 3:22

» select intégrés [résolu]
Gosub with while[resolu] oubli du END Emptypar jjn4 Mer 8 Mai 2024 - 17:00

» number_mouse_up
Gosub with while[resolu] oubli du END Emptypar jjn4 Mer 8 Mai 2024 - 11:59

» Aide de PANORAMIC
Gosub with while[resolu] oubli du END Emptypar jjn4 Mer 8 Mai 2024 - 11:16

» trop de fichiers en cours
Gosub with while[resolu] oubli du END Emptypar lepetitmarocain Mer 8 Mai 2024 - 10:43

» Je teste PANORAMIC V 1 beta 1
Gosub with while[resolu] oubli du END Emptypar papydall Mer 8 Mai 2024 - 4:17

» bouton dans autre form que 0(résolu)
Gosub with while[resolu] oubli du END Emptypar leclode Lun 6 Mai 2024 - 13:59

» KGF_dll - nouvelles versions
Gosub with while[resolu] oubli du END Emptypar Klaus Lun 6 Mai 2024 - 11:41

» @Jack
Gosub with while[resolu] oubli du END Emptypar Jack Mar 30 Avr 2024 - 20:40

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mai 2024
LunMarMerJeuVenSamDim
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendrierCalendrier
Le Deal du moment :
Bon plan achat en duo : 2ème robot cuiseur ...
Voir le deal
600 €

 

 Gosub with while[resolu] oubli du END

Aller en bas 
2 participants
AuteurMessage
659_minifly




Nombre de messages : 590
Age : 75
Localisation : Valenciennes Nord
Date d'inscription : 29/04/2010

Gosub with while[resolu] oubli du END Empty
MessageSujet: Gosub with while[resolu] oubli du END   Gosub with while[resolu] oubli du END EmptySam 17 Sep 2011 - 19:00

J'ai un Pb au return du sub
message" return sans gosub"


Voila le programme

Code:


Label  Sub_Ouverture_Map
Label  Lecture_ligne
' Label  Sub_Lecture_Map

 Dim Chaine$,Long,Caractere$,Pos,X_tile,Y_tile ,Dummy$
 Dim NTX
 Dim NTY
 Dim DTX
 Dim DTY
 Dim Tbl_tile$(255,11)
 Dim indice
 Dim NG
print "Répertoire courant: "+dir_current$

Rem Ouverture fichier Map
' Ouverture du fichier Map
file_open_read 1,"Map_01.map"
gosub Sub_Ouverture_Map


end ' j'avais oublié de mettre le END

Sub_Ouverture_Map:

Rem toutes les lignes qui commançent par "'" sont considérées comme commentaires

' Ouverture du fichier Map
' file_open_read 1,"Map_01.map"

' Lecture d'une ligne
' Boucle sur la lecture jusqu'a la fin du fichier

while file_eof(1) <> 1


' Lecture d'un ligne dans le fichier
 file_readln 1,Chaine$
 
 ' On retire les blancs si il y en a
 Chaine$=trim$(Chaine$)
'  print chaine$
' Longueur de la chaine
    Long=Len(Chaine$)
   
' Récupération du premier caractère
Caractere$=Left$(Chaine$,1)

' Si c'est une ligne blanche on retourne a la lecture d'un ligne
If Caractere$=""  then goto Lecture_ligne

' Si c'est un commentaire on retourne a la lecture d'un ligne
If Caractere$="'"  then goto Lecture_ligne

' Nombre de tiles ex X du map
 pos=instr(Chaine$,"NTX=")
 If pos>0
    NTX=Mid$(chaine$,5,10)
    goto Lecture_ligne
 end_if
 
 ' Nombre de tiles ex Y du map
 pos=instr(Chaine$,"NTY=")
 If pos>0
    NTY=Mid$(chaine$,5,10)
    goto Lecture_ligne
 end_if

' Largeur d'une tiles ex X
 pos=instr(Chaine$,"DTX=")
 If pos>0
    DTX=Mid$(chaine$,5,10)
    goto Lecture_ligne
 end_if
 
 ' Hauteur d'une tiles ex Y
 pos=instr(Chaine$,"DTY=")
 If pos>0
    DTY=Mid$(chaine$,5,10)
    goto Lecture_ligne
 end_if
 
 ' Numéro du tile dans la grille map
 pos=instr(Chaine$,"Numero tile=")
 If pos>0
    Indice=Mid$(chaine$,13,10)
    tbl_tile$(Indice,0)=Indice
    goto Lecture_ligne
 end_if
 
  ' Nom fichier de dessin de la map
 pos=instr(Chaine$,"Nom fichier=")
 If pos>0
    tbl_tile$(indice,1)=Mid$(chaine$,13,500)
    goto Lecture_ligne
 end_if

  ' Mobilité 0=immobile 1=mobile
 pos=instr(Chaine$,"Mobile=")
 If pos>0
    tbl_tile$(Indice,2)=Mid$(chaine$,8,10)
    goto Lecture_ligne
 end_if

    ' Si le tile est un acteur
 pos=instr(Chaine$,"Acteur=")
 If pos>0
    tbl_tile$(Indice,3)=Mid$(chaine$,8,10)
    goto Lecture_ligne
 end_if

    ' Si le tile est franchissable 0=non 1=oui
 pos=instr(Chaine$,"Franchissable=")
 If pos>0
    tbl_tile$(Indice,4)=Mid$(chaine$,15,10)
    goto Lecture_ligne
 end_if

    ' Si on peut remplacer le tile  par un autre 0=non 1=oui
 pos=instr(Chaine$,"Remplace=")
 If pos>0
    tbl_tile$(Indice,5)=Mid$(chaine$,10,10)
    goto Lecture_ligne
 end_if

    ' Nom du fichier de remplacement
 pos=instr(Chaine$,"Remplacement=")
 If pos>0
    tbl_tile$(Indice,6)=Mid$(chaine$,14,10)
    goto Lecture_ligne
 end_if

    ' Si la tile a du son
 pos=instr(Chaine$,"Son=")
 If pos>0
    tbl_tile$(Indice,7)=Mid$(chaine$,5,10)
    goto Lecture_ligne
 end_if

    ' Nom du fichier son
 pos=instr(Chaine$,"Nom son=")
 If pos>0
    tbl_tile$(Indice,8)=Mid$(chaine$,9,500)
    goto Lecture_ligne
 end_if

    ' Numéro du timer
 pos=instr(Chaine$,"Numero timer=")
 If pos>0
    tbl_tile$(Indice,9)=Mid$(chaine$,14,10)
    goto Lecture_ligne
 end_if

    ' Numéro du timer
 pos=instr(Chaine$,"Time=")
 If pos>0
    tbl_tile$(Indice,10)=Mid$(chaine$,6,10)
    goto Lecture_ligne
 end_if
 ' -----------------------------------------------------------------------------
    ' Numéro de la grille
 pos=instr(Chaine$,"Grille=")
 If pos>0
    NG=Mid$(chaine$,8,10)
'    gosub Sub_Lecture_Map
    print NG
 end_if


Lecture_ligne:

end_while
return

' Sub_Lecture_Map:
' If long>0


' end_if

' return
 

Voila le fichier a lire a enregistrer sous "Map_01.map"

Code:


'   
'

' Nombre de tiles en x et y
NTY=5
NTX=5

' Dimensions des tiles
DTX=64
DTY=64

' Numéro du tile dans la grille
Numero tile=1
' Nom du fichier image de ce tile
Nom fichier=fond.bmp
' Deplacement 0=non autorisé 1=autorisé
Mobile=0
' Si c'est un acteur ( a voir si nécessaire)
Acteur=0
' Franchissable 0=non 1=oui
Franchissable=1
' Remplacement du tile 0=non 1=oui
remplace=0
' Fichier de remplacement ex porte ouverte fermée
Remplacement=""
' Fichier son 0=non 1=oui
Son=0
' Nom du fichier son
Nom son=""
' Numero timer
Numero timer=0
' Valeur timer
time=0

' Numéro du tile dans la grille
Numero tile=2
' Nom du fichier image de ce tile
Nom fichier=mur.bmp
' Deplacement 0=non autorisé 1=autorisé
Mobile=0
' Si c'est un acteur ( a voir si nécessaire)
Acteur=0
' Franchissable 0=non 1=oui
Franchissable=1
' Remplacement du tile 0=non 1=oui
remplace=0
' Fichier de remplacement ex porte ouverte fermée
Remplacement=""
' Fichier son 0=non 1=oui
Son=0
' Nom du fichier son
Nom son=""
' Numero timer
Numero timer=0
' Valeur timer
time=0

' numéro de La grille
Grille=1

11111
12221
12111
12221
11111
Revenir en haut Aller en bas
Jicehel

Jicehel


Nombre de messages : 5947
Age : 51
Localisation : 77500
Date d'inscription : 18/04/2011

Gosub with while[resolu] oubli du END Empty
MessageSujet: Re: Gosub with while[resolu] oubli du END   Gosub with while[resolu] oubli du END EmptySam 17 Sep 2011 - 20:13

-supprimé -

Revenir en haut Aller en bas
 
Gosub with while[resolu] oubli du END
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» [Résolu]L'objet TIMER perturbe les GOSUB et/ou les FREE ?
» un oubli
» Trop de gosub...
» Utilitaire Designer: générer une structure Panoramic valide
» Fenetres filles

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: A l'aide!-
Sauter vers: