- Published: Saturday, 04 April 2009
- Written by Digital DIY
- Hits: 4903
Structures are a powerful addition to the Swordfish arsenal, and here's a quick example of how to use them;
The declaration above informs the compiler that TTime contains three members, all of which are byte types (Hours, Minutes and Seconds). We can now create a variable of Type TTime, in exactly the same way as you would any other compiler type, such as Byte or Float,
Access To an individual member within the variable Time is achieved by using the period (.) notation,
Here's an example in full context (note that the Timer setup procedure 'Setup_Timer' has been removed for ease of explanation);
The member structure is just that, a structure. You could use the same structure for other variables.