Item Reference Won't Work

Das Goravani goravanis at gmail.com
Sun Oct 9 14:56:16 UTC 2022


Doug,

I want to transfer the value from the local item ref to a task item ref for the sake of broader scope.

You mentioned the local ref will go out of scope when that object is finished. Yes, true, but isn’t the value actually transferred if say you 

Set reference tWindowRef to lWindowRef.$ref().  ??????

If I do that, isn’t the ref fully transferred to the Task Var?

The local var is RETURNED by the opening of a window using $open()

I tried putting the task var in the RETURNS slot and it was not set by the opening of the window. So the task var simply isn’t working. 

I will try making it local, then dragging it to task to see if it will work that way. 

Thanks

Das
Richard



> On Oct 9, 2022, at 10:47 AM, Doug Easterbrook via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
> 
> make a new local  ‘itemref’ variable called.   ‘mytestref’  and try assign it
> 
> set reference mytestref to lWindowRef
> 
> if that works, drag the local variable from the local variable pane to the task var variable and try running the same line of code
> 
> 
> if this works, then you know you can assign an item ref to a task var.    and not its a matter of deciding if the oroginal task var is not defined the way you thought it was … or if the line of code is not tokenized properly.       
> 
> for tokenization, retype the line of code and then see if that works.
> 
> 
> if it doesn’t then you are stuck.
> 
> 
> 
> also,  why would you want to assign a local item ref to a task var?     as soon as the local method is done with, then the taskvar has no valid reference.    maybe thats an issue as the variable is out of scope and omnis knows is??
> 
> 
> 
> 
> 
> 
> Doug Easterbrook
> Arts Management Systems Ltd.
> mailto:doug at artsman.com
> http://www.artsman.com
> Phone (403) 650-1978
> 
>> On Oct 9, 2022, at 6:25 AM, Das Goravani <goravanis at gmail.com> wrote:
>> 
>> 
>> Studio 4.3
>> Using the VCS
>> Windows
>> 
>> I declare an Item Reference as a Task Variable
>> I use it in a line of code
>> In execution it stops on the line where I try to Set the Reference and says "Attempt to assign a reference to a variable that is not an item reference"
>> 
>> It is an Item Ref. 
>> I am assigning it from another ref that is a local variable, my item ref. Is a task variable
>> 
>> As in
>> 
>> Set reference tWindowRef to lWindowRef
>> 
>> Why is it saying it is not an item reference?
>> 
>> I have the Startup_task checked out of the VCS, alone with another class that has the code in it. 
>> 
>> I have a feeling that it is something else, and it is only saying that out of some default error checking code they have in Omnis
>> 
>> Does anybody have any idea what I might try, how I can make this "go ahead" and start working?
>> 
>> Thanks
>> 
>> Das Goravani
>> Richard Wurst (I’m going back to my birth name)
>> _____________________________________________________________
>> Manage your list subscriptions at https://lists.omnis-dev.com
>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list