=sinister= Posted January 1, 2007 Posted January 1, 2007 Just like the title says, how would I determine the amount of strings split in the function StringSplit. Example: In $days = StringSplit("Sun,Mon,Tue,Wed,Thu,Fri,Sat", ",") How many commas are there.
webman Posted January 1, 2007 Posted January 1, 2007 From the documentation: Returns an array, the first element ($array[0]) contains the number of strings returned, the remaining elements ($array[1], $array[2], etc.) contain the delimited strings. [font="Tahoma"]Craig Rodway, IT Support, Bishop Barrington School.[/font]
=sinister= Posted January 1, 2007 Author Posted January 1, 2007 I feel dumb, read that part wrong.... was thinking that [0] was the first string, and so on... Thanks.
Moderators SmOke_N Posted January 1, 2007 Moderators Posted January 1, 2007 I feel dumb, read that part wrong.... was thinking that [0] was the first string, and so on... Thanks.Just be careful not to get StringSplit() and StringRegExp() confused. StringSplit() returns an array where [0] holds the number of elements. If you used StringRegExp() then [0] would be the first element, so you would have to use UBound($array) - 1 to give you the total number of elements (Personally I just got in the habbit for using that with everything). Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
=sinister= Posted January 1, 2007 Author Posted January 1, 2007 k thanks for the tip, I have another question. How can you read a certain line in GUICtrlCreateEdit using GUICtrlRead?
webman Posted January 1, 2007 Posted January 1, 2007 Not too sure, but the first thing that springs to mind is that you would probably have to read the whole text, and split it with @CR and/or @LF to get individual lines. [font="Tahoma"]Craig Rodway, IT Support, Bishop Barrington School.[/font]
Moderators SmOke_N Posted January 1, 2007 Moderators Posted January 1, 2007 k thanks for the tip, I have another question. How can you read a certain line in GUICtrlCreateEdit using GUICtrlRead?Have an example of what you are talking about? Could be as easy as StringSplit(StringStripCR(GUICtrlRead($varedit)), @LF) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
=sinister= Posted January 1, 2007 Author Posted January 1, 2007 Never thought of using @LF, I tested using a msgbox but nothing appears.
=sinister= Posted January 1, 2007 Author Posted January 1, 2007 Ok, 1 more question until I get off yalls nerve, how about getting the line count to a GUICtrlEdit? I tried: $Test = UBound(GUICtrlRead($TestEdit)) MsgBox(0, "Test", $Test)
webman Posted January 1, 2007 Posted January 1, 2007 _GUICtrlEditGetLineCount() [font="Tahoma"]Craig Rodway, IT Support, Bishop Barrington School.[/font]
=sinister= Posted January 1, 2007 Author Posted January 1, 2007 *grin grin* I need to look into these GUI UDF's... Thanks a ton!
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