Dim B AsByte Dim I AsByte Dim Bb AsByte Dim Ar(20)AsByte
Dim Sar AsString*20'strng array Dim Dl AsString*20'strng array
Sar ="TEST LIA"
'---------------------------------------------------------------------------------------------- Do
Bb =1 Call Teststr(bb , Sar(1)) Loop '---------------------------------------------------------------------------------------------- End '----------------------------------------------------------------------------------------------
Sub Teststr(b AsByte , Dl()AsString)
Dl(b)= Dl(b)+"add" EndSub
If I compile it with Bascom 2082, it shows errors :
Error : 238 Line : 25 Variable is not dimensioned as an array [SAR(1)]
Error : 263 Line : 25 Array index out of range [1] , in File : I:\Arhiv_Jure\BascomAVR\Jure\Doma\Jure\TMP_Rudi.bas
Error : 124 Line : 25 LOOP expected , in File : I:\Arhiv_Jure\BascomAVR\Jure\Doma\Jure\TMP_Rudi.bas
Is there something wrong with the file or new version of Bascom?
you declare this : Declare Sub Teststr(b As Byte , Dl() As String)
which means you will pass an array of strings.
but then you use this : Call Teststr(bb , Sar(1))
which ok, is a string but: you dimmed it like : Dim Sar As String * 20
which is a normal string.
so no that will not work. that an older version allowed that does not mean it is ok.
and the error actual point this out. _________________ Mark
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum