Jump to content

Recommended Posts

Posted

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.

Posted

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.

:P

[font="Tahoma"]Craig Rodway, IT Support, Bishop Barrington School.[/font]

  • Moderators
Posted

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.

  • Moderators
Posted

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.

Posted

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)

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
  • Recently Browsing   0 members

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