A user-defined type (UDT) is an advanced data type in DarkBASIC that you can customize for your own needs into a complex structure containing many variables within. A structure of this type greatly reduces the number of global variables you would normally need to use in a complex game.
You can define a UDT yourself using the TYPE and ENDTYPE statements, and the result is your own custom data type. Here is an example:
TYPE Person FirstName AS STRING LastName AS STRING Age AS INTEGER ENDTYPE
When you’re ready to use this type, you can define a variable AS [your type] to create a new variable of the type, like any other variable:
padawan AS Person
Voila, now you have a new variable using ...