Searching Schemas
Dawid Mocke
dawidmocke at gmail.com
Wed Jan 27 11:36:57 UTC 2021
you guys are rock stars! WOW
On Wed, 27 Jan 2021 at 13:28, Kelly Burgess <kellyb at montana.com> wrote:
> >Now what does it mean?
>
> The Do performs the expression, and discards the result (no Returns used).
> The expression has two parts whose results are added together and ignored.
>
> Part 1 defines a local list to return with matching schema names
> > Do schemaList.$define(schemaName)
>
> Part 2 is a sendall to all the schemas in the current library. (Udo's
> latest example also processes multiple libraries)
> The sendall expression is in two parts whose results are added together
> and ignored.
>
> Part 1 assigns the name of the current schema to a local, for use by the
> sendall in Part 2.
> > +$clib.$schemas.$sendall(schemaName.$assign($sendallref.$name)
>
> Part 2 is a sendall to all the current schema's columns ($ref.$objs),
> telling them to add their schema's name (assigned by the previous
> expression) to the schemaList, IF their name matches the pColumnName passed
> in.
> >
> +$ref.$objs.$sendall(schemaList.$add(schemaName),$ref.$name=pColumnName))
>
> The $define and $assign expressions return true or 1. The $sendall
> expressions return the count of objects the sendall acted on. Those are
> the integers that are actually added together and ignored.
>
> Adding expression results is a way to do several things at once. Do
> name.$assign('Mike')+tea.$assign('Yes, please')+time.$assign(#T) Returns
> result --- will perform three assignments and return 3 in result, assuming
> all the $assigns return true.
>
> Just beware of using things like $assign() inside a pick() because pick()
> executes all of its contained expressions before returning the indexed
> result, and that can perform assignments or methods you didn't expect would
> happen.
>
> Kelly
>
>
> > Quit method schemaList
> >
> > Kelly
> >
> >> On Jan 26, 2021, at 2:37 PM, Kelly Burgess <kellyb at montana.com> wrote:
> >>
> >> Hi Dawid,
> >>
> >> Here's another approach - pass in pColumnName, get a list back. I'm
> still wondering if you could flatten all that into a one-liner with a
> $sendall...
> >>
> >> Kelly
> >>
> >>
> >> Do schemaList.$define(schemaName)
> >> Do $clib.$schemas.$first() Returns schemaRef
> >> While schemaRef
> >> Do schemaRef.$objs.$findname(pColumnName) Returns colRef
> >> If colRef
> >> Do schemaList.$add(schemaRef.$name)
> >> End If
> >> Do $clib.$schemas.$next(schemaRef) Returns schemaRef
> >> End While
> >> Quit method schemaList
> >>
> >
>
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
>
--
Dawid Mocke
This message (and any associated files) is intended only for the use of the
individual or entity to which it is addressed and may contain information
that is confidential, subject to copyright or constitutes a trade secret.
If you are not the intended recipient you are hereby notified that any
dissemination, copying or distribution of this message, or files associated
with this message, is strictly prohibited. If you have received this
message in error, please notify us immediately by replying to the message
and deleting it from your computer.
More information about the omnisdev-en
mailing list