Pointers
Stated simply, a pointer is nothing more than a variable that holds an address in the computer memory. In other words, a pointer points at a specific location in memory.
A pointer may refer to no object, or be null. If an object is deleted or destroyed, all FISH symbols that point to that object will be set to null. You can use the intrinsic function null to test for null pointer values.
FISH pointer objects are typed, and the type is available with the intrinsic type.pointer
. This function returns a string identifying the object pointed to.
The type specifiers used in the FISH function signatures are given in the FISH Type Index section, including a number of pointer specifiers.
Certain FISH intrinsics return pointers to containers of objects, or pointers to object lists. These library functions end in .list. For example, zone.list
in FLAC3D or ball.list
in PFC.
These specific pointers may be directly converted into a list type with the list
library function, the result of which is a list that contains a pointer to each object in the container.
Pointers to containers are an iterable type. This means you can use it as the target of a loop foreach statement (see Loop ForEach and can be split (see Splitting). Each object in the container is iterated through in order.
Was this helpful? ... | Itasca Software © 2024, Itasca | Updated: Oct 31, 2024 |