SPC/de
From MCS Wiki AVR
< SPC(Difference between revisions)
(→Beispiel) |
(→Remarks) |
||
Line 17: | Line 17: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | = <span class="f_Header"> | + | = <span class="f_Header">Anmerkungen</span> = |
<div style="padding: 0px; margin: 0px 0px 0px 4px;"> | <div style="padding: 0px; margin: 0px 0px 0px 4px;"> | ||
{| width="488" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;" | {| width="488" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;" | ||
|- style="vertical-align: top;" | |- style="vertical-align: top;" | ||
| valign="top" width="11%" style="width: 50px; border: 1px solid rgb(0, 0, 0);" | | | valign="top" width="11%" style="width: 50px; border: 1px solid rgb(0, 0, 0);" | | ||
− | + | x | |
| valign="top" width="100%" style="width: 429px; border: 1px solid rgb(0, 0, 0);" | | | valign="top" width="100%" style="width: 429px; border: 1px solid rgb(0, 0, 0);" | | ||
− | + | Die Anzahl der auszugebenden Leerzeichen. | |
|} | |} | ||
Line 31: | Line 31: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | + | Die Benutzung einer 0 für x führt zu einer Zeichenkette mit 255 Bytes weil keine Prüfung auf Null-Länge durchgeführt wird. | |
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | SPC | + | SPC kann auch mit [[LCD]] benutzt werden. |
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | + | Der Unterschied zur SPACE-Funktion ist, dass SPACE eine Anzahl Leerzeichen zurückgibt während SPC() nur für die Ausgabe benutzt werden kann. Die Benutzung von SPACE() ist auch bei Ausgaben möglich aber dann wird temporärer Platz verwendet was bei SPC nicht der Fall ist. | |
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> |
Latest revision as of 01:40, 1 March 2013
Contents |
Funktion
Gibt die angegebene Anzahl Leerzeichen aus.
Syntax
PRINT SPC(x)
LCD SPC(x)
Anmerkungen
x |
Die Anzahl der auszugebenden Leerzeichen. |
Die Benutzung einer 0 für x führt zu einer Zeichenkette mit 255 Bytes weil keine Prüfung auf Null-Länge durchgeführt wird.
SPC kann auch mit LCD benutzt werden.
Der Unterschied zur SPACE-Funktion ist, dass SPACE eine Anzahl Leerzeichen zurückgibt während SPC() nur für die Ausgabe benutzt werden kann. Die Benutzung von SPACE() ist auch bei Ausgaben möglich aber dann wird temporärer Platz verwendet was bei SPC nicht der Fall ist.
Siehe auch
Beispiel
'------------------------------------------------------------------------------- 'copyright : (c) 1995-2005, MCS Electronics 'micro : Mega48 'suited for demo : yes 'commercial addon needed : no 'purpose : demonstrates SPC function '------------------------------------------------------------------------------- $regfile = "m48def.dat" ' specify the used micro $crystal = 8000000 ' Taktfrequenz $baud = 19200 ' Baudrate $hwstack = 32 ' default use 32 for the hardware stack $swstack = 40 ' default use 10 for the SW stack $framesize = 40 ' default use 40 for the frame space Dim S As String * 15 , Z As String * 15 Print "{" ; Spc(5) ; "}" '{ } Lcd "{" ; Spc(5) ; "}" '{ }
Languages | English • Deutsch |
---|