Übergabe von Long und Single Variablen klappt nicht
Hallo Zusammen,
ich versuche gerade Long und Single Variablen an eine Subprozedur zu übergeben.
Das funktioniert aber nicht ich bekomme falsche Werte.
Hier das Testprog:
Code:
$regfile = "M32DEF.DAT"
$crystal = 8000000
Declare Sub Testlong(byval Wert1 As Long , Byval Wert2 As Long)
Declare Sub Testsingle(byval Wert1 As Single , Byval Wert2 As Single)
'LCD
Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.2 , Rs = Portc.3
Config Lcd = 16 * 4
Dim Clong1 As Long
Dim Clong2 As Long
Dim Csingle1 As Single
Dim Csingle2 As Single
Dim Tlong As Long
Dim Tsingle As Single
Do
Cls
Locate 1 , 1
Clong1 = 12545
Clong2 = 55555
Call Testlong(clong1 , Clong2)
Locate 2 , 1
Call Testlong(33333 , 2)
Locate 3 , 1
Csingle1 = 12545
Csingle2 = 55555
Call Testsingle(csingle1 , Csingle2)
Locate 4 , 1
Call Testsingle(33.45 , 1223.4)
Wait 10
Loop
Sub Testlong(byval Wert1 As Long , Byval Wert2 As Long)
Tlong = Wert1
Lcd Tlong
Tlong = Wert2
Lcd " " ; Tlong
End Sub
Sub Testsingle(byval Wert1 As Single , Byval Wert2 As Single)
Tsingle = Wert1
Lcd Tsingle
Tsingle = Wert2
Lcd " " ; Tsingle
End Sub
Als Werte bekomme ich
0 -1
0 138412032
-0.0 0.0
-0.0 -0.0
zurück.
Ist die Übergabe von Long und Singles in Bascom nicht möglich?
Gruß Ingo