Setting Control Variables in CODESOFT – Instructional Article


This Instruction Article demonstrates how to set the value for a Control Variable in CODESOFT.


Control Variables are predefined variables in CODESOFT. They represent information from the label template or actions to be perform when printing the labels. For a complete list of control variable, please follow this link –

Many of the Control Variables are read-only. Therefore, you can only read their values. For some, you can set their values and change the behavior of the labels during print time.

To set the values for the non-read-only variables, you need to use the variable names as the name of the When Printed or Formula variables.

Example 1:

The When Printed variable is named @serialqty. The value 14 is assigned to the @serialqty. This will set the quantity of the label to be printed to 14.  If the variable is set as data entry field in the form, then user can enter the number of label to be printed directly from the form. This to avoid having to switch to the screen to select number of labels to be printed.

Example 2:

In this example, the variable @validforprint is set based on a the length of the ‘OK to Print’ variable

  • @validtoprint = 1  if the value is greater than 4
  • @validtoprint = 0 if the value is less than 4

This method can be use to validate the content of the label. If the value is set to 0, CODESOFT will not print the label.


Was this article helpful?

Related Articles