Host db 4D Object references and components

I’ve been working with some component programming and following the documentation, which still states that variables (local, process, and interprocess) are unshared between the host and component. I’ve found that I can share an Object Reference directly with a component (interpreted and compiled) from an interpreted host db. My tests have only been with v17 R3, so I do not know if this was always the case with 4D language objects. Will the documentation eventually change to reflect that objects can be shared with components? or am I tempted to use an undocumented feature that may disappear in a later version?

Thoughts?

https://doc.4d.com/4Dv17R6/4D/17-R6/Interaction-between-components-and-host-databases.300-4354793.en.html

Hi Ed,

Variables are not shared, that’s true, except for references such as hierarchical list, dom, menu which are all references. So, you can share a reference with a component or a host database. This is also true with objects.

And pointers also ?

If it is a pointer to a process variable (or interprocess). Yes

As an exemple, in the 4D SVG component the command https://doc.4d.com/4Dv17R6/4D/17-R6/SVG-SET-DOCUMENT-VARIABLE.301-4464764.en.htmlSVG_SET_DOCUMENT_VARIABLE> allow to populate a variable of the host database when you call a “SVG_SAVE_AS_PICTURE/TEXT” command. Normally, you pass a pointer to the system variable https://doc.4d.com/4Dv17R6/4D/17-R6/System-Variables.300-4311476.en.htmlDocument>.