Positron Compiler Documentation

Strn

Positron16 · Revision 1.1.3.5 · PDF page 371

Strn Byte Array = Item

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

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

' 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$.

View original PDF page 371Open page in PDFOriginal PDF page 371