READ/de

(Difference between revisions)
Jump to: navigation, search
((**COPIED FROM ENGLISH PAGE**) =)
(Remarks)
Line 15: Line 15:
 
<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="17%" style="width: 79px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="17%" style="width: 79px; border: 1px solid rgb(0, 0, 0);" |  
Var
+
var
  
 
| valign="top" width="100%" style="width: 400px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 400px; border: 1px solid rgb(0, 0, 0);" |  
Variable that is assigned data value.
+
Variable der der Wert zugewiesen wird.
  
 
|}
 
|}
Line 29: Line 29:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
It is best to place the&nbsp;[[DATA]]&nbsp;lines at the end of your program.
+
Es ist am besten, die [[DATA]] Zeilen am Ende des Programms zu schreiben.  
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
[[File:Notice.jpg|left|Notice.jpg]]&nbsp;It is important that the variable is of the same type as the stored data.
+
[[File:Notice.jpg|left|Notice.jpg]]Es ist sehr wichtig, dass die Variable denselben Datentyp hat wie die Daten in der Tabelle.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>

Revision as of 23:33, 5 March 2013

Contents

Funktion

Liest einen Wert und weist ihn der Variablen zu.

 

 

Syntax

READ var

 

 

Anmerkungen

var

Variable der der Wert zugewiesen wird.

 

Es ist am besten, die DATA Zeilen am Ende des Programms zu schreiben.

 

Notice.jpg
Es ist sehr wichtig, dass die Variable denselben Datentyp hat wie die Daten in der Tabelle.

 

 

 

See also

DATA , RESTORE

 

 

Example


'-----------------------------------------------------------------------------------------
'name : readdata.bas
'copyright : (c) 1995-2005, MCS Electronics
'purpose : demo : READ,RESTORE
'micro : Mega48
'suited for demo : yes
'commercial addon needed : no
'-----------------------------------------------------------------------------------------
 
$regfile = "m48def.dat" ' specify the used micro
$crystal = 4000000 ' 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
 
Dim A As Integer , B1 As Byte , Count As Byte
Dim S As String * 15
Dim L As Long
Restore Dta1 'point to stored data
For Count = 1 To 3 'for number of data items
Read B1 : Print Count ; " " ; B1
Next
 
Restore Dta2 'point to stored data
For Count = 1 To 2 'for number of data items
Read A : Print Count ; " " ; A
Next
 
Restore Dta3
Read S : Print S
Read S : Print S
 
 
Restore Dta4
Read L : Print L 'long type
 
 
'demonstration of readlabel
Dim W As Iram Word At 8 Overlay ' location is used by restore pointer
'note that W does not use any RAM it is an overlayed pointer to the data pointer
W = Loadlabel(dta1) ' loadlabel expects the labelname
Read B1
Print B1
End
 
 
Dta1:
Data &B10 , &HFF , 10
Dta2:
Data 1000% , -1%
 
Dta3:
Data "Hello" , "World"
'Note that integer values (>255 or <0) must end with the %-sign
'also note that the data type must match the variable type that is
'used for the READ statement
 
Dta4:
Data 123456789&
'Note that LONG values must end with the &-sign
'Also note that the data type must match the variable type that is used
'for the READ statement

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