Set variable [$i; 10]
Set Variable[$loc; ""]
Set Variable [$loc; Location [5; $i]
Exit Loop if [$i > 100 OR not IsEmpty($loc) ]
Set Variable [$i; $i + 10]
If IsEmpty ($loc)
Display custom message "Can't determine location"
The Location was not set because I did not do a perform find for the related record. Placing the "perform find" before the "set field" solved my problem