kcvinu

Can we have a doc string or xml comment in AutoIt

21 posts in this topic

Hi there,

Python has doc strings to comment out classes and functions

VB.NET has xml comments to do the same.

Does autoit has anything like it. Why i am asking this because, when i am working with script file which has so many functions, i need to use SciTe Jump for reading functions. But those functions which has no comment are really difficult to understand. Is there any remedy for this ?


My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Share this post


Link to post
Share on other sites



You mean the ; character or #cs and #ce as describeded here?

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hi 

water, I mean, a special comment for what the function deos and what are the parameters. If we add a special comment to our UDF, then later when we typing the function name in SciTe, we should see a tooltip or something like that. It will sow us what this function does and what are the parameters . 

My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Share this post


Link to post
Share on other sites

That is exactly what the link Adding UDFs to AutoIt and SciTE (already posted by melba and me) does.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

kcvinu,

Do you actually read the answers that you are given? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

 

But to make coding with these UDFs even easier you can also add CallTips and AutoComplete for them.

 
As you might expect, the full SciTE4AutoIt3 package makes it easy - have you downloaded and installed it yet? If you have then just open SciTEConfig on the Other Tools tab and press Run User Call Tip Manager. Then you just need to select the UDF file to add and everything is done for you automatically.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Hi all,

I did what you say. And i wrote a comment with #cs and #ce method. But when i start calling the same function in another script, there i can't see the comment. 


My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Share this post


Link to post
Share on other sites

kcvinu,

One last try. :)

Have you used the User Call Tip Manager within SciTEConfig to add the function to the relevant SciTE files? Merely adding a comment to the function script file itself does nothing at all to get calltips and autocomplete in SciTE - you need to use the Manager or add the data to the various files manually. As you have been told several times, all is explained in the Adding UDFs to AutoIt and SciTE tutorial in the Wiki. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

kcvinu,

One last try. :)

Have you used the User Call Tip Manager within SciTEConfig to add the function to the relevant SciTE files? Merely adding a comment to the function script file itself does nothing at all to get calltips and autocomplete in SciTE - you need to use the Manager or add the data to the various files manually. As you have been told several times, all is explained in the Adding UDFs to AutoIt and SciTE tutorial in the Wiki. ;)

M23

 

I don't mean to hijack this thread, but I didn't know that was possible (never really needed it) but decided to try it too. Doesn't work for me either. Walked through the walkthrough behind that link, used the special tool, everything looked fine, but autocomplete and function help didn't work. Function itself works fine if I include my new library. Then checked all the manual steps, calltips and UserUdfs and such, all looked fine. Even after multiple restarts... Am I probably missing something simple (which may also help kcvinu) or should I start a new thread including my test code?

1 person likes this

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

SadBunny,

Not a hijack at all. Let me test and see what I get - as I wrote the Manager I am very interested to see the result. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

For completeness' sake:

; zzzuserinteract.au3

#cs
    Title: Test Title
#ce

;===============================================================================
;
; Function Name:    _mytestfunc()
; Description:      testdesc
; Parameter(s):     $msg    - testparamdesc
;
;===============================================================================
Func _mytestfunc($msg)
    msgbox(0,0,"_mytestfunc works!")
EndFunc   ;==>_mytestfunc
#include <zzzuserinctest.au3>

_mytestfunc("hi")

Works like a charm. I just don't get autocomplete or function help. I stole my library markup from Word.au3.

---

This was autogenerated by the tool after writing the above code and untouched by me:
 

au3.user.calltips.api

Func _mytestfunc($msg) test3 (Requires: #Include <zzzuserinctest.au3>)

au3.UserUdfs.properties:

au3.keywords.user.udfs=func _mytestfunc

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

SadBunny,

Yup, already found the problem. The utility does not remove "Func " before the function name in the file - which prevents SciTE from recognising it. :blush:

I am not at all sure how that happened, but here is a modified version which does work when I test it - see if it does for you too (it is a zipped exe so I can attach it):

<snip>

If you are happy I will ask Jos to release a beta version ASAP. :)

M23

Edit:

kcvinu,

My apologies for the tone of my earlier post - it seems I was the one at fault. :blush:

 

Edited by Melba23
Code removed

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

I am not at all sure how that happened, but here is a modified version which does work when I test it - see if it does for you too (it is a zipped exe so I can attach it):

 

Took some time to test as I had two barfing AV applications and Windows Smartscreen to drag it through, but finally I got it to run. It works! Though I find the tool's GUI quite confusing and it only seems to work with direct mode (not with header mode, but as I didn't research it this may well be my misunderstanding), but at least it can get the thing to work now.

New content of au3.user.calltips.api:

_mytestfunc($msg) test4 (Requires: #Include <zzzuserinctest.au3>)
Func _mytestfunc($msg) test3 (Requires: #Include <zzzuserinctest.au3>)

This works "by accident" I guess? Maybe include a quick check to repair broken entries like this? It may well be too obscure a tool to worry about though, especially since it works like this too.

New content of au3.UserUdfs.properties:

au3.keywords.user.udfs=_mytestfunc func _mytestfunc

---

Thanks! I guess I won't be using it much as I have no trouble with keeping track of my library functions and I only ever write relatively small scripts in AU3 nowadays, but it is good to know that the functionality is in there.

Hopefully this all will help kcvinu. Though I agree that kcvinu could help others help him/her better by being somewhat more complete in his/her questions.

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

SadBunny,

Great! I will pass the amended file to Jos so he can release a new Beta. :thumbsup:

You can remove the incorrect entry from the Manager by pressing the "View Tips" button, selecting the erroneous entry in the ListView and pressing the "Delete" button. :)

Sorry you find the interface confusing - as I wrote it I obviously do not and you are the first to mention it. The default "Header" mode requires a formal UDF header as I put in my UDFs (and which used to be in all the AutoIt UDFs until we changed the layout during the past development period). This is the first few lines of an example header:

; #FUNCTION# =========================================================================================================
; Name...........: _CFF_Choose
; Description ...: Creates a dialog to chose single or multiple files or folders
; Syntax.........: _CFF_Choose ($sTitle, [$iW = 1, [$iH = 1, [$iX = -1, [$iY = -1, [$sRoot = "", [$s_Mask = "", [$iDisplay = 0, [$iMultiple = True, [$hParent = 0]]]]]]]]])
; Parameters ....: $sTitle      - Title of dialog - only necessary parameter!
;                  $iW, $iH     - Width, Height parameters for dialog (Default and minimum = 250 x 300).  Set negative for resizable dialog
;                  $iX, $iY     - Left, Top parameters for dialog (Default = centred)
[...]
"Header" mode looks for specific "Description" & "Syntax" lines which in your test header will not be recognised/found. So you need to use the "Direct" mode, as explained in the SciTE4AutoIt3 Help file. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

"Header" mode looks for specific "Description" & "Syntax" lines which in your test header will not be recognised/found. So you need to use the "Direct" mode, as explained in the SciTE4AutoIt3 Help file. ;)

 

I dove straight in starting at that link provided in this thread and I never saw any mention of the help file. I trial&errored my way through it :) Maybe if you start in the helpfile it's more clear, but all I saw was this link in this topic that supposedly explained everything :) Well... It didn't. Anyway, there was enough information to at least find the right tool to get it to work, so good enough for me. Glad I was able to contribute.

Thanks for all of your awesome work.


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

SadBunny,

 

all I saw was this link in this topic that supposedly explained everything :) Well... It didn't

Point taken. I will look at amending the Wiki tutorial later today - at least telling people to look at the SciTE Help file first. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Hi 

Melba23, now everything is perfect. I can add some explanations to my UDFs. And they are visible when i writing code. This is what i wanted. Thanks a lot. I don't think your tone in previous comment needs an apology. It's my fault that i didn't express the problem correcly.

My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Share this post


Link to post
Share on other sites

kcvinu,

Glad to hear it. :)

M23

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Hi all, 

I am requesting the authors of all UDFs to include a header or a comment for all functions. So that we can understand what the function does with a tooltip.


My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Share this post


Link to post
Share on other sites

kcvinu,

Remember that the Manager utility will fill in the function syntax automatically even if there is no header - and it prompts the user to add a suitable description for each function found if one is not present. So it is not hugely difficult to add suitable calltips yourself even if the UDF authors do not provide a "standard" header - although I agree that such headers are very useful and add them to all my UDFs. :)

M23

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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