Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

AutoHotkey v1.1.13


  • Please log in to reply
24 replies to this topic
Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

Note: This is not the latest version. For new releases, go here.

 

 

AutoHotkey v1.1.13
 
Download (more downloads)

 

 

Added:

Array := StrSplit(String [, Delimiters, OmitChars])

See StringSplit for details.  The differences between StrSplit() and StringSplit are:

  • StrSplit() returns an array whereas StringSplit creates a pseudo-array.
  • StrSplit() accepts a single delimiter, which can be more than one character, or an array of delimiters.  StringSplit accepts a string containing one or more delimiter characters.
  • Syntax.


jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009

Very useful - thank you for the update. Here are some quick benchmarks (executing StrSplit 50K times):

Native StrSplit():	0.327476 sec
UDF StrSplit():		1.122561 sec

Native StrSplit():	0.318289 sec
UDF StrSplit():		1.153336 sec

Native StrSplit():	0.319350 sec
UDF StrSplit():		1.137391 sec
SetBatchLines -1
#NoEnv

str := "StrSplit() accepts a single delimiter, which can be more than one character, or an array of delimiters.  StringSplit accepts a string containing one or more delimiter characters."

QPX(1)
Loop 50000
	StrSplit(str, " ")
end := QPX(0)
output := "Native StrSplit():`t" end " sec`n"

QPX(1)
Loop 50000
	_StrSplit(str, " ")
end := QPX(0)
output .= "UDF StrSplit():`t" end " sec"


MsgBox % clipboard := output



_StrSplit(InputVar, Delimiters="", OmitChars="") {
	output := []
	Loop Parse, InputVar, %Delimiters%, %OmitChars%
		output.Insert(A_LoopField)
	return output
}

Edit - updated per Lexikos's wisdom.



fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007
Nice addition happy.png

BTW, can you roll back this CSS change? Using absolute pixel font size makes the font ridiculously tiny on my 144 DPI screen and every time I open the help file I need to zoom in (setting not preserved, and the 'Font size' button does absolutely nothing other than hilariously increasing the list bullet size).

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

Here are some quick benchmarks:

 

Benchmarks in AutoHotkey rarely give accurate results without SetBatchLines -1 (i.e. the result varies between each run, as it greatly depends on OS timing and background activity).  With SetBatchLines -1 on my system, the built-in version gets 0.20 compared to 0.70 for the UDF version.  With an added for-loop, it's 0.42 vs 0.70.  Basically, this relatively small performance gain is not worth the extra 1KB in file size.

 

However, the built-in StrSplit has additional capabilities beyond that of your UDF or StringSplit, as noted in the second bullet-point in my top post.

 

 

BTW, can you roll back this CSS change?

 

I found a better way to achieve what I was after, so have updated the CSS.  See if it works better for you.



just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011

Thank you very much! 


Prefer ahkscript.org for the time being.


Jackie Sztuk _Blackholyman
  • Spam Officer
  • 3757 posts
  • Last active: Apr 03 2016 08:47 PM
  • Joined: 28 Feb 2012
Thanks for porting StrSplit() to 1.1 happy.png looking forward to using it.
Helping%20you%20learn%20autohotkey.jpg?d

[AHK] Version. 1.1+ [CLOUD] DropBox ; Copy [WEBSITE] Blog ; About

fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007

I found a better way to achieve what I was after, so have updated the CSS. See if it works better for you.

Perfect, that did the trick; thanks happy.png

joedf
  • Administrators
  • 986 posts
  • AutoHotkey Foundation
  • Last active: Jul 18 2017 06:01 PM
  • Joined: 20 May 2012

"That's just what I needed!"

/-(Super)?Mario/

 happy.png


Why ahkscript.org? - autohotkey.com is outdated

dustind900
  • Members
  • 43 posts
  • Last active: Nov 03 2017 01:11 PM
  • Joined: 09 Dec 2012

Lovin' this update. Thank you.



Hamlet
  • Members
  • 302 posts
  • Last active: Mar 23 2014 03:37 PM
  • Joined: 22 Jan 2009

Thanks !!

감사합니다.



Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009

Thank you! Keep up the great work!


My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012

Thanks!


Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer) | Class_LV_Rows - Copy, Cut, Paste and Drag ListViews | Class_Toolbar - Create and modify | Class_Rebar - Adjustable GUI controls

Join the New AutoHotkey Forum!


Seidenweber
  • Moderators
  • 638 posts
  • Last active: Sep 06 2015 01:51 PM
  • Joined: 10 May 2011

one of most helpful enhancements for me. Thank you.

 

Will the help file be updated next time?

(index and AutoHotkey.chm::/docs/Functions.htm#BuiltIn)


All questions & answers are related to AHK 1.1.19.03 x64 Unicode

 


Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
It had been added (by Ragnar-F), but I had not updated the help file or online docs. I have now done so.

joedf
  • Administrators
  • 986 posts
  • AutoHotkey Foundation
  • Last active: Jul 18 2017 06:01 PM
  • Joined: 20 May 2012

Hello! ;)

 

I wonder, if there's ever gonna be a 'Switch()' case statement... it would be really useful!

Instead of doing a ton of 'else if's .... If it's not ever gonna be added, then please say so,

i'm interested just to know if it's going to be added in the future.

 

thanks :)


Why ahkscript.org? - autohotkey.com is outdated