-
Notifications
You must be signed in to change notification settings - Fork 0
Reading multiple attributes
Leon Starr edited this page Nov 6, 2023
·
2 revisions
You can assign multiple attribute values if a single instance is selected to the same number of scalar values. Each scalar value must be typed appropriately.
calling fnum, calling height = Floor( Name: ^calling floor ).(Number, Height)
The selection must find exactly one instance or a runtime error will result.
A safer approach might be:
calling floor .= Floor( Name: in.calling floor )
calling floor? calling fnum, calling height = calling floor.(Number, Height) : No calling floor -> ME
If, however, you are certain that one instance will be selected, say based on the requirement for an initial population, or by filtering input to your domain via a domain operation, for example, to ensure that the appropriate instances exist, then you may be satisfied to simply fail by not finding the instance and enjoy the simplicity in the first example.
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