CIA_BCP32 ( Barcode Type, Message )

Note: Most people do not need to use function CIA_BCP32( ). We have provided a function for every type of bar code, which is even easier to use;

See: Bar code functions for a list of functions you can use.

All of the bar code functions return a bar code as a string. The returned string automatically prints a bar code when the text is printed, using the appropriate TrueType bar code font.

For each type of bar code, specific fonts and font sizes are use;

See: Bar code font name and font size to use to discover the font and font size to select for each type of bar code.

Some functions return human-readable text, to print the text below bar codes. It is only necessary to use a function to get the human-readable text, if the text includes a printable check character.

Because the human-readable text can be returned as a separate string, the text can be printed anywhere, using any regular text font.

Barcode Type

The first argument of the function CIA_BCP32( ) is a string which specifies the bar code type to be returned. Because CIA_BCP32( ) can return any type of bar code, all of the other bar code functions use CIA_BCP32( ) to return a specific bar code type.

See: Specifying a bar code type to discover the strings you can use to return different bar code types.

See: Printing check characters to discover how check character options can be specified.

See: Printing human-readable characters to discover how to return human-readable text.

See: Bar code options / formats to discover how you can select special features of each bar code type.

Message

The message (i.e. data) to encode (i.e. put in the bar code) can contain any characters supported by the type of bar code you want to use.

To discover the characters that each bar code type supports;

See: Permitted bar code characters

Example

Here is a very simple script which returns an Interleaved 2 of 5 (ITF) bar code.

In this example, the string variable message is set to a fixed value, but you could easily get the value from a database field.

The string variable barcode is the result that can be used to print the actual bar code. To print the bar code you simply print string barcode anywhere in your application using font 'CIA ITF...'.

string barcode
string message
// You could use data from a database field
message = "37849387"
// Get Interleaved 2 of 5 (ITF) bar code for message
barcode = cia_bcp32("ITF-0.B", message)

// String barcode can now be printed using 'CIA ITF...' fonts.

However, if we use function cia_itf( ) instead we get exactly the same result, but the code is simpler to understand;

string barcode
string message
// You could use data from a database field
message = "37849387"
// Get Interleaved 2 of 5 (ITF) bar code for message
barcode = cia_itf(message)

// String barcode can now be printed using 'CIA ITF...' fonts.

This expression cia_itf ( message ) is the same as cia_bcp32( "ITF-0.B", message ) because function cia_itf( ) actually uses the expression cia_bcp32( "ITF-0.B", message ) to return its result.

 


Copyright 2000 CIA (BAR CODES) UK. All rights reserved. Reproduction prohibited.