Positron Compiler Documentation

Strn

Source: Positron16 Compiler User Manual, PDF page 371

Syntax

Strn Byte Array = Item

Overview

Load a Byte Array with null terminated data, which can be likened to creating a pseudo String variable.

Parameters

Byte Array is the variable that will be loaded with values. Item can be another Strn command, a Str command, Str$ command, or a quoted character string

Example

' Load the Byte Array String1 with null terminated characters
  Device = 24HJ128GP502
                              ' Select the device to compile for
  Declare Xtal = 16
  Dim String1[21] as Byte
                              ' Create a Byte array with 21 elements
  DelayMs 100
                              ' Wait for things to stabilise
  Cls
                              ' Clear the LCD
  Strn String1 = "Hello World"
'
' Load String1 with characters and null terminate it
'
  Print Str String1
                              ' Display the string

See also

Arrays as Strings, Str$.