Jump to content

Report Help File Issues Here


guinness
 Share

Recommended Posts

remember that the help files have to be friendly for the new users. information overload (as defined by valik) is seldom friendly to new users.

over-complicating examples could lead to the help file no longer being the great tool that it has been in the past.

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!"

Link to comment
Share on other sites

GEOSoft

I have only offered. I wouldn't like to argue. It not seemed to me overloaded, as commands identical. And it even can interest the beginner to try all commands.

RunWait

Example()
Func Example()
RunWait(@ComSpec & ' /c reg.exe -h>"'&@DesktopDir&'Help_Registry.txt"', '', @SW_HIDE)
    ; Run Notepad and wait for the Notepad process to close.
    Local $iReturn = RunWait('notepad.exe "'&@DesktopDir&'Help_Registry.txt"')
    ; Display the return code of the Notepad process.
    MsgBox(4096, "", "The return code from Notepad was: " & $iReturn)
FileDelete(@DesktopDir&'Help_Registry.txt')
EndFunc   ;==>Example
Link to comment
Share on other sites

It not seemed to me overloaded, as commands identical.

To us, yes, we know the commands are fundamentally the same. To a new user? No, they don't understand that yet. You don't teach that by giving them five different examples of how to use the same function. It will appear different and they will not focus on what they need to. Where-as if they see 10 different examples provided by 10 different functions they will begin to see a pattern emerge and learn on their own that all the calls are identical.

Even the simple example above is mixing in a lot of things:

  • String concatenation.
  • Passing command line parameters to a program.
  • Using the command interpreter to redirect STDIO to a file.
  • Deleting a file which should not be present at all in an example for RunWait().
You also demonstrate bad practice. You use the path to the text file in three separate places but you don't declare a variable (preferably Const) to eliminate magic-strings.

Some examples are inevitably more complex than others but care needs taken not to introduce too many concepts at once. Stuff like using variables and constants instead of magic values is fine because it doesn't impair understanding. Using a lot of unrelated concepts can obfuscate what the example is meant to demonstrate, though.

The example we have for RunWait() does what it needs to do. It shows in clear and simple to understand terms that the function will run a program and wait for it to close. Because it's trivial it also shows how to capture the return value and how to display that value. The extra lessons do not occlude the primary lesson of how to use RunWait().

Link to comment
Share on other sites

azjio

although it was your example that brought the thought to the forefront; my post wasn't aimed directly at you. it was a general statement for everyone to consider.

think of it this way: if you were teaching math, would you teach addition then subtraction followed by multiplication and division before using combined examples or would you teach all 4 at once so you could really confuse the students?

just think of the person who has never written a script. the help file is a very valuable assett and better than other languages provide so we don't want to see it devalued.

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!"

Link to comment
Share on other sites

GEOSoft

AutoIt3.chm very interesting when it shows practical examples. From the example RunWait may want to make a GUI for command-line utilities. For example, in the example for the StringFormat can make a few practical examples, otherwise it's just a formula.

; Example 2
$iTime = '5'
$sText = ''
; In a multilingual user interface allows you to insert a variable in any position.
$sText&=StringFormat("%s minutes passed", $iTime)&@LF
$sText&=StringFormat("прошло %s минут", $iTime)
MsgBox(0, 'Formatted string', $sText)
; Example 3
$iDec=Dec('F4E6DC')
MsgBox(0, 'The number in hex', StringFormat("%06X", $iDec)) ; color

guinness

In many examples it is possible to check a returned handle. There are people who replace notepad.exe on AkelPad

$hWnd = WinWait("[CLASS:Notepad]", "", 10)
If Not $hWnd Then
MsgBox(4096, 'Error', 'The window is not found, the script finish')
Exit
EndIf
Edited by AZJIO
Link to comment
Share on other sites

Function ObjName misses the description for the default setting of the optional Flag. If Flag is omitted it's set to 1 and the name of the object is returned.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Function ObjName misses the description for the default setting of the optional Flag. If Flag is omitted it's set to 1 and the name of the object is returned.

Fixed. Thanks.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Macro Reference --> @ScriptDir

Directory containing the running script. (Result doesn't contain a trailing backslash)

Behavior is no longer so, a script in a root of a drive will have a trailing backslash, makes this Macro useless.

Edit: Ahh, sorry for the bit bitch comment and thanks Richard for explanation.

Edited by JFX
Link to comment
Share on other sites

Macro Reference --> @ScriptDir

Directory containing the running script. (Result doesn't contain a trailing backslash)

Behavior is no longer so, a script in a root of a drive will have a trailing backslash, makes this Macro useless.

That's because "C:" and "C:" are very different directories. The drive letter followed by a colon refers to the current working directory for that drive letter, in the current program. With the slash, it becomes the root directory, which is what you want. If you want to blame something, blame the way Microsoft set up drive letter namespaces.
Link to comment
Share on other sites

guinness

_GUICtrlRichEdit_GotoCharPos

The first character of the text in a control is at character position 1

_GUICtrlRichEdit_SetSel

The first character of the text in a control is at character position 0

0

Done. Thanks.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

guinness

RichEdit

in all scripts needed to add description. After editing example and subsequent launching script appear errors and computer hangs.

OnAutoItExitRegister('_OnExit') ; Removes the RichEdit even when the script fails
; .............
Func _OnExit()
_GUICtrlRichEdit_Destroy($hRichEdit) ; Removal RichEdit at script end is obligatory
EndFunc

or

OnAutoItExitRegister('_OnExit') ; Removes the GUI even when the script fails
; .............
Func _OnExit()
GUIDelete() ; Be sure to remove the Gui to release resources RichEdit
EndFunc
Link to comment
Share on other sites

It hangs because of bug. Providing workaround until bug is fixed is fine but not necessary at this point.

I see that richedit examples include a form of workaround already, that needs going away too afer the fix.

edit:

...there, closed report.

Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Couple of trivial points which might need looking at.

1. WinGetState, does not mention WinSetState as a related function, and visa versa. I'm unsure if there is a reason for this.

2. Run seems to set a default behaviour for opt_flag, which is not documented. I say this because I forgot to set it to $STDOUT_CHILD

and was still able to read stdout from parent.

Edited by JohnOne

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

Monkey's are, like, natures humans.

Link to comment
Share on other sites

1. WinGetState, does not mention WinSetState as a related function, and visa versa. I'm unsure if there is a reason for this.

Done. Thanks.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Number ( expression [, flag ] )

(large snip)

"A string beginning with digits has non-numeric characters stripped"

To me this sounded like a string such as "1,000,000" would return 1000000. It returns 1.

You might change this to something like

"A string beginning with digits has non-numeric characters and all following numeric and non-numeric characters stripped"

In the example, I did see tht 24/7 would return 24. However, since a comma is used very often with a number you might want to at least add

Local $v=Number("1,000" ) ;returns 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...