Jump to content

Latest Beta


Valik
 Share

Recommended Posts

It has unexpected consequences (well, in pathalogical uses the help file warns against):

And with the new ternary operator we do not have to rely on this sluggish conversion. (1=1)?1:0 ist much cleaner ;)

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Trust me on this: You're wasting your time. Maybe come back and try again in a year. Right now, though? Not such a good time to try that.

Understood. (Im not really up to the point of adding function pointers ATM, but I should be at that stage in two or three months, im sure I can delay it more though.)

Edited by twitchyliquid64

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Link to comment
Share on other sites

Understood. (Im not really up to the point of adding function pointers ATM, but I should be at that stage in two or three months, im sure I can delay it more though.)

Only implement functionality from stable or at least beta releases. Everything else is subject to change and you will never get it right. Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Andy,

That's why I wrote "pathological". But Valik gave the reason.

BTW and while I think about it, I sometimes find it useful to have a built-in Sign() function valued in {-1, 0, 1}. Not a great feature and certainly not a complex addition to the core(*) but it would make the language more complete wrt basic arithmetic.

Edit: here I meant "the core functions" not the language engine of course.

Edited by jchd

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 here
RegExp tutorial: enough to get started
PCRE 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

  • The $ in variables is now optional. If you want to continue using $ to prefix your variables that is fine and will continue to be supported. If you'd rather drop the $ that is fine, too, though be aware you cannot have variables with the same name as functions unless you prefix the variable with $.
with my limited knowledge about the program logic behind this, will this not break scripts like this?

Opt('ExpandVarStrings',1)
$does="does not"
#cs
some other code ...
#ce
$not=" not"
If someFunc() <> 0 Then
    $not=""
EndIf
$cmd_line_for_external_program=" /say 'This does$not work!'"

Is this a feature for lazy programing or is it a prearrangement for new programing techniques?

if so, i hope, autoit will not become a complex and cryptic high-level-language as c++ alike.

AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)

Link to comment
Share on other sites

Your code should work as expected because you didn't write it in a way that it would potentially break. I think I know what you were going for however. So with that in mind...

ExpandVarStrings is stupid (as all are Opt()'s) and I don't really give a damn if it's broken or not. I imagine we can force ExpandVarStrings to only expand prefixed variables, though. Assuming it doesn't already.

Link to comment
Share on other sites

Hi!

The new C++ style ternary operators are really impressive!

In this case it could replace the _Iif command! The code would be very clean and in one line.

Global Const $sPhone1 = "+41 44 1111111"
Global Const $sPhone2 = "+41 44 2222222"
Global $iSelector = 1

MsgBox(64, "Info", "Please call " & ($iSelector = 1) ? $sPhone1:$sPhone2)

Really nice and well done.

Veronesi

Link to comment
Share on other sites

Hi!

The new C++ style ternary operators are really impressive!

In this case it could replace the _Iif command! The code would be very clean and in one line.

Global Const $sPhone1 = "+41 44 1111111"
Global Const $sPhone2 = "+41 44 2222222"
Global $iSelector = 1

MsgBox(64, "Info", "Please call " & ($iSelector = 1) ? $sPhone1:$sPhone2)

Really nice and well done.

Veronesi

An array would be even "cleaner":

Global Const $aPhones[] = ["+41 1234567", "+41 987654"]

MsgBox(64, "info", "Please call "&amp; $aPhones[1] )
Edited by Kip
Link to comment
Share on other sites

This is why Jon didn't want to add ternary operators. If you do not know how to use them they make the code worse. I softened him somewhat on them by using them (correctly) to write AutoIt. Seeing code like that causes me to regret giving the green light to the feature, though.

Edited by Valik
Link to comment
Share on other sites

Operators like ternary are not added to teach people new tricks. They are added so that people who know about them and expect them can use them. The only way we can teach people not to write shit code is to not demonstrate shit code in the examples. That's why I want most of the examples revised which guinness has been working on.

Link to comment
Share on other sites

Yeh and will be complete by the next stable version for those who are interested.

Edited by guinness

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

  • 4 weeks later...
#383 ... Interesting.

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

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

  • Recently Browsing   0 members

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