Scripts work in 7.2.040 but not in 7.2.050

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
transolut
Newbie
Posts: 14
Joined: Wed May 19, 2004 2:00 pm
Location: Des Moines, IA USA

Scripts work in 7.2.040 but not in 7.2.050

Post by transolut » Wed May 19, 2004 2:16 pm

Sorry, I posted this in the General Discussions area, and it look like I should have posted it here, si this is a duplicate posting:

I am trying to write an application for a customer. We purchased Version 7.2.050 for them. I have 7.2.040 on my machine. My script runs OK on my machine but not on theirs. I went back and tried the example script in the help menu:

GetFileList>c:\temp\*.*,files
Separate>files,;,file_names
MessageModal>Num Files: %file_names_count%

Let>k=0
Repeat>k
Let>k=k+1
Message>file_names_%k%
Until>k,file_names_count


This works fine on my machine,
but with 7.2.050 the first Message box says:
"Num Files %file_names_count%"

and then an error box pops up that says:
"Error - Label K not found!"

Is this a bug in the current version?

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu May 20, 2004 7:42 am

Hi,

No this is due to a bug fix where Separate used to return a count of 1 even when no files were returned. So the example actually should read:

GetFileList>c:\temp\*.*,files
Separate>files,;,file_names
MessageModal>Num Files: %file_names_count%
If>file_names_count=0,done
Let>k=0
Repeat>k
Let>k=k+1
Message>file_names_%k%
Until>k,file_names_count
Label>done

i.e. if there are no files in the list, you can't loop through them - you can't loop through non existant files - you can't loop from 1 to 0. So, if file_names_count is zero jump the loop.
MJT Net Support
[email protected]

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