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
» PANORAMIC V 1
Gosub with while[resolu] oubli du END Emptypar papydall Aujourd'hui à 2:21

» Gestion d'un système client-serveur.
Gosub with while[resolu] oubli du END Emptypar Klaus Hier à 23:59

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
Gosub with while[resolu] oubli du END Emptypar Marc Hier à 12:14

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

» trop de fichiers en cours
Gosub with while[resolu] oubli du END Emptypar papydall Lun 29 Avr 2024 - 23:39

» Une calculatrice en une ligne de programme
Gosub with while[resolu] oubli du END Emptypar jean_debord Dim 28 Avr 2024 - 8:47

» Form(résolu)
Gosub with while[resolu] oubli du END Emptypar leclode Sam 27 Avr 2024 - 17:59

» Bataille navale SM
Gosub with while[resolu] oubli du END Emptypar jjn4 Ven 26 Avr 2024 - 17:39

» Les maths du crocodile
Gosub with while[resolu] oubli du END Emptypar jean_debord Jeu 25 Avr 2024 - 10:37

» Naissance de Crocodile Basic
Gosub with while[resolu] oubli du END Emptypar jean_debord Jeu 25 Avr 2024 - 8:45

» Dessine-moi une galaxie
Gosub with while[resolu] oubli du END Emptypar jjn4 Lun 22 Avr 2024 - 13:47

» Erreur END_SUB
Gosub with while[resolu] oubli du END Emptypar jjn4 Lun 22 Avr 2024 - 13:43

» Bug sur DIM_LOCAL ?
Gosub with while[resolu] oubli du END Emptypar papydall Dim 21 Avr 2024 - 23:30

» 2D_fill_color(résolu)
Gosub with while[resolu] oubli du END Emptypar leclode Sam 20 Avr 2024 - 8:32

» Consommation gaz électricité
Gosub with while[resolu] oubli du END Emptypar leclode Mer 17 Avr 2024 - 11:07

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 : -40%
Tefal Ingenio Emotion – Batterie de cuisine 10 ...
Voir le deal
59.99 €

 

 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
» Utilitaire Designer: générer une structure Panoramic valide
» Trop de gosub...
» 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: