Page 1 of 1

Tools: Get asm, fix trailing spaces and open project folder

Posted: Mon Aug 14, 2006 6:56 pm
by Trond
Code updated For 5.20+


Nothing advanced but very convenient.

Asm tool: Opens the asm file generated by PB in fasm. Replace the paths with yours and add it with the parameter "%TEMPFILE" (including the quotes).

Code: Select all

File.s = ProgramParameter()

RunProgram("c:\programfiler\PureBasic 4\Compilers\pbcompiler.exe", #DOUBLEQUOTE$ + File + #DOUBLEQUOTE$ + " /COMMENTED", "", 1)
RunProgram("c:\fasm\fasmw\fasmw", #DOUBLEQUOTE$ + "c:\programfiler\PureBasic 4\Compilers\PureBasic.asm" + #DOUBLEQUOTE$, "")
Fix trailing spaces: Replaces all occurences of a single space followed by a newline by a newline in the currently open source.
Add with the parameter "%TEMPFILE" (including the quotes), check "wait until tool quits" and "reload source after tool has quit".

Code: Select all

If OpenFile(0, ProgramParameter(0))
  Str.s = Space(Lof(0))
  ReadData(0, @Str, Lof(0))
  Str = ReplaceString(Str, " " + #CRLF$, #CRLF$)
  FileSeek(0, 0)
  WriteData(0, @Str, Len(Str))
  CloseFile(0)
Else
  MessageRequester("Failed", "Not a good file: " + ProgramParameter(0))
EndIf
This tool opens the folder the current file resides in, or the examples folder if the file is not saved. Add it with the parameter "%PATH" (including the quotes).

Code: Select all

Path.s = ProgramParameter(0)
If Path
  RunProgram(Path)
Else
  RunProgram(#PB_Compiler_Home + "Examples\Sources")
EndIf