Using (a pun) such long references is a code smell. You need to encapsulate your containers, your controls and your methods. Start by making all controls of your containers private. Then define a communication of the container back to the window.
In the past I asked the possibility of creating “Aliases” (denied) just for such case. The explanation was that I could CREATE ANOTHER var to hold a shorter name. I was not satisfied, it’s not the same, it causes mem and speed penalties, but it’s the Xojo way.
Asigning another Var instead of using something directly could be pretier code, convinient, faster to type BUT the extra step, will SLOW the code (negligible).
What Beatrix said is the recomended way, but not wallways is the best way.
You can do it creating a local variable that points to your object, (maybe this is what Tim was talking about)
Dim FS as WhatEverTypeIsThat = Window1.FPmyMapS1.FlightPlanOnMapS1a.XmlFlightPlan
FS.DepartureLat = X
Y = FS.DepartureLat
...
I don’t know how you imagined that, but using such workaround instead of a direct access via an alias causes the following at runtime in a closed scope:
New var ref allocation.
copy the ref target destination address to such var.
Incrementing the reference count.
here you do your job
decrement the reference count.
release the ref var memory
An alias would do only the step 4 : Do the job.
What’s an alias? A metalanguage (code that generate another code) concept, like macros, but maybe simpler and dumber, something solved at compile time and not at runtime, like:
Alias r As Window1.FPmyMapS1.FlightPlanOnMapS1a.XmlFlightPlan // r exists only at compile time
r.DepartureX = X
r.DepartureY = Y
That’s exactly the same as writing
Window1.FPmyMapS1.FlightPlanOnMapS1a.XmlFlightPlan.DepartureX = X
Window1.FPmyMapS1.FlightPlanOnMapS1a.XmlFlightPlan.DepartureY = Y
No extra allocations and processing, just the execution part that could be extra fast if the compiler can infer and hold the value of XmlFlightPlan in CPU registers to be reused right after (the repeating Alias “r”, helps that).