Jump to content

StringSplit Return Value Issue


Recommended Posts

Hello Everyone...Autoit newbie here. Every now and then, I run into this kind of a problem. After performing a set computation, I need to convert the resulting set ($difset) back into a 1-D array ($difarray). Each element consists of one component part number, a delimiter, and one assembly part number. I can't figure out how to have StringSplit fill the Output Array ($outarray) directly. The code shown below works, but I'm trying to eliminate the clutter of using that single-row array ($onerowarray) and the _ArrayTranspose function. Any ideas would be appreciated.

Local $difarray=_Set_ToArray($difset)
Local $outarray[UBound($difarray,1)][2]
Local $onerowarray
For $row= 0 To UBound($difarray,1)-1
    $onerowarray=StringSplit($difarray[$row],Chr(128),3)
    _ArrayTranspose($onerowarray)
    $outarray[$row][0]=$onerowarray[0][0]
    $outarray[$row][1]=$onerowarray[0][1]
Next
_ArrayDisplay($outarray, "Output Array")

 

Link to comment
Share on other sites

Thank you both for responding. If I attach enough code and include some test data for you to run this, it will actually run--and you will ask what is the problem. If I send you the entire script, it won't run because it interfaces with Microsoft Excel, ExactMAX (MRP app), set computation, etc.

I believe that my problem is due to a limitation of the StringStrip function, rather than a simple syntax error. Since my work-around runs correctly, I will leave it stay for now.

 

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...