Platform Builder Forums

Main => Suggestions => Topic started by: Antikore on January 06, 2019, 07:43:07 PM

Title: Labels
Post by: Antikore on January 06, 2019, 07:43:07 PM
Labels is a typical function in some coding that will be very useful in Platform Builder (Mostly on combining conditionals and in very large command prompts)

A label is set like this
Code: [Select]
=[label name]=
For example:
Code: [Select]
=Finish_game=

To call this label, will be like this
Code: [Select]
goto Finish_gameor
Code: [Select]
goto label Finish_game
What this does?
This will be useful because when we call a Label, the command prompts stops and instantly will start to execute commands from where the label is set in that command prompt.
For example
Code: [Select]
if score = 50
{
score - 50
goto Correct
}
exit
=Correct=
if lives > 5
{
# Commands here
}

If the label you go isn't in the command prompt set, the game continues the commands from where it started to go to the label, and just ignores it.

Title: Re: Labels
Post by: CGM on January 08, 2019, 12:02:23 AM
Good thinking!