Skip to content

Relation output

Leon Starr edited this page Nov 6, 2023 · 2 revisions

Outputting a relation

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

Introduction

Model semantics

Flows (as Variables)

Constants and literals

Structure of an activity

Accessing the class model

Data flow


Grammar and parsing notes

Components

Clone this wiki locally