Sign in to follow this  
Followers 0
MartiniThePilot

"Standard" UDF Function Comments to .CHM Help File(s)

3 posts in this topic

#1 ·  Posted (edited)

Hi,

while working on an UDF, I think I've read somewhere (in the forum) about "standard UDF coding rules" and how the header comments may be later converted automatically into .chm help files. Apparently I'm unable to (re)find this within the forum(s).

I guess, due to many UDF comments looking the same, the comments should look like this: (example taken from Array.au3)

; #FUNCTION# ========================================================
; Name...........: _ArrayBinarySearch



; Description ...: Uses the binary search algorithm to search through a 1-dimensional array.

; Syntax.........: _ArrayBinarySearch(Const ByRef $avArray, $vValue[, $iStart = 0[, $iEnd = 0]])

; Parameters ....: $avArray - Array to search

; $vValue - Value to find

; $iWidth - [optional] Index of array to start searching at

; $iHeight - [optional] Index of array to stop searching at

; Return values .: Success - Index that value was found at

; Failure - -1, sets @error to:

; |1 - $avArray is not an array

; |2 - $vValue outside of array's min/max values

; |3 - $vValue was not found in array

; |4 - $iStart is greater than $iEnd



; |5 - $avArray is not a 1 dimensional array

; Author ........: Jos van der Zande <jdeb at autoitscript dot com>

; Modified.......: Ultima - added $iEnd as parameter, code cleanup



; Remarks .......: When performing a binary search on an array of items, the contents MUST be sorted before the search is done.

; Otherwise undefined results will be returned.

; Related .......: _ArrayFindAll, _ArraySearch



; Link ..........;

; Example .......; Yes

; ===================================================================

Somehow this is coverted to (see attached picture).

post-28368-1236942034_thumb.jpg

Is there a script and/or tool I could use for myself to create the .chm file from my UDF comments ?

Thanks in advance!

Regards,

Martini

Edited by Melba23
Fixed formatting

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You could search Example Scripts for Help File Generator (creator?) by PaulIA and you can also look at the code here to see how it's done by the AutoIt team.

http://www.autoitscript.com/autoit3/files/...2.13.13-src.exe

You can also use AutoIt to generate the headers for you. I have a function to generate my headers but that won't be any good to you because I don't use the standard AutoIt header. I prefer the old style. I think I may have made a modified version of that function for someone else so that it did generate the AutoIt style and I definitly have one to convert all the AutoIt headers to the style I use. In other words it's fairly simple to write code to do what you want.

EDIT: Whatever you do, don't use links to MSDN in your headers. The MSDN site changes so often that your links will be valid today and broken tomorrow.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Thanks for your immediate reply George!

You could search Example Scripts for Help File Generator (creator?) by PaulIA...

I still wasn't able to find a (direct) conversion to .chm files. Seems I was too naive... :P So I understood, the path to be taken is via .html .

Topics I found (so far) are:

...and you can also look at the code here to see how it's done by the AutoIt team.

http://www.autoitscript.com/autoit3/files/...2.13.13-src.exe

Downloaded the docu source and had a look. The Readme.txt at \docs\autoit\english\txt2htm\ specifies a standard to use on conversion to .html with the All_txt2htm.au3 tool at \docs\autoit\english. So I will use this for conversion of the .txt files to .html and than the MS Help Workshop to create the .chm .

Because there is a standard for the intermediate .txt format and not directly for the .au3 comments, I will use a comment box style I like myself if I had to write some code to generate the .txt files anyway.

Wouldn't that be a nice tool feature for SciTE? Creating a .txt, .html or .chm file directly from your .au3 source?

Thanks again for pushing me into the right direction!

I'll be back! (with results)

Martini

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0