Jump to content

Prefix in variable naming - complete list?


Xibalba
 Share

Go to solution Solved by Melba23,

Recommended Posts

Hello,

I've noticed that all the included examples uses a variable practice like so:

  • $sWow64 (string)
  • $hImage (handle)
  • For $iY = 0 To $iH - 1 (integers)

 

and so on...

Which seems to be a nice practice in general.

I'm wondering if there's any list of all the data types, and how they are/can/should be used when it comes to naming variables? Or quality discussions on this specific area regarding coding standards.

For example, I'm not yet sure what data type $tSomething means (an example from the help file states: "a variable for use with DllStruct calls" which isn't that clear to me)

Link to comment
Share on other sites

  • Moderators
  • Solution

Xibalba,

That type of variable naming is called Hungarian notation - or at least a subset of it. Here is an old link which offers an idea of the range of variables you are likely to come across in AutoIt - I add $c for ControlIDs in my own scripts. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

  • Moderators

Xibalba,

A ControlID is the integer variable returned when you create a control using the native functions (GUICtrlCreate###). It is actually an index to an internal AutoIt array which holds all the details of the control and which allows you to affect the control by using the native functions such as GUICtrlSetData, GuiCtrlSetState, etc. :)

The return from the creation of a GUI or a control created using the UDF functions (_GUICtrl###_Create) is a Windows handle - a special hex value which uniquely identifies items in the Windows environment. These controls are not listed in the internal AutoIt array and so the coder needs to do a lot more work to get them to play nicely. A good example of this different behaviour is shown in the Tabs tutorial in the Wiki. ;)

M23

P.S. When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unneccessarily. ;)

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
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
 Share

×
×
  • Create New...