Room for one more?

Everything else that doesn't fall into one of the other PB categories.
syntax error
User
User
Posts: 93
Joined: Tue Jan 13, 2004 5:11 am
Location: Midlands , UK

Room for one more?

Post by syntax error »

Hi PB coders,

Just purchased PureBasic after playing around with the demo.
I love the tiny executables and overall command set.
The visual designer sure helps a lot.

My aim is to convert a tool I've written into a PureBasic version.
:arrow: See sig.

Still lots to learn though.
Expect lots of questions :!:
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

The search function is your friend!

I recall someone made the necessary freeimage library wrapper for purebasic a while back ;)
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

Welcome to the licensed users tribe ...

You will certainly find answers and help doing your work easy.

You are welcome to propose pieces of code for helping you to switch to Purebasic.

Executables will be smaller and faster, be sure.

KRgrdes
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

welcome :D
syntax error
User
User
Posts: 93
Joined: Tue Jan 13, 2004 5:11 am
Location: Midlands , UK

Post by syntax error »

Thanks folks.
Null3, love your constants sniffer code.
Here is an adapted version I use to generate a list of PB constants and WM_ constants (from windows.res):

Code: Select all

; PB Resident Sniffer
; Main code     >> Null3
; Modifications >> syntax error

dr$="d:\purebasic\residents\"
prefix$="PB_"
dq$=Chr(34)

; example line created:
; Debug "#PB_Key_T = $"+Hex(#PB_Key_T)
;
open.s=OpenFileRequester("Res Sniffer",dr$+"*.res","*.res",1) 

If ReadFile(0,open) 
  size.l=Lof() 
  buffer=AllocateMemory(size) 
  ReadData(buffer,size) 
  CloseFile(0) 
  
  If CreateFile(1,"const_output.pb") 
    
    For a=0 To size 
      line.s=Trim(PeekS(buffer+a)) 
      
      If Mid(line,1,3)=prefix$
        cont$="#"+line
        WriteStringN("Debug "+dq$+cont$+" = $"+dq$+"+Hex("+cont$+")")
      EndIf 
      
      a+Len(line) 
        
    Next 
    CloseFile(1) 
  EndIf 
  
EndIf
Example results (copied from the debug list):

Code: Select all

#PB_String_ReadOnly = $800
#PB_String_UpperCase = $8
#PB_Text_Border = $20000
#PB_Text_Center = $1
#PB_Text_Right = $2
#PB_ToolBarIcon_Copy = $1
#PB_ToolBarIcon_Cut = $0
#PB_ToolBarIcon_Delete = $5
#PB_ToolBarIcon_Find = $C
#PB_ToolBarIcon_Help = $B
#PB_ToolBarIcon_New = $6
#PB_ToolBarIcon_Open = $7

...

#WM_GETDLGCODE = $87
#WM_GETFONT = $31
#WM_GETHOTKEY = $33
#WM_GETICON = $7F
#WM_GETMINMAXINFO = $24
#WM_GETTEXT = $D
#WM_GETTEXTLENGTH = $E
#WM_HELP = $53
#WM_HOTKEY = $312
#WM_HSCROLL = $114
#WM_HSCROLLCLIPBOARD = $30E
Executables will be smaller and faster, be sure
Yup. I have a starfield.exe in at 9.7Kb. Nice!
Post Reply