Übersicht

ByteToChar

Die Funktion ByteToChar ist eine reine Typkonvertierung. Das Byte wird in ein Char umgewandelt.

Syntax

< Variable vom Typ Char > := ByteToChar ( < Variable oder Konstante vom Typ Byte > ) ;

Parameter

< Variable oder Konstante vom Typ Byte >

Beispiel


1
2
3
4
5
6
7
8
9
10
11
12
13
14
PROGRAM test_ByteToChar;
 
DEVICE = mega644P;
 
VAR
  b1 : Byte;
  c1 : Char;
 
BEGIN
 
  b1 := $41;
  c1 := ByteToChar(b1);
 
END test_ByteToChar.

In Zeile 11 wird der Bytevariablen "b1" der Bytewert $41 zugewiesen.

In Zeile 12 wird der Typ Byte (mit Hilfe der Fuktion ByteToChar) in den Typ Char umgewandelt und in die Variable "c1" geschrieben. Der Bytewert $41 entspricht dem Zeichen "A".

siehe auch

CharToByte



Übersicht