Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

endStruct

Purpose

End a structured variable definition

Description

Marks the end of a stuctured variable definition

Syntax

struct name
  type1 field1
  ...
  typen fieldn 
endStruct

Arguments

name name of the structure

field1 name of the first field

type1 type of the first field

fieldn name of the last field

typen type of the last field

Example

struct shape
    string name
    int sides
    int size
    vector pos
    int col
endStruct

shape shapes[3]
shapes[0] = [ .name = "triangle", .sides=3, .size=150, .pos = { 400, 150 }, .col = red ]
shapes[1] = [ .name = "square",   .sides=4, .size=150, .pos = { 400, 500 }, .col = yellow ]
shapes[2] = [ .name = "pentagon", .sides=5, .size=150, .pos = { 800, 150 }, .col = blue ]
shapes[3] = [ .name = "hexagon",  .sides=6, .size=150, .pos = { 800, 500 }, .col = green ]

loop
    clear()
    printAt( 0, 0, "Press A to show labels" )
    c = controls( 0 )
    for i = 0 to 4 loop
        drawShape( shapes[i], c.a )
    repeat
    update()
repeat

function drawShape( s, label )
    circle( s.pos.x, s.pos.y, s.size, s.sides, s.col, 0 )
    if label then
        drawText( s.pos.x - s.size/2, s.pos.y, s.size / 5, black, s.name )
    endIf
return void

Associated Commands

array, int, float, string, struct, vector

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.