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
» Form(résolu)
Création de fonctions inexistantes en Panoramic. Emptypar leclode Hier à 17:59

» trop de fichiers en cours
Création de fonctions inexistantes en Panoramic. Emptypar Marc Hier à 11:42

» Bataille navale SM
Création de fonctions inexistantes en Panoramic. Emptypar jjn4 Ven 26 Avr 2024 - 17:39

» Une calculatrice en une ligne de programme
Création de fonctions inexistantes en Panoramic. Emptypar jean_debord Ven 26 Avr 2024 - 8:01

» Gestion d'un système client-serveur.
Création de fonctions inexistantes en Panoramic. Emptypar Pedro Jeu 25 Avr 2024 - 19:31

» Les maths du crocodile
Création de fonctions inexistantes en Panoramic. Emptypar jean_debord Jeu 25 Avr 2024 - 10:37

» Naissance de Crocodile Basic
Création de fonctions inexistantes en Panoramic. Emptypar jean_debord Jeu 25 Avr 2024 - 8:45

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
Création de fonctions inexistantes en Panoramic. Emptypar Froggy One Mer 24 Avr 2024 - 18:38

» Dessine-moi une galaxie
Création de fonctions inexistantes en Panoramic. Emptypar jjn4 Lun 22 Avr 2024 - 13:47

» Erreur END_SUB
Création de fonctions inexistantes en Panoramic. Emptypar jjn4 Lun 22 Avr 2024 - 13:43

» Bug sur DIM_LOCAL ?
Création de fonctions inexistantes en Panoramic. Emptypar papydall Dim 21 Avr 2024 - 23:30

» 2D_fill_color(résolu)
Création de fonctions inexistantes en Panoramic. Emptypar leclode Sam 20 Avr 2024 - 8:32

» Consommation gaz électricité
Création de fonctions inexistantes en Panoramic. Emptypar leclode Mer 17 Avr 2024 - 11:07

» on_key_down (résolu)
Création de fonctions inexistantes en Panoramic. Emptypar leclode Mar 16 Avr 2024 - 11:01

» Sous-programme(résolu)
Création de fonctions inexistantes en Panoramic. Emptypar jjn4 Jeu 4 Avr 2024 - 14:42

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Avril 2024
LunMarMerJeuVenSamDim
1234567
891011121314
15161718192021
22232425262728
2930     
CalendrierCalendrier
Le Deal du moment : -45%
WHIRLPOOL OWFC3C26X – Lave-vaisselle pose libre ...
Voir le deal
339 €

 

 Création de fonctions inexistantes en Panoramic.

Aller en bas 
AuteurMessage
pan59

pan59


Nombre de messages : 367
Age : 66
Localisation : Wattignies
Date d'inscription : 16/10/2011

Création de fonctions inexistantes en Panoramic. Empty
MessageSujet: Création de fonctions inexistantes en Panoramic.   Création de fonctions inexistantes en Panoramic. EmptyMar 12 Nov 2013 - 14:41

Bonjour à tous.

Je viens de développer un programme afin de créer des fonctions inexistantes en Panoramic.

Bon usage à tous, et merci d'avance de vos commentaires et suggestions.

Code:
dim a$, b$, dernier_argument$, fonction$, liste_argument$, resultat$, t$
dim argument$(10)
dim kk%, res%, resultat%, true%, yy%

true%=1

label traiter_fonction

edit 100
left 100,-200
on_change 100,traiter_fonction

' Placer les arguments chaînes entre '' et non entre "".
' Correspond à b$=TrimLeft$("-----Bonjour","-")
text 100,"TrimLeft$('-----Bonjour','-',b$)"
message b$

text 100,"Instr('Bonjour','j',5,res%)"
message str$(res%)

end

traiter_fonction:

   t$=text$(100)
   if len(t$)>0
      t$=left$(t$,len(t$)-1)

      yy%=instr(t$,"(")
      fonction$=left$(t$,yy%-1)
      liste_argument$=mid$(t$,yy%+1,len(t$))
  
      lire_arguments()
  
      traiter_fonction()
  
      enregistrer_resultat()
   end_if
  
return

sub lire_arguments()

    kk%=0
    while true%=1
        yy%=instr(liste_argument$,",")
        if yy%=0 then exit_while
        
        kk%=kk%+1
        argument$(kk%)=left$(liste_argument$,yy%-1)
        if left$(argument$(kk%),1)="'"
           argument$(kk%)=left$(argument$(kk%),len(argument$(kk%))-1)
           argument$(kk%)=mid$(argument$(kk%),2,len(argument$(kk%)))
        end_if

        liste_argument$=mid$(liste_argument$,yy%+1,len(liste_argument$))
    end_while

    dernier_argument$=liste_argument$

end_sub

sub traiter_fonction()

    if fonction$="TrimLeft$"
       resultat$=argument$(1)
       while true%=1
             if left$(resultat$,1)<>argument$(2) then exit_while
             resultat$=mid$(resultat$,2,len(resultat$))
       end_while
    end_if

    ' Instr('Bonjour','j',5,res%)
    if fonction$="Instr"
       resultat%=val(argument$(3))+instr(mid$(argument$(1),val(argument$(3)),len(argument$(1))),argument$(2))
       if resultat%<val(argument$(3)) then resultat%=0
    end_if

end_sub

sub enregistrer_resultat()

    if dernier_argument$="a$" then a$=resultat$
    if dernier_argument$="b$" then b$=resultat$
    
    if dernier_argument$="res%" then res%=resultat%
    
end_sub
Revenir en haut Aller en bas
 
Création de fonctions inexistantes en Panoramic.
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Pour Klaus et Jack: création de fonctions inexistantes.
» Auto création d'un Menu Panoramic
» Programme création de site web en Panoramic
» Assistant de création de menu Panoramic
» Création d'un '.exe' à partir d'un programme Panoramic.

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: Vos sources, vos utilitaires à partager-
Sauter vers: