Standalone riddle

J. Landman Gay jacque at hyperactivesw.com
Fri Jan 13 20:53:14 EST 2023


That's how I fixed the first two errors, though each fix moves the error 
somewhere else. This stack ran fine the last time I compiled it, maybe 2 
years ago. And when the error occurs, the card has not changed and by 
default, without a full object reference, the current card should be the 
reference.

Looking farther down the list in the error dialog, it references line 
numbers in the 400-600 range. My scripts barely have 150 lines at the most, 
which seems to imply an error somewhere in the LC scripts, though the top 
error points to line 89 in the handler I posted part of. I tried building 
with LC 9.x and I'm still getting the same error(s). Also, when I dismiss 
the error dialog, the scripts have run successfully and I end up on card 2 
with the correct data in the browser widget.

The riddle remains. Why does a standalone behave differently from a test 
build? The error never occurs in the IDE either. I'd file a but report, but 
I'm afraid I may have done something stupid and I don't want to embarrass 
myself yet.

--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On January 13, 2023 6:42:35 PM Paul Dupuis via use-livecode 
<use-livecode at lists.runrev.com> wrote:

> Fully qualified object references are your friend.
>
> Have you tried referring to the field as:
>
> put pText into field "searchTerm" of cd 1 of stack "stackName" -- of
> instead of the card number, use name or ID
>
> On 1/13/2023 4:42 PM, J. Landman Gay via use-livecode wrote:
>> I have a 2-card stack, very simple. The first card has a plain text
>> list field and an editable search field. The user types in a string
>> and the resulting match is displayed on card 2 with definitions. The
>> stack requires no inclusions and scripts are extremely basic. I use a
>> native Android field for the search term, and since mobile controls
>> will be removed when the card closes, I place the search term into a
>> hidden LC field for later reference.
>>
>> I build for Android using LC 10 dp 4, signed for "development only".
>> If I cable the phone to the Mac and do a Test build, the apk runs
>> perfectly. If I build an independent standalone and install the apk
>> from Google Drive, it runs fine except when putting the search term
>> into the LC field, where it claims there is no such object. It is most
>> certainly there on the card.
>>
>> I can fix this instance by using "field x of me" but then I get the
>> same error in an unrelated line in a different handler. If I fix that
>> one, it moves again. The riddle is why does it happen in a standalone
>> apk and not in a cabled test run?
>>
>> The script snippet from cd 1:
>>
>> on doSearch pText -- pText extracted from native field
>>   put word 1 to -1 of pText into pText -- strip trailing spaces
>>   put pText into fld "searchTerm" -- for reference; ERROR: "no such
>> object"
>>   ... <retrieve definition, populate a browser widget on cd 2>
>>   go cd 2
>>
>> BTW, if I leave the test apk on the phone it continues to work
>> correctly after removing the cable. The odd behavior happens
>> consistently on a Pixel 7 phone, an old Huawei tablet and a newish
>> Samsung tablet.
>>
>> If I use Nearby Share to move the working apk from a previously cabled
>> build to another device, it also works okay. So something is different
>> when building an independent standalone vs. building a test app.
>>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode






More information about the use-livecode mailing list