Because I wanted to have a list (in a file) I changed Num3's code to work properly with V4.
Code:
; PB Resident Sniffer for "PB_" constants
open.s=OpenFileRequester("Res Sniffer","*.res","*.res",1)
If ReadFile(0,open)
size.l=Lof(0)
open = GetFilePart(open)
If CreateFile(1,open +".txt")
For a=0 To size ;Step 1
Number.b = ReadByte(0)
If Number = 80 ;Hex = 50
Number.b = ReadByte(0)
If Number = 66 ;Hex = 42
Number.b = ReadByte(0)
If Number = 95 ;Hex = 5F
StartPoint.l = Loc(0) - 3
Repeat
Number.b = ReadByte(0)
If Number = 0
EndPoint.l = Loc(0)
Break
EndIf
ForEver
BufferSize.l = EndPoint - StartPoint
buffer=AllocateMemory(BufferSize)
FileSeek(0, StartPoint)
ReadData(0,buffer,BufferSize)
line.s=PeekS(buffer)
If line = "PB_Explorer_Column_Accessed" ;do nothing
ElseIf line = "PB_Explorer_Column_Attributes" ;do nothing
ElseIf line = "PB_Explorer_Column_Created" ;do nothing
ElseIf line = "PB_Explorer_Column_Modified" ;do nothing
ElseIf line = "PB_Explorer_Column_Name" ;do nothing
ElseIf line = "PB_Explorer_Column_Size" ;do nothing
ElseIf line = "PB_Explorer_Column_Type" ;do nothing
Else
WriteStringN(1,"#"+line)
EndIf
EndIf
EndIf
EndIf
Next
CloseFile(1)
EndIf
CloseFile(0)
EndIf
FreeMemory(-1)
MessageRequester("HI", "ALL DONE")
End
[crap]
With this code I get 602 constants, 7 of them are not even recognized by the compiler:
#PB_Explorer_Column_Accessed
#PB_Explorer_Column_Attributes
#PB_Explorer_Column_Created
#PB_Explorer_Column_Modified
#PB_Explorer_Column_Name
#PB_Explorer_Column_Size
#PB_Explorer_Column_Type
[/crap]
EDIT:
Changed code to avoid writing of this 7 special String Constants.
Now 595 constants are written.
Thanks Freak.