The Lbl Command


Command Summary

Marks a point in the program for use with Goto and Toolbar..EndTBar.

Command Syntax

:Lbl label-name

Menu Location

This command can't be found in any menu besides the command catalog.

Calculator Compatibility

This command works on all calculators.

Token Size

2 bytes (plus 1-10 bytes for label name)

The Lbl command is used to mark a point in the program to which the Goto command or selections from a Toolbar..EndTBar menu can jump. When jumping to a label, the calculator will start searching the program from the beginning to find the label.

The same limitations are imposed on a label name as on a variable name. It's okay to have a label with the same name as a variable, though, this won't cause problems.

You can, theoretically, have labels in the same program with the same name, but only the first one will be used (the calculator will always find it before it finds the others). Labels don't extend beyond a program: you can't jump to a label inside a different program or function.

Also, the code inside an expr() string lives in its own program as far as labels are concerned: if you put a label in it, the main program won't find it; you can't jump out of a routine run with expr() into the main program; finally, you don't have to avoid the label names that the main program uses.

Error Conditions

500 - Invalid label happens when the label name uses an invalid character.

Related Commands

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License