
HaHaHa (you know who you are)

I havn't been at the pub with my mates for
You tought me well


Oh my god, conversations take epic turns here, we were discussing

Procedure PrettyPrinter(szInput.s, szOutput.s, Overwrite.b, StripComments.b, *lpCallbackProcedure)
Protected szCommandlineString.s = "", hFile, PrettyPrinter, PFlags, PString.s
If(FileSize(szInput)<0)
MessageBox_(WindowID(#Main),"Selected file could not be found!", "Error", #MB_ICONERROR)
ProcedureReturn 0
EndIf
Protected Script.s = FixedTempDir()+"HW2_PrettyPrinter.js"
szCommandlineString = Enquote(Script) + " " + Enquote(szInput)
If(Overwrite=0)
szCommandlineString + " " + Enquote(szOutput)
Else
szCommandlineString + " -o"
EndIf
If(StripComments=1)
szCommandlineString + " -s"
EndIf
szCommandlineString + " -verbose"
hFile = OpenFile(#PB_Any, Script)
If hFile
WriteData(hFile, ?HW2_PrettyPrinter, (?HW2_End-?HW2_PrettyPrinter))
CloseFile(hFile)
Else
ProcedureReturn -1
EndIf
PFlags = #PB_Program_Open | #PB_Program_Read | #PB_Program_Hide
PrettyPrinter = RunProgram(FixedSys32Dir()+"cscript.exe", szCommandlineString, GetPathPart(szInput), PFlags)
While ProgramRunning(PrettyPrinter)
PString = ReadProgramString(PrettyPrinter)
If PString
If *lpCallbackProcedure And FindString(LCase(PString),"microsoft",1)=0 ;Screw them! :p It's the script I'm interested in!
CallFunctionFast(*lpCallbackProcedure, PString) ; The callback procedure should recieve only 1 string.
EndIf
EndIf
Wend
If *lpCallbackProcedure
CallFunctionFast(*lpCallbackProcedure, "+OK Ready...")
EndIf
CloseProgram(PrettyPrinter)
DeleteFile(Script)
ProcedureReturn 1
EndProcedure
was that meant to help

Haha 
was that meant to help

; Executes the PB compiler with the /? option and displays the output (windows version)
; For Linux/MacOS change the "/?" to "-h" and the "\" to "/" in the compiler path.
;
Compiler = RunProgram(#PB_Compiler_Home+"\Compilers\pbcompiler", "/?", "", #PB_Program_Open|#PB_Program_Read)
Output$ = ""
If Compiler
While ProgramRunning(Compiler)
Output$ + ReadProgramString(Compiler) + Chr(13)
Wend
Output$ + Chr(13) + Chr(13)
Output$ + "Exitcode: " + Str(ProgramExitCode(Compiler))
EndIf
MessageRequester("Output", Output$)
DataSection
MapLabel:
IncludeBinary "Data\map.data"
EndDataSection

I included the HW2_PrettyPrinter.js into the datasection, on conversion
I put those in the listview control 






Leave a comment: