SPC/de

From MCS Wiki AVR
< SPC(Difference between revisions)
Jump to: navigation, search
(Example)
(Remarks)
 
(One intermediate revision by one user not shown)
Line 17: Line 17:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">Remarks</span> =
+
= <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
+
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);" |  
The number of spaces to print.
+
Die Anzahl der auszugebenden Leerzeichen.
  
 
|}
 
|}
Line 31: Line 31:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
Using 0 for x will result in a string of 255 bytes because there is no check for a zero length assign.
+
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;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
SPC can be used with&nbsp;[[LCD]]&nbsp;too.
+
SPC kann auch mit [[LCD]] benutzt werden.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
The difference with the SPACE function is that SPACE returns a number of spaces while SPC() can only be used with printing. Using SPACE() with printing is also possible but it will use a temporary buffer while SPC does not use a temporary buffer.
+
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;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
Line 61: Line 61:
 
'suited for demo : yes
 
'suited for demo : yes
 
'commercial addon needed : no
 
'commercial addon needed : no
'purpose : demonstrates DEG2RAD function
+
'purpose : demonstrates SPC function
 
   
 
   
 
'-------------------------------------------------------------------------------
 
'-------------------------------------------------------------------------------
Line 73: Line 73:
 
   
 
   
 
Dim S As String * 15 , Z As String * 15
 
Dim S As String * 15 , Z As String * 15
Print "{" ; Spc(5) ; "}" '{ }
+
Print "{" ; Spc(5) ; "}"     '{     }
Lcd "{" ; Spc(5) ; "}" '{ }
+
Lcd "{" ; Spc(5) ; "}"     '{     }
 
</source><br/>{{Languages}}
 
</source><br/>{{Languages}}
  
 
[[Category:BASCOM Language Reference/de]]
 
[[Category:BASCOM Language Reference/de]]

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

SPACE

 

 

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  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language