Constants

A constant in Proteus is declared literally and can be used as any other variable, with the limitation that its value cannot be changed.

To declare a constant two methods can be used:

CONST id [=] "string" | number

assigns the specified string or number to id; the symbol '=' is optional, but it is strongly suggested to retain it

TEXT id [=] "string" | number
[text..]
[..]string

assigns the text that follows the method to id; the last line of the text must end with string or number, followed by any number of spaces and tabs; the text is assigned verbatim (no translation of C-like constants) and retains line terminators (CR, CR+LF, LF); this declaration is useful if there are many lines to write verbatim (e.g. HTML headers), to avoid multiple instructions and C-like constants

These methods are not an instruction; at compile time, the constant is created in memory and is assigned the specified value, which cannot be another variable/constant or a calculated expression.

All constants have the following restrictions:

All constants, like variables, can be local (if declared in a UDF) or public; the function PUB or the prefix '_' can be used to access public constants from a UDF. It is not possible to declare a public constant inside a UDF (this would have no meaning anyway, because assignment is done at compile time, not run-time). The interpretation of a constant follows the rules given for variables.

Start of page Next topic Previous topic Contents Index
Midnight Lake iPhone Case Black Women Shoes Black Flat Shoes Leather Flats Black Patent Ballerinas Black Ballet Shoes Casual Shoes Black Shoes Women Balle Record Player Cufflinks Best iPhone XR Clear Cases iPhone XS/XS Max Leather Cases Sale Best iPhone 8/8 Plus Silicone Cases iPhone 7/7 Plus Cases & Screen Protector New Cases For iPhone 6/6 Plus iPhone 8 Case Sale iPhone Xr Case Online iPhone 7 Case UK Online iPhone X Case UK Sale iPhone X Case Deals iPhone Xs Case New Case For iPhone Xr UK Online Case For iPhone 8 UK Outlet Fashion Silver Cufflinks For Men Best Mens Cufflinks Outlet Online The Gold Cufflinks Shop Online Cheap Shirt Cufflinks On Sale Nice Wedding Cufflinks UK Online Top Black Cufflinks UK Online Mens Cufflinks Online Silver Cufflinks For Men Men Cufflinks UK Sale Gold Cufflinks UK Online Gold Cufflinks UK Silver Cufflinks UK Shirt Cufflinks Discount Online Mens Cufflinks Deals & Sales Girls Shoes For Dance Fashion Ballet Dance Shoes Best Ballet Flats Shoes UK Online Cheap Ballet Pointe Shoes UK Online Best Ballet Shoes Outlet Best Dance Shoes Sale Cheap Ballet Flats Sale UK Best Pointe Shoes Online UK Ballet Dance Shoes UK Shoes For Dance UK Best Ballet Slippers Shop Best Yoga Shoes Hotsell