wiretwister Posted August 23, 2023 Share Posted August 23, 2023 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 More sharing options...
Danp2 Posted August 23, 2023 Share Posted August 23, 2023 Can you expand your code so that we can actually run it to observe the results? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
mikell Posted August 24, 2023 Share Posted August 24, 2023 9 hours ago, wiretwister said: the resulting set Providing this text could be a good idea too Link to comment Share on other sites More sharing options...
wiretwister Posted August 24, 2023 Author Share Posted August 24, 2023 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 More sharing options...
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