Fields Count varibale with an IF statement

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
jonathangoss
Newbie
Posts: 6
Joined: Fri Sep 07, 2012 8:41 am
Location: Bournemouth

Fields Count varibale with an IF statement

Post by jonathangoss » Fri Sep 07, 2012 8:45 am

Hi
Having a few problems with getting my script to goto the correct label if the FIELDS_COUNT variable is set to 0
* This is to cover me if the first line of my text file is blank (which it can be) even though lines 2 and 3 etc do contain data

My code is this:
IF>TheFileData_FIELDS_COUNT=0 Then
Goto>WeDontHaveData
Else
Goto>WeHaveData
EndIf

I've also tried IF>FIELDS_COUNT=0 Then

but no joy. Am i doing something stupid?! :)

cheers,
Jon
Jonathan

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Fri Sep 07, 2012 12:08 pm

Try

Code: Select all

IF>TheFileData_FIELDS_COUNT=0
Goto>WeDontHaveData
Else
Goto>WeHaveData
EndIf

jonathangoss
Newbie
Posts: 6
Joined: Fri Sep 07, 2012 8:41 am
Location: Bournemouth

Fields Count varibale with an IF statement

Post by jonathangoss » Tue Sep 18, 2012 2:52 pm

hi - thanks for the code - tried this - but same result?
Jonathan

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Tue Sep 18, 2012 3:09 pm

This code works when a line is empty when using the ReadLn function.

Code: Select all

IF>TheFileData_FIELDS_COUNT=
Goto>WeDontHaveData
Else
Goto>WeHaveData
EndIf


jonathangoss
Newbie
Posts: 6
Joined: Fri Sep 07, 2012 8:41 am
Location: Bournemouth

Fields Count

Post by jonathangoss » Fri Sep 21, 2012 3:26 pm

Thank you! :lol:
Jonathan

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