ASC/de

From MCS Wiki AVR
< ASC
Revision as of 23:05, 3 March 2013 by Stefanhamburg (Talk | contribs)
Jump to: navigation, search

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'


 

Ascii table.png

 

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.


 

Ascii table ext.png

 

 

See also

CHR

 

 

ASM

NONE

 

 

Example


$regfile = "m48def.dat" ' specify the used micro
$crystal = 8000000 ' used crystal frequency
$baud = 19200 ' use baud rate
$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 'will print 65
End

Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language