wood51
Messages : 72 Date d'inscription : 20/01/2013 Age : 43 Localisation : Orléans
| Sujet: Plugin Declaration pour PB Sam 2 Mar - 16:29 | |
| Salut , Le julénias ayant un peu (beaucoup ) altéré mon jugement , j'ai pensée qu'il ne fallait mieux pas s’attaquer au compilateur . J'ai donc fais une petite mise à jours de mon plugin PB . - Code:
-
; ///////////////////////////////////////////////////////////////////////////// ; Projet : DeclarePlugin V2 ; ; Fichier : DeclarePlugin.pb ; ; Date : 02/03/2013 ; ; Auteur(s) : Wood51 ; ; Description : Plugin de déclaration de fonction ; ; Utilisation : Ajouter outils perso dans PB ; Si Argument %TEMPFILE -> Déclare les fonctions de l'onglets en cours ; Si pas d'arguments -> Déclare les fonctions de tous les onglets ouvert ; ; License : FREE ; ///////////////////////////////////////////////////////////////////////////// CreateRegularExpression(0,"^ProcedureC?(DLL)?(.[a-z])? ")
FileName$ = ProgramParameter() If FileName$ = "" If ExamineEnvironmentVariables() While NextEnvironmentVariable() If EnvironmentVariableName() = "PB_TOOL_FileList" fileList$ = EnvironmentVariableValue() EndIf Wend EndIf nbFile = CountString(fileList$,Chr(10)) + 1 txt$ = "" For i = 1 To nbFile FileName$ = StringField(fileList$,i,Chr(10)) If ReadFile(1,FileName$) While Eof(1) = 0 line$ = ReadString(1) If MatchRegularExpression(0,line$) tmpTxt$+ ReplaceString(line$,"Procedure","Declare") + #CR$ EndIf Wend If tmpTxt$ <> "" txt$ + ";" + GetFilePart(FileName$) + #CR$ + tmpTxt$ + #CR$ tmpTxt$ = "" EndIf CloseFile(1) EndIf Next Else txt$ = "" If ReadFile(1,FileName$) While Eof(1) = 0 line$ = ReadString(1) If MatchRegularExpression(0,line$) txt$+ ReplaceString(line$,"Procedure","Declare") + #CR$ EndIf Wend CloseFile(0) ;DeleteFile(FileName$) EndIf EndIf
If txt$ <> "" SetClipboardText(txt$) MessageRequester("DeclarePlugin","Les déclarations ont été copiées dans le presse-papier") Else MessageRequester("DeclarePlugin","Aucune fonction à déclarer") EndIf
FreeRegularExpression(0) @+ David | |
|