Page 1 of 1

DecMaker 1.0.5

Posted: Fri Apr 03, 2009 7:16 pm
by luis
There are others tools like this already posted in the forums, so look around if this does not suits you, maybe something else will do.

It's really a quick hack, but the zip contains the source, so you can customize it to your needs if you like to.

DecMaker generate declarations for the file currently open in PB IDE, it does not process other files or includes, only the current file.
The generated declares are copied in the clipboard ready to pasted where you need them.

It must be installed as a PB tool under "Tools -> Configure Tool", if you run the exe it will pop up a window explaining the values to put in the required fields.

You can specify two options when launching it:

/tab=[n] will put n tabs between the Declare statement and the procedure's name.

/rem will allow you to specify the character(s) you want to use after a ";" to indicate your will to include that comment in the generated list of declares.

Let's see a sample program we want to generate the declares for:

Code: Select all

; DecMaker example

;! ************************
;! *** SYSTEM FUNCTIONS ***
;! ************************

Procedure SystemFunc1()
EndProcedure

Procedure SystemFunc2()
EndProcedure

Procedure SystemFunc3 (iVal, fVal.f)
EndProcedure

;! *************************
;! *** GRAPHIC FUNCTIONS ***
;! *************************

ProcedureDLL.i GraphicFunc1 (x, y)
 ProcedureReturn x * y
EndProcedure

ProcedureDLL GraphicFunc2 ()
EndProcedure

ProcedureDLL GraphicFunc3 (dVal1.d, dVal2.d)
EndProcedure


;! MISC FUNCTIONS

ProcedureC.s RandomFunc1 (sValue.s)
 ProcedureReturn ""
EndProcedure

ProcedureC.s RandomFunc2 (sValue.s)
 ProcedureReturn ""
EndProcedure
If you use this commandline: "%TEMPFILE" you will get something like this:

Code: Select all

Declare   SystemFunc1()
Declare   SystemFunc2()
Declare   SystemFunc3 (iVal, fVal.f)
Declare.i GraphicFunc1 (x, y)
Declare   GraphicFunc2 ()
Declare   GraphicFunc3 (dVal1.d, dVal2.d)
Declare.s RandomFunc1 (sValue.s)
Declare.s RandomFunc2 (sValue.s)
If you use this commandline instead: "%TEMPFILE" /tab=1 /rem="!", you will get something like this:

Code: Select all

; ************************
; *** SYSTEM FUNCTIONS ***
; ************************

Declare   SystemFunc1()
Declare   SystemFunc2()
Declare   SystemFunc3 (iVal, fVal.f)

; *************************
; *** GRAPHIC FUNCTIONS ***
; *************************

Declare.i GraphicFunc1 (x, y)
Declare   GraphicFunc2 ()
Declare   GraphicFunc3 (dVal1.d, dVal2.d)

; MISC FUNCTIONS

Declare.s RandomFunc1 (sValue.s)
Declare.s RandomFunc2 (sValue.s)
Download 1.05 from here

;* 1.01 Fixed a gigantic bug, how was it working before ?
;* 1.02 Changed the /tab option to /tab=[n]
;* 1.03 Skip processing of macro contents
;* 1.04 Removed multiple group headers when the group is empty (no declares)
;* 1.05 Single line macros also skipped

Posted: Sat Apr 04, 2009 12:02 am
by jack
thanks luis :)

Posted: Tue Apr 14, 2009 7:59 am
by idle
Thanks just what I need!

Re: DecMaker

Posted: Sun Oct 18, 2009 10:11 pm
by luis
Ergh... fixed an obscene bug... sorry... I've updated the link in the first post.

Re: DecMaker

Posted: Wed Oct 21, 2009 9:23 am
by zikitrake
:D Nice tool! (Since I left JaPBe to back to original PB IDE).

Only a (solved) problem:

Change

Code: Select all

%TEMPFILE
to

Code: Select all

"%TEMPFILE"
; because with the first, I get an error message "File "C:\Documents" not found".

Thank you

Re: DecMaker

Posted: Wed Oct 21, 2009 11:33 am
by luis
Yes, %TEMPFILE is a full pathname, so if you have spaces in there you should enclose it in double quotes...

It's a very stupid tool but I use it constantly :)

Re: DecMaker

Posted: Wed Oct 21, 2009 1:01 pm
by zikitrake
Stupid? why? I was using JaPBe because it has this tool. :D

Re: DecMaker

Posted: Wed Oct 21, 2009 2:24 pm
by luis
Well you are right, it's not stupid the tool per se, it's a little dumb the program !

It's a little rigid and I coded it in a hurry a day I was exasperated by the need to go back and edit AGAIN the declares of the changed procedures for a library, so I stopped what I was doing and hacked this together. It's not some code to be proud of ... :|

Re: DecMaker

Posted: Wed Oct 21, 2009 2:38 pm
by Kaeru Gaman
just a suggestion...
luis wrote:If you use this commandline: "%TEMPFILE" /tab and you have at least a Tab Length of 4 in your preferences in the IDE...
is it possible for you to check the tablength?
because, if <4 you could insert 2 tabs...
or generally insert tabs with length 4, independent of the user's tablength...

Re: DecMaker

Posted: Wed Oct 21, 2009 3:10 pm
by luis
Yes I suppose is possible, or I could simply not use tabs but spaces instead ... probably.

I posted the source exactly to make possible doing these little individual adjustments :)

Anyway I'll give it a look as soon as I have time, thank you for the suggestion!

Re: DecMaker

Posted: Fri Oct 23, 2009 9:26 pm
by luis
I modified the /tab switch, now you can write /tab=n to specify the number of tabs you want.

Updated 1st post.