I'm trying come up with generic code that produces a projection from an entity 
selection, and I think must be missing something obvious.  I’d like to perform 
the following statement:

$collection:=$employees.company.country

But as generic code. I want to be able to pass the ORDA path “company.country” 
as a text variable so that I can change it at runtime.

Obviously, using square bracket notation doesn’t work because square brackets 
for entity selections are used for indexes:

$collection:=$employees[“company.country”]  // Syntax error

So how can I do this?

I guess I could write a method that splits the ORDA path into tokens, examines 
each token individually, and traverses through relations if the token kind is a 
“relation" until we get to the last token, whose kind must be “storage".  But 
I’m hoping I’m just being ignorant - it seems like a lot of work for doing what 
object notation does so simply and elegantly.

Using 4D v18, macOS 10.14

Thanks for any advice!

- Steve



Steve Slanec
Slanecon Digital

**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to