AS/FMP: a list of fewer than two records
AS/FMP: a list of fewer than two records
- Subject: AS/FMP: a list of fewer than two records
- From: Chap Harrison <email@hidden>
- Date: Thu, 26 Feb 2004 22:39:09 -0600
Please tell me I'm just doing something stupid.
Everything was working great with a database of 21 test records. Then
I tried it with 1 record.
The following suddenly broke -
set myLI_IDList to ID of (every record whose cell "Price" is not "*")
repeat with myLI_ID in myLI_IDList
Apparently, when only one record meets the criteria, "ID of (every
record whose...)" returns a scalar value, not a list. So the repeat
statement failed - I was not iterating over a list.
Okay... So I add "as list" -
set myLI_IDList to ID of (every record whose cell "Price" is not "*")
as list
repeat with myLI_ID in myLI_IDList
That fixed it!
Next I try it with *zero* qualifying records.
The 'set myLI_IDList...' statement dies with an "object not found".
It's only a wild guess, but I'm guessing that an empty set of records
is not an object?
Is it time to go to bed, or does AS (or FMP) sometimes really treat "a
list of zero items" and "a list of one item" as something other than a
list? (That would be... "English-like")
Please, tell me I'm just doing something stupid.
Thank you,
Chap
_______________________________________________
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.