Modify

#2804 closed Feature Request (Completed)

UDF standards site outdated

Reported by: guinness Owned by: Jos
Milestone: Future Release Component: Documentation
Version: Severity: None
Keywords: Cc:

Description

http://www.autoitscript.com/autoit3/udfs/UDF_Standards.htm

The page is a little outdated and needs some work when it comes to being clearer as to what we expect.

Attachments (0)

Change History (15)

comment:1 by guinness, on Jul 18, 2014 at 9:28:19 PM

Component: AutoItDocumentation

comment:2 by mLipok, on Jul 18, 2014 at 9:33:50 PM

so I have few question:

QUESTION 1:
"All variables must be declared at the beginning of the UDF with a “Local” scope and before they are used for the first time."

I focus on this statement:
.... at the beginning of the UDF with a “Local” scope ....

Is it all right ?

or you mean:
.... at the beginning of the UDF with a “Global” scope ....

comment:3 by mLipok, on Jul 18, 2014 at 9:38:36 PM

QUESTION 2:
"Global variables must have an extra first letter "g". UDF global variables must start with underscore."

Whats the difference ?

specifying:
when to use:

$gVARNAME

and
when to use:

$_gVARNAME

or even:

$__gVARNAME

comment:4 by mLipok, on Jul 18, 2014 at 9:42:28 PM

QUESTION 3:
Can I use:

$_iVARNAME
$__iVARNAME
$_sVARNAME
$__sVARNAME

instead

$_giVARNAME
$__giVARNAME
$_gsVARNAME
$__gsVARNAME

comment:5 by mLipok, on Jul 18, 2014 at 9:54:06 PM

QUESTION 4:
how many lower dashes can be used in function name (not counting the initial of course)

Example

Func _UDFNAME_DoSome_or_DoAnother_Thing()
......
EndFunc

comment:6 by mLipok, on Jul 18, 2014 at 9:55:41 PM

QUESTION 5:

All function names must closely resemble the established naming convention for "internal" AutoIt functions.

Can you explain / clarify ?

comment:7 by TicketCleanup, on Jul 18, 2014 at 10:00:01 PM

Version: Other

Automatic ticket cleanup.

comment:8 by mLipok, on Jul 18, 2014 at 10:23:31 PM

QUESTION 6:

The first word of the function name should start with a word describing a general category such as “Date”, “String”, “Array”, “Network”, etc.. If the word is too long like “Window”, then an obvious abbreviation may be used (e.g. “Win” for “Window” or “Net” for “Network”). 

The first word of the function name ? can be related to the technology or product name

Such as:
_Word_
_Excel_
_WinSCP_
_XZip_
_QPDF_
_Acrobat_
_AcrobatReader_

comment:9 by mLipok, on Jul 18, 2014 at 10:42:07 PM

and finally :
Please treat my questions as suggestions on what might be better described.

As these questions arise in my case to me for a long time ago, since I first read UDF_Standards.htm, and stabilized in such a form as in the preceding questions.

comment:10 by Melba23, on Jul 18, 2014 at 10:55:30 PM

mLipok,

Trac is not the place for discussion - as so often you seem to be treating it as an extension of the forum. guinness was using the Trac ticket as a reminder, not an invitation for comment.

In future, if you want to start a discussion on any topic please start a thread in the forum - you will get a wider audience and Trac will become a lot less cluttered.

Thanks in advance for your cooperation,

M23

comment:11 by mLipok, on Jul 19, 2014 at 12:07:24 AM

Ok
And sorry for confusion.
mLipok

comment:12 by Matt Diesel, on Jul 19, 2014 at 11:36:33 AM

Owner: set to Jon
Status: newassigned

Reassigning to Jon as he needs to make those changes.

The wiki is probably the correct place for this. There is a [best coding practices](http://www.autoitscript.com/wiki/Best_coding_practices) page, as well as a page I started for UDF standards: http://www.autoitscript.com/wiki/UDF-spec

comment:13 by Jos, on Jul 23, 2014 at 6:04:52 PM

Owner: changed from Jon to Jos

I have added a redirect in the old UDF's page to open to the Wiki UDF page .
Let me know if this is what you want.
I have left the old content in case it is still needed.

Jos

comment:14 by guinness, on Aug 1, 2014 at 9:19:20 PM

Resolution: Completed
Status: assignedclosed

comment:15 by TicketCleanup, on Aug 1, 2014 at 10:00:01 PM

Milestone: Future Release

Automatic ticket cleanup.

Modify Ticket

Action
as closed The owner will remain Jos.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.