trancexx Posted August 24, 2013 Share Posted August 24, 2013 (edited) Like it's said already, WinAPI defines TRUE and FALSE as 32 bit fields with mentioned values. AutoIt's internal bool Variant type isn't defined like that and requires conversion to corresponding interface's type during interaction.Some other interfaces define matching types differently. For example COM interface defines its version as 16 bit value, all bits zero for false and all bits 1 for true. AutoIt therefore converts True to number that can be interpreted as -1 when interacting with this interface.If Jon intends to document explicitly conversion then he should document it precisely for each case, each interface.In my opinion, it's good idea to document it. The only problem is conversion that happens in opposite case, for example during callbacks. Then currently you don't get AutoIt's bool for WinAPI's BOOL type so somebody could ask, hey what's that now? Edited August 24, 2013 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
jpm Posted August 24, 2013 Share Posted August 24, 2013 I'm not quite sure what you are saying in regards to case sensitivity, as I've not mentioned that? Windows BOOL is either TRUE (defined as 1 in the Windows SDK) or FALSE (0). AutoIt currently follows this convention when translating True/False keywords. I just mention the bool/BOOL just to warn that MSDN say BOOL but if you use bool in DllCall() it do the same. Link to comment Share on other sites More sharing options...
Ascend4nt Posted August 24, 2013 Share Posted August 24, 2013 (edited) Some other interfaces define matching types differently. For example COM interface defines its version as 16 bit value, all bits zero for false and all bits 1 for true. AutoIt therefore converts True to number that can be interpreted as -1 when interacting with this interface. This is a good point, and something I hadn't even realized about COM's VARIANT_TRUE being defined as -1. But really that's always been my experience is that only one of 2 values are used to represent a boolean 'true' in pretty much every language I've messed with: 1 or -1. API's and misc. functions often just test for non-zero, but COM is special.. *Ah, while reviewing this I found this nice discussion on the reasoning behind that and more: BOOL vs. VARIANT_BOOL vs. BOOLEAN. If Jon intends to document explicitly conversion then he should document it precisely for each case, each interface. In my opinion, it's good idea to document it. The only problem is conversion that happens in opposite case, for example during callbacks. Then currently you don't get AutoIt's bool for WinAPI's BOOL type so somebody could ask, hey what's that now? It does make sense that it should be documented how the conversions work, even if just for DLLCall and COM interactions. Edited August 24, 2013 by Ascend4nt My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
czardas Posted August 24, 2013 Share Posted August 24, 2013 (edited) To me this boolean stuff seems to be from the realms of fantasy. If specific numeric values are given to the logical data type 'TRUE' (depending on circumstance) then perhaps it ought to be mentioned. Then again I could be misinterpreting this. Edited August 24, 2013 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
AZJIO Posted August 25, 2013 Share Posted August 25, 2013 _SQLite_Open $sDatabase_Filename | [optional] Database filename, by default will opens an in memory database. the path to the file My other projects or all Link to comment Share on other sites More sharing options...
FireFox Posted August 25, 2013 Share Posted August 25, 2013 It's the same thing for file open etc.It's filename and not filepath, either we change everything or it stays like this. Link to comment Share on other sites More sharing options...
AZJIO Posted August 25, 2013 Share Posted August 25, 2013 Better to use the path to the file, because when you run a .bat file it will search in a different directory. My other projects or all Link to comment Share on other sites More sharing options...
FireFox Posted August 25, 2013 Share Posted August 25, 2013 I changed the description to:Database filename, by default will open the memory database.Because the original one means nothing for me. Link to comment Share on other sites More sharing options...
FireFox Posted August 27, 2013 Share Posted August 27, 2013 Better to use the path to the file, because when you run a .bat file it will search in a different directory.The story of the Filename/Filepath is "fixed" in the next release Link to comment Share on other sites More sharing options...
guinness Posted August 27, 2013 Author Share Posted August 27, 2013 You're lucky FireFox saw this, because I didn't. Hence why I encourage people to use the proper channels. 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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
jchd Posted August 27, 2013 Share Posted August 27, 2013 I changed the description to: Database filename, by default will open the memory database. Because the original one means nothing for me. Better say: "a memory database". You can open as many distinct memory DBs as you whish. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
FireFox Posted August 28, 2013 Share Posted August 28, 2013 Better say: "a memory database". You can open as many distinct memory DBs as you whish.OK, fixed. Link to comment Share on other sites More sharing options...
Ascend4nt Posted August 31, 2013 Share Posted August 31, 2013 There's another thing I just realized lately - I've relied on AutoIt behavior of zeroing out memory used for DLLStruct's when using DLLStructCreate(). This should probably be documented if its going to remain in future versions, which I believe it should as there are certain scripts I know of that will fail or error-out if this is changed. This of course is only applied to new memory allocations, not to DLLStruct's created with pointers. My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
AZJIO Posted September 2, 2013 Share Posted September 2, 2013 In the section SQLite , you can add training examples: Table unique - http://forum.ru-board.com/topic.cgi?forum=5&topic=33902&start=2000#7 Get number of rows - http://forum.ru-board.com/topic.cgi?forum=5&topic=33902&start=2000#4 My other projects or all Link to comment Share on other sites More sharing options...
FireFox Posted September 2, 2013 Share Posted September 2, 2013 There's another thing I just realized lately - I've relied on AutoIt behavior of zeroing out memory used for DLLStruct's when using DLLStructCreate(). This should probably be documented if its going to remain in future versions, which I believe it should as there are certain scripts I know of that will fail or error-out if this is changed. This of course is only applied to new memory allocations, not to DLLStruct's created with pointers. I understand what you said whoever I can't see where could it change the behavior of some scripts. Can you give an example? So I can document it clearly in the helpfile? Br, FireFox. Link to comment Share on other sites More sharing options...
Mat Posted September 2, 2013 Share Posted September 2, 2013 I understand what you said whoever I can't see where could it change the behavior of some scripts. Can you give an example? So I can document it clearly in the helpfile? Br, FireFox. If the behaviour were to change, so AutoIt no longer zeroed all the memory automatically, then this would break scripts. Basically it just needs the sentence "When creating a structure, AutoIt zeroes all the data". This is always useful to know, as in a lot of languages you can't assume that will be the case. AutoIt Project Listing Link to comment Share on other sites More sharing options...
FireFox Posted September 2, 2013 Share Posted September 2, 2013 I know that I would have to add this sentence but it was for my own knowledge. Do you mean that if it wasn't the case, if we create a struct we would get what's in the memory address allocated like in C for example? Link to comment Share on other sites More sharing options...
mLipok Posted September 3, 2013 Share Posted September 3, 2013 Many documents use different words to denote the same thing. For example, in these functions: FileGetTime, FileGetSize, FileGetShortName, FileOpen, Ini .... used words are "filename" or "file" and in any case you need to use the full path I propose to standardize a system for recording the information. Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
Mat Posted September 4, 2013 Share Posted September 4, 2013 Many documents use different words to denote the same thing. For example, in these functions: FileGetTime, FileGetSize, FileGetShortName, FileOpen, Ini .... used words are "filename" or "file" and in any case you need to use the full path I propose to standardize a system for recording the information. This has already been discussed by the MVPs. In most cases you do not need to use the full path as a relative path will work as well, so the next release should have them all standardised to "file path" as well as explaining what that means. AutoIt Project Listing Link to comment Share on other sites More sharing options...
mLipok Posted September 4, 2013 Share Posted September 4, 2013 Thanks for the info Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now