AW: O$ 5: $methodtext.$assign throws error 25216 (attempt to use instance/task var…)
Hi Nick,
Are you sure the $cwind is correct in your context?
Could it be, that you ought to be using $cinst instead of $cwind?
Regards
Rudolf Bargholz
—–Ursprüngliche Nachricht—–
Von: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] Im Auftrag von Nick Renders
Gesendet: Donnerstag, 8. Juni 2017 15:24
An: OmnisDev List – English <omnisdev-en@lists.omnis-dev.com>
Betreff: Re: O$ 5: $methodtext.$assign throws error 25216 (attempt to use instance/task var…)
Hi Peter,
Thank you for testing this out yourself.
I don’t think the problem is with the Item Reference variable.
When I test the code in a new window class, I’m not getting any errors either. It’s only when I set the superclass that the error appears. So I’m guessing the problem lies somewhere in the $control method of my window superclass.
I’ll do some further digging.
Cheers,
Nick
On 8 Jun 2017, at 13:55, Peter van Rooij wrote:
> Hello Nick
>
> I did some tests.
>
> When I do get an error it is on the first line of code . lRef will be
> NULL and consequently the second line of the code doesn’t work then..
> I never get an error the first time I run the code.
> Only when I execute the same code again. And that is understandable,
> because a method with that name already exists (from the first time).
> I still get the OK message because I am calling an existing method.
>
> Regards
>
> Peter
>
>
>> On 8 jun. 2017, at 12:19, Nick Renders <omnis1@arcict.com> wrote:
>>
>> Hi gang,
>>
>> We have a window where we dynamically add fields. Some of these
>> fields require some code in their $event method, so we add that as
>> well.
>>
>> Since we started using an error handler, I have noticed that
>> assigning the $methodtext property throws error 25216 :
>> Attempt to use an instance or task variable when no instance exists.
>>
>> The code actually works, but for some reason I keep getting the 25216
>> error for every $methodtext.$assign .
>>
>> Example code:
>>
>> Do $cwind.$objs.txtField1.$methods.$add(“$test1”) Returns lRef
>> Do lRef.$methodtext.$assign(“OK message {Hello world}”)
>> Do $cwind.$objs.txtField1.$test1()
>>
>>
>> Anyone have any idea what might be causing this?
>>
>>
>> Best regards,
>>
>> Nick Renders
>>
>> _____________________________________________________________
>> Manage your list subscriptions at lists.omnis-dev.com
>
>
> _____________________________________________________________
> Manage your list subscriptions at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com