make res

Share your advanced PureBasic knowledge/code with the community.
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

make res

Post by jack »

for people like me who have a hard time remembering how to make
a res file, this vbscript will do it for you.
save the the following as "make PB res.vbs" and put it somewhere
were you can drag'n'drop the source file.
(for people that don't know, a PB res file contains structure and constant definitions.)

Code: Select all

set fs=CreateObject("Scripting.FileSystemObject")
Set Args=WScript.Arguments
if Args.Count>0 then
   file_name = Args(Args.Count-1)
   file_path = left(file_name,InstrRev(file_name,"\"))
   base_name = fs.GetBaseName(file_name)
   Set ws=CreateObject("WScript.Shell")
   double_quote=""""
   appfile = double_quote+"G:\Program Files\PureBasic\Compilers\PBCompiler.exe "+double_quote
   userfile = double_quote+file_name+double_quote
   temp=appfile+userfile+" /RESIDENT "
   temp=temp+double_quote+file_path+base_name+".res"+double_quote
   ret = ws.Run(temp,0,"TRUE")
end if