czardas Posted April 29, 2013 Share Posted April 29, 2013 (edited) What does negative true mean? According to the interpreter it means True. If - True Then MsgBox(0, "", (- True = True)) While this may have practical application, it still appears to be meaningless to say True = -True. True is niether positive nor negative. The question I want to ask is whether this is purely a design choice, or if there is some deeper signiicance to why the interpreter does not differentiate between positive and negative boolean values. Perhaps I ought to follow the same indifference in my three value logic system, but I thought asking first might throw some new light on the subject. There still seem to be some holes in this particular bucket. MsgBox(0, "", (True = - True)) ; True MsgBox(0, "", (True = Abs(- True))) ; True MsgBox(0, "", (- True = Abs(- True))) ; False While it is clear to me what is going on internally, on the surface it appears to be a broken system (as far as logic is concerned). What are your thoughts? Edited April 29, 2013 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Mat Posted April 29, 2013 Share Posted April 29, 2013 Traditionally in computing the definition of false is zero, and the definition of true is non zero. By applying a mathematical operation to a boolean value you are creating an integer value. True = -True as both are non zero, and the comparison is a boolean one. True = Abs(-True) is the same as above -True != Abs(-True) as the comparison is now between two integers. -1 != 1 AutoIt Project Listing Link to comment Share on other sites More sharing options...
czardas Posted April 29, 2013 Author Share Posted April 29, 2013 (edited) Good explanation Mat. So do you suggest I ought to allow negative numbers and just ignore the sign in my new version of The current version rejects them. From my own perspective it makes no difference, however I fail to see the justification for allowing negatives. It seems improper use and ought really to throw an exception. Edited April 29, 2013 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Mat Posted April 29, 2013 Share Posted April 29, 2013 (edited) Don't bother to be honest. There is no reason to try and convert from boolean values to integers. Edit: Commas are quite important sometimes. You should always try and be honest. Edited April 29, 2013 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
czardas Posted April 29, 2013 Author Share Posted April 29, 2013 (edited) Edit: Commas are quite important sometimes. You should always try and be honest.Thanks for your opinion. I edited out two commas from my previous post. Edited April 29, 2013 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Richard Robertson Posted April 29, 2013 Share Posted April 29, 2013 There was a time where True and False weren't keywords in AutoIt. You simply used zero and non-zero like C/C++. Link to comment Share on other sites More sharing options...
guinness Posted April 29, 2013 Share Posted April 29, 2013 WOw, that must have been a very long time ago. 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...
Mat Posted April 30, 2013 Share Posted April 30, 2013 Thanks for your opinion. I edited out two commas from my previous post. I meant:Don't bother to be honest. AutoIt Project Listing Link to comment Share on other sites More sharing options...
czardas Posted April 30, 2013 Author Share Posted April 30, 2013 (edited) It wasn't a pythagorean comma then. I won't alter it unless I can find justification for doing so, which actually I can't. Edited April 30, 2013 by czardas operator64 ArrayWorkshop 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