IDE-Tool : NewSourceTemplate - NST

Du brauchst Grafiken, gute Programme oder Leute die dir helfen? Frag hier.
Benutzeravatar
Bisonte
Beiträge: 2427
Registriert: 01.04.2007 20:18

IDE-Tool : NewSourceTemplate - NST

Beitrag von Bisonte »

Hallo.

Um dem neuen "Feature" der 5.00Beta2 zu huldigen, hab ich da mal was vorbereitet ;)

Werkzeugeinstellungen :

Kommandozeile : hier die NST.exe mit kompletten Pfad
Argumente :
"@TEMPLATEFILE:VollerPfaddesTemplatefile" - Hier kann ein eigenes Templatefile eingestellt werden.
"@AUTHOR:Name des Authors" - Hier kann dein Name eingetragen werden.
Die Argumente sind nicht zwingend notwendig.
Sollte kein Templatefile gefunden werden wird ein Standard Template genommen.
Ansonsten bleiben die Platzhalter einfach leer innerhalb des Templates...

Ereignis zum Auslösen des Werkzeugs : New sourcecode created (anscheinend ist das noch nicht übersetzt)

Haken bei :
Warten bis zum Beenden des Werkzeugs
Werkzeug vom Hauptmenu verstecken
und fertig konfiguriert.

Als bisherige Platzhalter wären im Angebot :

%AUTHOR%, %PBVERSION%, %DATE%

hier mal ein Beispiel-Templatefile ... ich nenne es mal nsc.txt

Code: Alles auswählen

; -----------------------------------------------------------------------------
; - Project       : 
; - Author        : George Bisonte
; - Date          : %DATE%
; - PB-Version 	: %PBVERSION%
; -----------------------------------------------------------------------------
; Description     :
; -----------------------------------------------------------------------------
; License         :
; -----------------------------------------------------------------------------
EnableExplicit
;
würde dann bei "Argumente" in dem Werkzeugkonfigurationsfenster so aussehen:
"@TEMPLATEFILE:D:\nsc.txt"

und hier nun das Tool...

Code: Alles auswählen

;-@TOP
; ----------------------------------------------------------------------------
; -
; - File      : NewSourceTemplate
; - Author    : George Bisonte
; - Date      : September 1st, 2012
; - PBVersion : V5.00 Beta 2
; - Windows only : IDE_SendText()
; ----------------------------------------------------------------------------
EnableExplicit
;
Procedure.s IDE_GetPureBasicCompilerVersion()
  
  ; Holt sich die Versionsnummer der PBCompiler.exe
  ; Original : Droopy's Lib
  
  Protected hCompiler, Version.s = "n/a", f
  Protected PBC.s = GetEnvironmentVariable("PB_TOOL_Compiler")
  
  If FileSize(PBC) > 0
    hCompiler = RunProgram(PBC, "/VERSION", "", #PB_Program_Open|#PB_Program_Read|#PB_Program_Hide)
    If hCompiler
      While ProgramRunning(hCompiler)
        If AvailableProgramOutput(hCompiler)
          Version = ReadProgramString(hCompiler)
          CloseProgram(hCompiler)
          If Version <> "n/a"
            f = FindString(Version, "(")
            If f
              Version = Mid(Version, 1, f-2)
            EndIf
            Version = ReplaceString(Version, "PureBasic ", "V")
          EndIf
          ProcedureReturn Version
        EndIf
      Wend
    EndIf    
  EndIf
  
  ProcedureReturn Version
  
EndProcedure
Procedure   IDE_SendText(buffer.s)
  
  ; Sendet Buffer.s zum aktuellen Quellcode
  ; Original from ts-soft 
  
  Protected hProc, mem, bW, hsci, len, pid, Result = #False
  
  hsci = Val(GetEnvironmentVariable("PB_TOOL_Scintilla"))
  If GetWindowThreadProcessId_(hsci, @pid)
    hProc = OpenProcess_(#PROCESS_ALL_ACCESS, #False, pid)
  EndIf
  
  If hProc
    
    len = Len(buffer)
    mem = VirtualAllocEx_(hProc, 0, len, #MEM_RESERVE | #MEM_COMMIT, #PAGE_EXECUTE_READWRITE)
    
    If mem
      WriteProcessMemory_(hProc, mem, @buffer, len, @bW)
      SendMessage_(hsci, #SCI_ADDTEXT, len, mem)
      VirtualFreeEx_(hProc, mem, len, #MEM_RELEASE)
    EndIf
    
    CloseHandle_(hProc)
    Result = #True
    
  EndIf
  
  ProcedureReturn Result
  
EndProcedure
Procedure   NST_ReadTemplate(FileName.s, List File.s())
  
  Protected Nr
  
  If FileSize(FileName)>0
    ClearList(File())
    Nr = ReadFile(#PB_Any, FileName)
    If Nr
      While Not Eof(Nr)
        AddElement(File())
        File() = ReadString(Nr, #PB_UTF8)
      Wend
      CloseFile(Nr)  
    EndIf
  Else
    AddElement(File()) : File() = ";-@TOP"
    AddElement(File()) : File() = "; ----------------------------------------------------------------------------"
    AddElement(File()) : File() = "; -"
    AddElement(File()) : File() = "; - File      : "
    AddElement(File()) : File() = "; - Author    : %AUTHOR%"
    AddElement(File()) : File() = "; - Date      : %DATE%"
    AddElement(File()) : File() = "; - PBVersion : %PBVERSION%"
    AddElement(File()) : File() = "; -"
    AddElement(File()) : File() = "; ----------------------------------------------------------------------------"
  EndIf
  
  ProcedureReturn ListSize(File())
  
EndProcedure
Procedure   Main()
  
  Protected PCount = CountProgramParameters()
  Protected Dim PParam.s(PCount)
  Protected i, pp.s, help.s
  Protected Dim Replacer.s(2)
  Protected TemplateFile.s = "", Author.s = ""
  Protected NewList File.s()

  For i = 0 To PCount -1
    pp.s = ProgramParameter(i)
    If UCase(Left(pp, Len("@TEMPLATEFILE:"))) = "@TEMPLATEFILE:"
      TemplateFile = Mid(pp, Len("@TEMPLATEFILE:")+1) 
    EndIf
    If UCase(Left(pp, Len("@AUTHOR:"))) = "@AUTHOR:"
      Author = Mid(pp, Len("@AUTHOR:")+1) 
    EndIf   
  Next i
  
  NST_ReadTemplate(TemplateFile.s, File())
  
  CreateRegularExpression(0,"%DATE%")
  CreateRegularExpression(1,"%AUTHOR%")
  CreateRegularExpression(2,"%PBVERSION%")
  
  Replacer(0) = FormatDate("%dd.%mm.%yyyy",Date())
  Replacer(1) = Author
  Replacer(2) = IDE_GetPureBasicCompilerVersion()
  
  ForEach File()
    
    help = File()
    
    For i=0 To 2
      If MatchRegularExpression(i, File())
        help = ReplaceRegularExpression(i, File(), Replacer(i))
      EndIf
    Next i    
    
    File() = help
    
  Next
  
  help = ""
  
  ForEach File()
    help + File() + #CR$     
  Next
  
  If IDE_SendText(help) = #False
    MessageRequester("Fehler","Das Programm kann nicht außerhalb von PureBasic gestartet werden!")
  EndIf
  
EndProcedure : Main()

Anregungen (besonders wie man das ganze auch für Linux und MAC hinbekommt - IDE_SendText() von ts-soft ) , Erweiterungen usw...
Immer her damit :mrgreen:
PureBasic 6.04 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
Benutzeravatar
ts-soft
Beiträge: 22292
Registriert: 08.09.2004 00:57
Computerausstattung: Mainboard: MSI 970A-G43
CPU: AMD FX-6300 Six-Core Processor
GraKa: GeForce GTX 750 Ti, 2 GB
Memory: 16 GB DDR3-1600 - Dual Channel
Wohnort: Berlin

Re: IDE-Tool : NewSourceTemplate - NST

Beitrag von ts-soft »

Warum schreibst Du nicht einfach ins "%TEMPFILE" ?
Du musst doch nicht in Scintilla schreiben. Dann hast Du es auch Crossplattform.

Gruß
Thomas

/Edit: Hier mal meine simple Version:

Code: Alles auswählen

; Configure as
;
; Commandline: "%TEMPFILE"
; Trigger: "New Sourcecode created"
; [x] Wait until tool quits
; [x] Reload Source after tool has quit
;      (x) into current source
; [x] Hide tool from the Main menu
;
File$ = ProgramParameter()
If CreateFile(0, File$)
  WriteStringFormat(0, #PB_UTF8)  
  WriteStringN(0, "; #############################################################")
  WriteStringN(0, "; # Erstellt am: " + FormatDate("%dd.%mm.%yyyy %hh:%ii", Date()))
  WriteStringN(0, "; # Copyright " + FormatDate("%yyyy", Date()) + " by Thomas <ts-soft> Schulz")
  WriteStringN(0, "; #############################################################")
  WriteStringN(0, "")
  CloseFile(0)
EndIf 
PureBasic 5.73 LTS | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.
Bild
Benutzeravatar
Bisonte
Beiträge: 2427
Registriert: 01.04.2007 20:18

Re: IDE-Tool : NewSourceTemplate - NST

Beitrag von Bisonte »

:coderselixir: ich war geblendet.... Der Wald und die Bäume....

Jetzt wo du das so erwähnst (beiss in die Tischplatte) ;)

Aber mal davon ab... Ist eine crossplattformvariante für das Schreiben in das Scintilla Window der IDE bekannt ?
PureBasic 6.04 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
Benutzeravatar
ts-soft
Beiträge: 22292
Registriert: 08.09.2004 00:57
Computerausstattung: Mainboard: MSI 970A-G43
CPU: AMD FX-6300 Six-Core Processor
GraKa: GeForce GTX 750 Ti, 2 GB
Memory: 16 GB DDR3-1600 - Dual Channel
Wohnort: Berlin

Re: IDE-Tool : NewSourceTemplate - NST

Beitrag von ts-soft »

Du solltest auch das standard Text-Format berücksichtigen:
PureBasic.prefs hat geschrieben:[CompilerDefaults]
TextEncoding = 1
1 = UTF-8, 0 = ASCII

/edit:
hier ein Beispiel:

Code: Alles auswählen

Procedure.s ReadPBPrefs(group.s, key.s, file.s = "purebasic.prefs")
  Protected Path.s, slash.s, result.s
  
  CompilerSelect #PB_Compiler_OS
    CompilerCase #PB_OS_Windows
      slash = "\"
      Path = GetEnvironmentVariable("APPDATA") + "\purebasic\"
    CompilerDefault
      slash = "/"
      Path = GetHomeDirectory() + ".purebasic/"   
  CompilerEndSelect
    If OpenPreferences(path + file)
      PreferenceGroup(group)
      result = ReadPreferenceString(key, "")
      ClosePreferences()
    EndIf
    ProcedureReturn result
EndProcedure

Define.s File = ProgramParameter()
Define Format
If CreateFile(0, File)
  Select ReadPBPrefs("CompilerDefaults", "TextEncoding")
    Case "1"
      Format = #PB_UTF8
    Default
      Format = #PB_Ascii
  EndSelect
  WriteStringFormat(0, Format)
  ; ...
PureBasic 5.73 LTS | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.
Bild
Benutzeravatar
HeX0R
Beiträge: 2954
Registriert: 10.09.2004 09:59
Computerausstattung: AMD Ryzen 7 5800X
96Gig Ram
NVIDIA GEFORCE RTX 3060TI/8Gig
Win10 64Bit
G19 Tastatur
2x 24" + 1x27" Monitore
Glorious O Wireless Maus
PB 3.x-PB 6.x
Oculus Quest 2
Kontaktdaten:

Re: IDE-Tool : NewSourceTemplate - NST

Beitrag von HeX0R »

Besser die Umgebungsvariable PB_TOOL_Preferences nehmen, dann wird auch bei /PORTABLE Aufrufen die richtige Preference-Datei gelesen.
Benutzeravatar
ts-soft
Beiträge: 22292
Registriert: 08.09.2004 00:57
Computerausstattung: Mainboard: MSI 970A-G43
CPU: AMD FX-6300 Six-Core Processor
GraKa: GeForce GTX 750 Ti, 2 GB
Memory: 16 GB DDR3-1600 - Dual Channel
Wohnort: Berlin

Re: IDE-Tool : NewSourceTemplate - NST

Beitrag von ts-soft »

@HeX0R
Guter Hinweis. Hab ich nicht dran gedacht, da ich nur eine IDE nutze (für 12 Compiler-Versionen).
PureBasic 5.73 LTS | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.
Bild
Benutzeravatar
ts-soft
Beiträge: 22292
Registriert: 08.09.2004 00:57
Computerausstattung: Mainboard: MSI 970A-G43
CPU: AMD FX-6300 Six-Core Processor
GraKa: GeForce GTX 750 Ti, 2 GB
Memory: 16 GB DDR3-1600 - Dual Channel
Wohnort: Berlin

Re: IDE-Tool : NewSourceTemplate - NST

Beitrag von ts-soft »

Hier mal meine aktuelle Version, unterstützt keine Templatedatei (halte ich auch nicht für notwendig).

Code: Alles auswählen

; Configure as
;
; Commandline: "%TEMPFILE"
; Trigger: "New Sourcecode created"
; [x] Wait until tool quits
; [x] Reload Source after tool has quit
;      (x) into current source
; [x] Hide tool from the Main menu
;

EnableExplicit

#APP_NAME_DEFAULT$ = "Demo"
#AUTHOR_DEFAULT$ = "Thomas <ts-soft> Schulz"
#VERSION_DEFAULT$ = "1.0"

Procedure.s GetPBCompilerVersion()
  Protected Compiler, result.s
  CompilerSelect #PB_Compiler_OS
    CompilerCase #PB_OS_Windows
      Compiler = RunProgram(GetEnvironmentVariable("PB_TOOL_Compiler"), "/STANDBY", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Write | #PB_Program_Hide)
    CompilerDefault
      Compiler = RunProgram(GetEnvironmentVariable("PB_TOOL_Compiler"), "--standby", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Write | #PB_Program_Hide)
  CompilerEndSelect
  If Compiler
    result = StringField(ReadProgramString(Compiler), 3, #TAB$)
    WriteProgramStringN(Compiler, "END")
    CloseProgram(Compiler)
  EndIf
  ProcedureReturn result
EndProcedure

Procedure.s ReadPBPrefs(group.s, key.s)
  Protected result.s, prefs.s = GetEnvironmentVariable("PB_TOOL_Preferences")
  
  If OpenPreferences(prefs)
    PreferenceGroup(group)
    result = ReadPreferenceString(key, "")
    ClosePreferences()
  EndIf
  ProcedureReturn result
EndProcedure

Define.s File = ProgramParameter()
Define FF, Format
FF = CreateFile(#PB_Any, File)
If FF
  Select ReadPBPrefs("CompilerDefaults", "TextEncoding")
    Case "1"
      Format = #PB_UTF8
    Default
      Format = #PB_Ascii
  EndSelect
  WriteStringFormat(FF, Format)
  WriteStringN(FF, "; ==============================================================", Format)
  WriteStringN(FF, "; Created on:      " + FormatDate("%dd/%mm/%yyyy %hh:%ii", Date()), Format)
  WriteStringN(FF, ";", Format)
  WriteStringN(FF, "; App/Lib-Name:    " + #APP_NAME_DEFAULT$, Format)
  WriteStringN(FF, "; Author:          " + #AUTHOR_DEFAULT$, Format)
  WriteStringN(FF, "; Version:         " + #VERSION_DEFAULT$, Format)
  WriteStringN(FF, "; Compiler:        " + GetPBCompilerVersion(), Format)
  WriteStringN(FF, "; ==============================================================", Format)
  WriteStringN(FF, "", Format)
  WriteStringN(FF, "EnableExplicit", Format)
  WriteStringN(FF, "", Format)
  CloseFile(FF)
EndIf 
Ist Crossplattform und sollte sich jeder für seine Bedürfnisse erweitern können.

Hoffentlich ist Bisonte jetzt nicht verärgert :oops:

Sieht dann so aus:

Code: Alles auswählen

; ==============================================================
; Created on:      02/09/2012 15:21
;
; App/Lib-Name:    Demo
; Author:          Thomas <ts-soft> Schulz
; Version:         1.0
; Compiler:        PureBasic 5.00 Beta 2 (Windows - x64)
; ==============================================================

EnableExplicit

Gruß
Thomas
PureBasic 5.73 LTS | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.
Bild
Benutzeravatar
Bisonte
Beiträge: 2427
Registriert: 01.04.2007 20:18

Re: IDE-Tool : NewSourceTemplate - NST

Beitrag von Bisonte »

Warum sollte ich da verärgert sein ?

Dafür ist das Forum da... ich hätt ja auch meine Finger stillhalten können ;)
Jeder baut es sich auf seine Weise und es ist interessant zu sehen wie andere zur Lösung kommen...

Mich würde halt noch interessieren, wie man halt auf anderen OS das "Editorfeld" der IDE beschreiben kann,
damit man vielleicht IDETools nicht immer "nur" für Windows bastelt.
PureBasic 6.04 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
Benutzeravatar
Rings
Beiträge: 971
Registriert: 29.08.2004 08:48

Re: IDE-Tool : NewSourceTemplate - NST

Beitrag von Rings »

Danke euch für den Source/Das Tool.
Sowas gehört zwar eigentlich direkt in die IDE, aber gut das
man es auch selbst so erstellen kann
Rings hat geschrieben:ziert sich nich beim zitieren
Benutzeravatar
ts-soft
Beiträge: 22292
Registriert: 08.09.2004 00:57
Computerausstattung: Mainboard: MSI 970A-G43
CPU: AMD FX-6300 Six-Core Processor
GraKa: GeForce GTX 750 Ti, 2 GB
Memory: 16 GB DDR3-1600 - Dual Channel
Wohnort: Berlin

Re: IDE-Tool : NewSourceTemplate - NST

Beitrag von ts-soft »

Hier noch eine erweiterte Version:

Code: Alles auswählen

; Configure as
;
; Commandline: "%TEMPFILE"
; Trigger: "New Sourcecode created"
; [x] Wait until tool quits
; [x] Reload Source after tool has quit
;      (x) into current source
; [x] Hide tool from the Main menu
;

EnableExplicit

#APP_NAME_DEFAULT$ = "Example"
#AUTHOR_DEFAULT$ = "Thomas <ts-soft> Schulz"
#VERSION_DEFAULT$ = "0.0"

Procedure.s GetPBCompilerVersion()
  Protected Compiler, result.s
  CompilerSelect #PB_Compiler_OS
    CompilerCase #PB_OS_Windows
      Compiler = RunProgram(GetEnvironmentVariable("PB_TOOL_Compiler"), "/STANDBY", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Write | #PB_Program_Hide)
    CompilerDefault
      Compiler = RunProgram(GetEnvironmentVariable("PB_TOOL_Compiler"), "--standby", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Write | #PB_Program_Hide)
  CompilerEndSelect
  If Compiler
    result = StringField(ReadProgramString(Compiler), 3, #TAB$)
    WriteProgramStringN(Compiler, "END")
    CloseProgram(Compiler)
  EndIf
  ProcedureReturn result
EndProcedure

Procedure.s ReadPBPrefs(group.s, key.s)
  Protected result.s, prefs.s = GetEnvironmentVariable("PB_TOOL_Preferences")
  
  If OpenPreferences(prefs)
    PreferenceGroup(group)
    result = ReadPreferenceString(key, "")
    ClosePreferences()
  EndIf
  ProcedureReturn result
EndProcedure

Define.s File = ProgramParameter()
Define FF, Format
FF = CreateFile(#PB_Any, File)
If FF
  Select ReadPBPrefs("CompilerDefaults", "TextEncoding")
    Case "1"
      Format = #PB_UTF8
    Default
      Format = #PB_Ascii
  EndSelect
  WriteStringFormat(FF, Format)
  WriteStringN(FF, "; ==============================================================", Format)
  WriteStringN(FF, "; COMPILER OPTIONS:", Format)
  Select ReadPBPrefs("CompilerDefaults", "InlineASM")
    Case "0"
      WriteStringN(FF, ";  [ ] Enable inline ASM support", Format)
    Default
      WriteStringN(FF, ";  [x] Enable inline ASM support", Format)
  EndSelect
  Select ReadPBPrefs("CompilerDefaults", "Unicode")
    Case "0"
      WriteStringN(FF, ";  [ ] Create unicode executable", Format)
    Default
      WriteStringN(FF, ";  [x] Create unicode executable", Format)
  EndSelect
  Select ReadPBPrefs("CompilerDefaults", "Thread")
    Case "0"
      WriteStringN(FF, ";  [ ] Create threadsafe executable", Format)
    Default
      WriteStringN(FF, ";  [x] Create threadsafe executable", Format)
  EndSelect
  Select ReadPBPrefs("CompilerDefaults", "OnError")
    Case "0"
      WriteStringN(FF, ";  [ ] Enable OnError lines support", Format)
    Default
      WriteStringN(FF, ";  [x] Enable OnError lines support", Format)
  EndSelect
  CompilerIf #PB_Compiler_OS = #PB_OS_Windows
    Select ReadPBPrefs("CompilerDefaults", "XPSkin")
      Case "0"
        WriteStringN(FF, ";  [ ] Enable XP skin support", Format)
      Default
        WriteStringN(FF, ";  [x] Enable XP skin support", Format)
    EndSelect
    Select ReadPBPrefs("CompilerDefaults", "VistaAdmin")
      Case "0"
        WriteStringN(FF, ";  [ ] Request Administrator mode for Windows Vista", Format)
      Default
        WriteStringN(FF, ";  [x] Request Administrator mode for Windows Vista", Format)
    EndSelect
    Select ReadPBPrefs("CompilerDefaults", "VistaUser")
      Case "0"
        WriteStringN(FF, ";  [ ] Request User mode for Windows Vista (no virtualization)", Format)
      Default
        WriteStringN(FF, ";  [x] Request User mode for Windows Vista (no virtualization)", Format)
    EndSelect
  CompilerEndIf
  WriteStringN(FF, "; Library Subsystem:  " + ReadPBPrefs("CompilerDefaults", "SubSystem"), Format)
  Select ReadPBPrefs("CompilerDefaults", "TextEncoding")
    Case "1"
      WriteStringN(FF, "; File Format:        UTF-8", Format)
    Default
      WriteStringN(FF, "; File Format:        ASCII", Format)
  EndSelect
  CompilerIf #PB_Compiler_OS = #PB_OS_Windows
    Select ReadPBPrefs("CompilerDefaults", "ExeFormat")
      Case "1"
        WriteStringN(FF, "; Executable Format:  Console", Format)
      Case "2"
        WriteStringN(FF, "; Executable Format:  Shared DLL", Format)
      Default
        WriteStringN(FF, "; Executable Format:  Windows", Format)
    EndSelect
  CompilerElse
    Select ReadPBPrefs("CompilerDefaults", "ExeFormat")
      Case "1"
        WriteStringN(FF, "; Executable Format:  Console", Format)
      Case "2"
        WriteStringN(FF, "; Executable Format:  Shared .so", Format)
      Default
        WriteStringN(FF, "; Executable Format:  Linux", Format)
    EndSelect
  CompilerEndIf
  WriteStringN(FF, ";", Format)
  WriteStringN(FF, "; Created on:         " + FormatDate("%dd/%mm/%yyyy %hh:%ii", Date()), Format)
  WriteStringN(FF, "; App/Lib-Name:       " + #APP_NAME_DEFAULT$, Format)
  WriteStringN(FF, "; Author:             " + #AUTHOR_DEFAULT$, Format)
  WriteStringN(FF, "; Version:            " + #VERSION_DEFAULT$, Format)
  WriteStringN(FF, "; Compiler:           " + GetPBCompilerVersion(), Format)
  WriteStringN(FF, "; ==============================================================", Format)
  WriteStringN(FF, "", Format)
  WriteStringN(FF, "EnableExplicit", Format)
  WriteStringN(FF, "", Format)
  CloseFile(FF)
EndIf 
So sieht es dann z.B. bei mir unter Windows aus:

Code: Alles auswählen

; ==============================================================
; COMPILER OPTIONS:
;  [ ] Enable inline ASM support
;  [x] Create unicode executable
;  [ ] Create threadsafe executable
;  [ ] Enable OnError lines support
;  [x] Enable XP skin support
;  [ ] Request Administrator mode for Windows Vista
;  [x] Request User mode for Windows Vista (no virtualization)
; Library Subsystem:  
; File Format:        UTF-8
; Executable Format:  Windows
;
; Created on:         13/10/2012 21:21
; App/Lib-Name:       Example
; Author:             Thomas <ts-soft> Schulz
; Version:            0.0
; Compiler:           PureBasic 5.00 Beta 5 (Windows - x64)
; ==============================================================

EnableExplicit

PureBasic 5.73 LTS | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.
Bild
Antworten