Test for Equality does not work - why?
Posted: Sun Nov 15, 2009 9:21 am
Hi,
I think that I have missed something obvious but I am having problems with what should be a simple equality test:
The line " If LineCount is 5" does not work, neither does "If LineCount = 5", but the line "If LineCount > 5" does work.
I have confirmed that LineCount is being incremented.
Any ideas?
I think that I have missed something obvious but I am having problems with what should be a simple equality test:
The line " If LineCount is 5" does not work, neither does "If LineCount = 5", but the line "If LineCount > 5" does work.
I have confirmed that LineCount is being incremented.
Any ideas?
Code: Select all
Put 0 into Blockcount
Put 0 into LineCount
set the itemDelimiter to space
Put Blockcount & return after CleanData
repeat for each line tLine in tFileData --compound statement that sets the new var tLine to the value of present line
Put LineCount+1 into LineCount
If the length of tline >10 then -- only process lines containing data
repeat with tItemNo = 1 to 8
put "<" & item tItemNo of tLine & ">" after CleanData
end repeat
If (LineCount is 5) then -- DataFile stores each block on 5 lines
put Blockcount+1 into Blockcount
Put return & "Block -" & Blockcount & return after CleanData
put 0 into LineCount
Else
put return after CleanData
End if
end if
end repeat
put CleanData after field debug