ASC/de
(→See also) |
(→Example) |
||
Line 82: | Line 82: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | = <span class="f_Header"> | + | = <span class="f_Header">Beispiel</span> = |
<br/><source lang="bascomavr"> | <br/><source lang="bascomavr"> | ||
− | $regfile = "m48def.dat" ' | + | $regfile = "m48def.dat" ' Mikrocontroller |
− | $crystal = 8000000 ' | + | $crystal = 8000000 ' Taktfrequenz |
− | $baud = 19200 ' | + | $baud = 19200 ' Baudrate |
$hwstack = 32 ' default use 32 for the hardware stack | $hwstack = 32 ' default use 32 for the hardware stack | ||
$swstack = 10 ' default use 10 for the SW stack | $swstack = 10 ' default use 10 for the SW stack | ||
Line 98: | Line 98: | ||
s ="ABC" | s ="ABC" | ||
A = Asc(s) | A = Asc(s) | ||
− | Print A ' | + | Print A 'Gibt 65 aus |
End | End | ||
</source><br/>{{Languages}} | </source><br/>{{Languages}} | ||
[[Category:BASCOM_Language_Reference/de]] | [[Category:BASCOM_Language_Reference/de]] |
Revision as of 23:08, 3 March 2013
Contents |
Funktion
Weist einer numerischen Variable den ASCII-Wert des ersten Zeichens einer Zeichenkette zu.
Syntax
var = ASC(string)
Remarks
Var |
Target numeric variable that is assigned. |
String |
String variable or constant from which to retrieve the ASCII value. |
Note that only the first character of the string will be used.
When the string is empty, a zero will be returned.
ASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation of a character such as 'a' or '@' or an action of some sort. ASCII was developed a long time ago and now the non-printing characters are rarely used for their original purpose. Below is the ASCII character table and this includes descriptions of the first 32 non-printing characters. ASCII was actually designed for use with teletypes and so the descriptions are somewhat obscure. If someone says they want your CV however in ASCII format, all this means is they want 'plain' text with no formatting such as tabs, bold or underscoring - the raw format that any computer can understand. This is usually so they can easily import the file into their own applications without issues. Notepad.exe creates ASCII text, or in MS Word you can save a file as 'text only'
Extended ASCII
As people gradually required computers to understand additional characters and non-printing characters the ASCII set became restrictive. As with most technology, it took a while to get a single standard for these extra characters and hence there are few varying 'extended' sets. The most popular is presented below.
Siehe auch
ASM
NONE
Beispiel
$regfile = "m48def.dat" ' Mikrocontroller $crystal = 8000000 ' Taktfrequenz $baud = 19200 ' Baudrate $hwstack = 32 ' default use 32 for the hardware stack $swstack = 10 ' default use 10 for the SW stack $framesize = 40 ' default use 40 for the frame space Config Com1 = Dummy , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0 Dim A As Byte , S As String * 10 s ="ABC" A = Asc(s) Print A 'Gibt 65 aus End
Languages | English • Deutsch |
---|