Re: Documentation on Dispatch

2017-01-16 Thread Bob Sneidar via use-livecode
Right. A property set is an array of properties if I am not mistaken. So portal_RowNames is the "array" name and headerName is a variable which holds a value resolving to the name of the property. Hence it compiles. Bob S On Jan 16, 2017, at 10:45 , Jeanne A. E. DeVoto via use-livecode

Re: Documentation on Dispatch

2017-01-16 Thread Jeanne A. E. DeVoto via use-livecode
At 6:56 PM + 1/13/2017, Sannyasin Brahmanathaswami via use-livecode wrote: But I found this in a script from an associate: setprop portal_RowNames [headerName] rowNames and it compilesŠ the first param is a variable inside square braces. Not sure it this is some LC magic or just this

Re: Documentation on Dispatch

2017-01-13 Thread Mike Bonner via use-livecode
If I recall correctly, that is a keyed custom prop, and also if I remember correctly, it works with our without the space. (So its like an array, but its a property with array notation) portal_RowNames [headerName] and portal_RowNames[headerName] should both work. (unless I misremember

Re: Documentation on Dispatch

2017-01-13 Thread Sannyasin Brahmanathaswami via use-livecode
But I found this in a script from an associate: setprop portal_RowNames [headerName] rowNames and it compiles… the first param is a variable inside square braces. Not sure it this is some LC magic or just this programmer's "style" - Bob S: That can only be an element of an array.

Re: Documentation on Dispatch

2017-01-13 Thread Richard Gaskin via use-livecode
What does "do" do with an array expression missing an array name? -- Richard Gaskin Fourth World Systems Mike Kerner wrote: "Do" is magic On Fri, Jan 13, 2017 at 10:39 AM, Bob Sneidar via use-livecode < use-livecode at lists.runrev.com> wrote: That can only be an element of an array.

Re: Documentation on Dispatch

2017-01-13 Thread Mike Kerner via use-livecode
but more extensive pointer support would be nice, as would better pointer ERRR reference syntax. 4D nailed it there. ->x is a pointer to x y-> is whatever y points to On Fri, Jan 13, 2017 at 11:48 AM, Mike Kerner wrote: > "Do" is magic > > On Fri, Jan 13, 2017 at

Re: Documentation on Dispatch

2017-01-13 Thread Mike Kerner via use-livecode
"Do" is magic On Fri, Jan 13, 2017 at 10:39 AM, Bob Sneidar via use-livecode < use-livecode@lists.runrev.com> wrote: > That can only be an element of an array. Without the preceding array name, > it will not compile. > > Bob S > > > On Jan 12, 2017, at 21:11 , Sannyasin Brahmanathaswami via

Re: Documentation on Dispatch

2017-01-13 Thread Bob Sneidar via use-livecode
That can only be an element of an array. Without the preceding array name, it will not compile. Bob S On Jan 12, 2017, at 21:11 , Sannyasin Brahmanathaswami via use-livecode > wrote: [var] # value inside square braces…

Re: Documentation on Dispatch

2017-01-12 Thread Sannyasin Brahmanathaswami via use-livecode
@ pass by reference Wow! I'm only now learning about this? ….sheesh, this would have solved so many issues I faced in the past! and now pass arrays too. Fantastic. @ Richard: yes "wrap" was the wrong way to state this… "call a function with dispatch" is was I should have said BR PS there is

Re: Documentation on Dispatch

2017-01-11 Thread Ali Lloyd via use-livecode
Filed: http://quality.livecode.com/show_bug.cgi?id=19082 On Wed, Jan 11, 2017 at 1:08 AM Bob Sneidar via use-livecode < use-livecode@lists.runrev.com> wrote: > I use this ALL the time. sqlYoga uses special arrays for Record Objects, > and the elements of one of these arrays can *only* be

Re: Documentation on Dispatch

2017-01-10 Thread Bob Sneidar via use-livecode
I use this ALL the time. sqlYoga uses special arrays for Record Objects, and the elements of one of these arrays can *only* be modified using the sqlrecord_set command. Because of this, I need to pass these record objects by reference to update them correctly. Very handy. Bob S On Jan 10,

Re: Documentation on Dispatch

2017-01-10 Thread Bleiler, Timothy via use-livecode
Since Livecode version 7.0 it’s also possible to pass an array element by reference and that also works with “Dispatch”. Example: on mouseUp Put "27" into tTemp["tKey"] Dispatch "AdjustSetting" with tTemp["tKey"] # Now tTemp["tKey"] = 62 put tTemp["tKey"] end mouseUp on

Re: Documentation on Dispatch

2017-01-10 Thread Bleiler, Timothy via use-livecode
Another feature of “dispatch” that is undocumented is that it can be used with call by reference variables. The variables passed as call by reference can also be arrays, which can come in handy sometimes. Example: on mouseUp Put "27" into tTemp Dispatch "AdjustSetting" with tTemp #

Re: Documentation on Dispatch

2017-01-10 Thread Richard Gaskin via use-livecode
Monte Goulding wrote: > Try this: > > on mouseUp > dispatch function "foo" to me with 1,2 > put the result > end mouseUp > > function foo p1, p2 > return p1 + p2 > end foo Yep, it works. So it's not so much wrapping it per se, just calling it directly by adding the "function" specifier to

Re: Documentation on Dispatch

2017-01-10 Thread Monte Goulding via use-livecode
Try this: on mouseUp dispatch function "foo" to me with 1,2 put the result end mouseUp function foo p1, p2 return p1 + p2 end foo ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage

Re: Documentation on Dispatch

2017-01-10 Thread Richard Gaskin via use-livecode
Ali Lloyd wrote: > The `dispatch function` form of the dispatch command indeed does not > appear to be documented. What does that syntax look like? This works: on mouseUp dispatch "foo" to me with 1,2 put the result end mouseUp on foo p1, p2 return p1 + p2 end foo ...but this does

Re: Documentation on Dispatch

2017-01-10 Thread Ali Lloyd via use-livecode
The `dispatch function` form of the dispatch command indeed does not appear to be documented. On Tue, Jan 10, 2017 at 9:10 PM Richard Gaskin via use-livecode < use-livecode@lists.runrev.com> wrote: > Sannyasin Brahmanathaswami wrote: > > > Sometimes you want to do a "remote" call to a function

Re: Documentation on Dispatch

2017-01-10 Thread Bob Sneidar via use-livecode
A perhaps better way is to put all your functions that you want to call "remotely" in a button or a script only stack and when you first open your stack insert the script of into front or back. One thing to keep in mind however is scoping. "this" for example refers to the object which called

Re: Documentation on Dispatch

2017-01-10 Thread Richard Gaskin via use-livecode
Sannyasin Brahmanathaswami wrote: > Sometimes you want to do a "remote" call to a function and get data > back. At first this appear no possible > > send | dispatch | do | call > > BUT: FYI you can wrap a function in Dispatch and the value is > returned in the result. > > this is not documented.

Documentation on Dispatch

2017-01-10 Thread Sannyasin Brahmanathaswami via use-livecode
for the documentarians among us. Sometimes you want to do a "remote" call to a function and get data back. At first this appear no possible send | dispatch | do | call BUT: FYI you can wrap a function in Dispatch and the value is returned in the result. this is not documented.