Passing key of an array as inout param doesn't work

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Passing key of an array as inout param doesn't work

Post by trevordevore » Wed May 27, 2015 3:15 pm

The compiler doesn't like this:

Code: Select all

handler myHandler(inout xVar as Path)
   ...
end handler

Code: Select all

myHandler(mVar[1]["path"])
Is this a bug or a known limitation?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: Passing key of an array as inout param doesn't work

Post by LCMark » Wed May 27, 2015 3:49 pm

I think that's called a bug in the compiler (at line 1392 of generate.g in fact) ;)

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Passing key of an array as inout param doesn't work

Post by trevordevore » Wed May 27, 2015 3:50 pm

Shall I report or do you have it taken care of?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: Passing key of an array as inout param doesn't work

Post by LCMark » Wed May 27, 2015 4:17 pm

I'm currently looking into it - hopefully it won't be difficult to fix.

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: Passing key of an array as inout param doesn't work

Post by LCMark » Wed May 27, 2015 5:21 pm

I've filed this as bug http://quality.runrev.com/show_bug.cgi?id=15429 - single indirection is fine, more than single indirection does not work at present.

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Passing key of an array as inout param doesn't work

Post by trevordevore » Wed May 27, 2015 5:23 pm

Thanks @LCMark.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Post Reply

Return to “LiveCode Builder”