I am trying to write a script to check whether a container filed is empty when entering the field. But the container field is a [ repeating ], so how should the script be?
I'm guilty of enjoying scripting ...
(I haven't tested this)
Get ( ActiveFieldContents ) will do this for you.
From FileMaker Help:
When the focus is in a repeating field, this function returns the contents of the active repetition. The result type of the active field depends upon the data type of the active field and the result type assigned to the Get(ActiveFieldContents) calculation function.
I should add that you don't need the GetAsNumber() functions.
All calculations assigned to $local or $$global variables are of type text; but FM will implicitly interpret these text variables as necessary (e.g. $index = $index + 1 is fine).
I believe that you still need to use GetAsDate (or GetAsNumber) when working with $variables holding dates. (The same would apply to Time and Timestamp.)
Retrieving data ...