Can Seperate command accept a variable

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
AppAust
Newbie
Posts: 6
Joined: Wed Jan 20, 2010 10:04 pm

Can Seperate command accept a variable

Post by AppAust » Fri Apr 27, 2012 11:13 am

I am using seperate command in a subroutine to generate lists of files in folders

GetFileList>c:\a1\*.*,fl,;
separate>fl,;,Flist

What I am wanting to do is
GetFileList>c:\a1\*.*,fl,;
Let>myFList=Test (will actually be a passed variable)
separate>fl,;,%myFlist%

I was hoping I would end up with my list of files in
Test_1, Test_2, ......

I am actually getting them in an array
%myFlist%_1, %myFlist_2%, .......

Any Suggestions on how to acheive this. :?:

Thanks.
If it doesnt need a motor, it doesnt need to be done

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Apr 27, 2012 2:14 pm

Separate is going to use whatever text you place as the array variable name. I doubt that it can use the predefined value of that text. But you can assign that value after the separate by renaming the array text to new text.

Does this do what you want?

Code: Select all

// (will actually be a passed variable)
    Let>myFList=Test

//What I am wanting to do is
    GetFileList>c:\a1\*.*,fl,;

    separate>fl,;,var

    Let>kk=0
    Repeat>kk
      Add>kk,1
      Let>%myFlist%_%kk%=var_%kk%
    Until>kk=var_count

//I was hoping I would end up with my list of files in
//Test_1, Test_2, ......

    mdl>Test_1

AppAust
Newbie
Posts: 6
Joined: Wed Jan 20, 2010 10:04 pm

Post by AppAust » Mon Apr 30, 2012 2:27 am

Thanks JRL :!: :!:
A great simple work around to get what I was wanting to achieve. :D :D
If it doesnt need a motor, it doesnt need to be done

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts