Your two buttons request is a good idea and motivated me to think on a possible alternative. The code below is one option.
Compile this code to an executable and install that executable as a tool to your IDE. Then instruct the IDE to run this tool when the source code is closed; and voila! You have two buttons to ease your task – no more uncommenting required.
The code below is just a skeleton for this idea, hope it helps.
Code: Select all
;{- Program header
;==Code Header Comment==============================
; Name/title: TwoButtons.pb
; Executable name: TwoButtons.exe
; Version: 0.1
; Author: Amílcar Matos Pérez
; Collaborators:
; Translation by:
; Create date: 01/Dec/2015
; Previous releases:
;Most recent update:
; Release date/hour:
; Operating system: Windows [X]GUI
; Compiler version: PureBasic 5.31 (x86)
; Copyright: (c)2015 AMP
; License: Free to use and improve.
; Libraries:
; Forum: http://www.purebasic.fr/english/viewtopic.php?f=3&t=64149
; Tested platforms: Windows
; Explanation: To ease the task of running compiler options.
; ==================================================
;.......10........20........30........40........50........60........70........80
;}
; Both buttons
;RunProgram(#PB_Compiler_Home+"\Compilers\pbcompiler.exe", Chr(34) + "E:\purebasic\buddhabrot3\main.pb" + Chr(34) + " /COMMENTED /SSE2 /EXE " + Chr(34) + "E:\purebasic\buddhabrot3\buddha3.exe" + Chr(34), "", #PB_Program_Open|#PB_Program_Read|#PB_Program_Hide)
;RunProgram(#PB_Compiler_Home+"\Compilers\pbcompiler.exe", Chr(34) + "E:\purebasic\buddhabrot3\main.pb" + Chr(34) + " /REASM /SSE2 /EXE " + Chr(34) + "E:\purebasic\buddhabrot3\buddha3.exe" + Chr(34), "", #PB_Program_Open|#PB_Program_Read|#PB_Program_Hide)
;Return
;{ Form Designer for Purebasic - 5.31
; Warning: this file uses a strict syntax, if you edit it, make sure to respect the Form Designer limitation or it won't be opened again.
; This code is automatically generated by the FormDesigner.
; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
; Event procedures needs to be put in another source file.
Global Window_0
Global Button_0, Button_1, Button_2, Text_0, Text_1, String_0, String_1, Button_3, Button_4, Text_2, String_2
Procedure OpenWindow_0(x = 0, y = 0, width = 600, height = 400)
Flags = #PB_Window_SystemMenu | #PB_Window_ScreenCentered
Window_0 = OpenWindow(#PB_Any, x, y, width, height, "TwoButtons", Flags)
Text_0 = TextGadget(#PB_Any, 30, 40 , 110, 15, "Compiler location")
Text_1 = TextGadget(#PB_Any, 30, 120, 100, 15, "Code location" )
Text_2 = TextGadget(#PB_Any, 30, 200, 100, 15, "Code destination" )
String_0 = StringGadget(#PB_Any, 30, 60 , 480, 30, #NULL$)
String_1 = StringGadget(#PB_Any, 30, 140, 480, 30, #NULL$)
String_2 = StringGadget(#PB_Any, 30, 220, 480, 30, #NULL$)
Button_0 = ButtonGadget(#PB_Any, 330, 340, 100, 25, "Create ASM")
Button_1 = ButtonGadget(#PB_Any, 210, 340, 100, 25, "Reassemble")
Button_2 = ButtonGadget(#PB_Any, 460, 340, 100, 25, "Cancel" )
Button_3 = ButtonGadget(#PB_Any, 520, 60 , 50 , 30, "Browse" )
Button_4 = ButtonGadget(#PB_Any, 520, 140, 50 , 30, "Browse" )
EndProcedure
Procedure Window_0_Events(Event)
Select Event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure
;}
;{ Program execution starts here.
OpenWindow_0()
;{ fill the string gadgets with default content.
Txt$ = #PB_Compiler_Home + "\Compilers\pbcompiler.exe"
SetGadgetText(String_0, Txt$)
Txt$ = "E:\purebasic\buddhabrot3\main.pb"
SetGadgetText(String_1, Txt$)
Txt$ = "E:\purebasic\buddhabrot3\buddha3.exe"
SetGadgetText(String_2, Txt$)
;}
;{ show time!!!
Quit = #True
While Quit <> #False
Event = WaitWindowEvent()
Quit = Window_0_Events(Event)
Wend
;}
End
;} Program execution stops here.