Strange string test error
Strange string test error
- Subject: Strange string test error
- From: Jeffrey Mattox <email@hidden>
- Date: Tue, 10 Dec 2002 03:48:07 -0600
In the following code, there are some strings values for theText that
cause the if statement to fail -- the "on error" code is executed.
theText contains paragraphs from a text file.
set theCount to count of text items in theText
display dialog "Count: " & theCount & " Class: " & (class of theText)
--> Count: 36037 Class: string
try
if (theText is "") then
return false
end if
on error
display dialog "ERROR"
--> ERROR
return false
end try
If, instead of testing for a null string, I test for theCount being
equal to zero, then I can accomplish my objective. But I am
concerned about why the original test causes an error. How can it
cause a script error if theText is a string?
I am using AppleScript Studio and OS 10.2.1.
Jeff
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.