-
Notifications
You must be signed in to change notification settings - Fork 0
Relation output
Leon Starr edited this page Nov 6, 2023
·
2 revisions
Or you could output them as a single row table:
return #( angle: a, distance: d )
Now the calling activity can retrieve these values like so:
track #= /R8/Aircraft.Trackto( target : nearby aircraft.ID )
a = track.Angle; d = track.Distance
This would also work:
a, d = /R8/Aircraft.Trackto( target : nearby aircraft.ID )
Or even:
track #= /R8/Aircraft.Trackto( target : nearby aircraft.ID )
nearby aircraft.(Angle, Distance) #= track // assign results to attribute values
The name doubling simplification used for input parameters also applies to output parameters. If the variable names in a class method or domain operation match the returned attribute names, there is no need to double them. Therefore, this would also work with the above example:
=>> ( angle, distance ) // variable names match output parameter names
Copyright 2020, 2021, 2022, 2023, 2025 © Leon Starr under MIT Open Source License
- Why they are problematic
- Instance attribute creation values
- Boolean values
- Special values
- Enumerated values
- Action block
- Statement
- Single line action
- Multiple dependent actions on a single line
- An action spread across multiple lines
- A conditional group of single line actions
- Comments
- Finding instances
- Attribute access
- Creation and deletion
- Subclass migration
- Creating a table from a class
- Creating a table with a definition
- Converting a table into a class
- Set operations on tables
- Set comparisons on tables
- Join
- Rename
- Extend
- Aggregation
- Rank
- Image
- Input values
- Signatures and name doubling
- Output values
- Execution order
- Sequential execution
- Conditional execution
- Signals
- Scrall has no for_each action
- Iteration