Page 1 of 1

Adding automatically the Editor_BuidCount [Resolved]

Posted: Thu Oct 04, 2012 9:09 am
by Kwai chang caine
Hello,

I want to adding the Editor_BuidCount when i compile my EXE or DLL
For example if my Editor_BuidCount = 100 :
NamePrg + " " + VersionPrg.Editor_BuidCount.ExtensionPrg so finally "KccProgram v1.0.100.exe"

Have you a way for do that ??

Have a good day

Re: Adding automatically the Editor_BuidCount

Posted: Thu Oct 04, 2012 11:57 am
by Kwai chang caine
Finally, i found a way alone like a big :D
It's surelly the worst...:oops: but that works for EXE and DLL
When i compile an EXE or a DLL the Build is automatically adding between the end of fileName and the Extension
If someone have better...I would not be offended :mrgreen:

Create executable and create a PersonalTools

CommandLine = PathOfTheEXE\InsertBuildCompile.exe
Arguments = %EXECUTABLE|%FILE
Name = InsertBuildCompile
Event = After create executable
Check "Running hidden"
Check "Hide tool from menu"

Code: Select all

; Created by KCC
For i = 1 To CountProgramParameters()
 Parametres.s + Space(1) + ProgramParameter()
Next

Executable$ = Trim(StringField(Parametres, 1, "|"))
CodeSource$ = Trim(StringField(Parametres, 2, "|"))
ParametrePbBuildCount.s = Chr(059) + Chr(032) + Chr(069) + Chr(110) + Chr(097) + Chr(098) + Chr(108) + Chr(101) + Chr(066) + Chr(117) + Chr(105) + Chr(108) + Chr(100) + Chr(067) + Chr(111) + Chr(117) + Chr(110) + Chr(116) + Chr(032) + Chr(061) + Chr(032)

; Lecture du BuildCount
Canal = ReadFile(#PB_Any, CodeSource$)
     
If Canal
      
 Repeat
  
  Donnee$ = ReadString(Canal)
  
  If FindString(Donnee$, ParametrePbBuildCount, 1)
   BuildCount$ = Trim(ReplaceString(Donnee$, ParametrePbBuildCount, ""))
   Break
  EndIf 
  
 Until Eof(Canal) <> #False
       
 CloseFile(Canal)
      
EndIf

Extension$ = "." + GetExtensionPart(Executable$)

If GetFilePart(Executable$) <> "InsertBuildCompile.exe"
 
 If Not RenameFile(Executable$, ReplaceString(Executable$, Extension$, "") + " Build" + BuildCount$ + Extension$)
  MessageRequester("", "Impossible d'ajouter l'indice de compilation.")
 EndIf
 
EndIf 

Adding automatically the Editor_BuidCount [Resolved]

Posted: Thu Oct 04, 2012 1:22 pm
by Wood51
Thanks a lot KCC !!!
@+ Wood51

Re: Adding automatically the Editor_BuidCount [Resolved]

Posted: Thu Oct 04, 2012 7:27 pm
by Kwai chang caine
:wink:

Adding automatically the Editor_BuidCount [Resolved]

Posted: Sat Oct 06, 2012 8:39 am
by Wood51
Hi KCC !
While you talk about Plugin , I made one . It's about procedure's declarations . If you want test it : http://www.purebasic.fr/french/viewtopic.php?t=13220

@+ wood51

Re: Adding automatically the Editor_BuidCount [Resolved]

Posted: Sun Oct 07, 2012 7:22 pm
by Kwai chang caine
Yes very useful your PlugIn "Create declaration of procedure automaticaly" 8)
Like the regular expression is not my "cup of tea", i keep it :wink:
Thanks for sharing
Have a good day 8)

Re: Adding automatically the Editor_BuidCount [Resolved]

Posted: Sun Oct 07, 2012 7:33 pm
by Wood51
Kwaï chang caïne wrote: Like the regular expression is not my "cup of tea", i keep it :wink:
Me too, but I tested a nice Program who call "The Regex Coach" and this is very very very usefull for learn RegEx

For all about Thanks KCC
@+ Wood51

Re: Adding automatically the Editor_BuidCount [Resolved]

Posted: Sun Oct 07, 2012 7:38 pm
by Kwai chang caine
:wink: