N netbee New Member Apr 4, 2012 #1 Compiling code. Error Error compiling program. Error description: Cannot cast type: {Type=Double,Rank=0} to: {Type=Double,Rank=1} Occurred on line: 47 Pt1(0)=Pt0(0)+Dist*CosD(angDrs) =============================== Has been resolved Separator Code: Ptx(0)=px,Ptx(1)=py 'It should be ':' he was entered as ',' dist=Fun.distance(Pt0,Ptx)*1.5 Pt1=Fun.polar(Pt0,ang0,dist) Thank you very much answer Last edited: Apr 4, 2012
Compiling code. Error Error compiling program. Error description: Cannot cast type: {Type=Double,Rank=0} to: {Type=Double,Rank=1} Occurred on line: 47 Pt1(0)=Pt0(0)+Dist*CosD(angDrs) =============================== Has been resolved Separator Code: Ptx(0)=px,Ptx(1)=py 'It should be ':' he was entered as ',' dist=Fun.distance(Pt0,Ptx)*1.5 Pt1=Fun.polar(Pt0,ang0,dist) Thank you very much answer
N netbee New Member Apr 4, 2012 #2 Code: Sub polar(Pt0()As Double ,angDrs As Double ,Dist As Double )As Double() Dim Pt1(2)As Double Pt1(0)=Pt0(0)+Dist*CosD(angDrs) Pt1(1)=Pt0(1)+Dist*SinD(angDrs) Return Pt1 End Sub
Code: Sub polar(Pt0()As Double ,angDrs As Double ,Dist As Double )As Double() Dim Pt1(2)As Double Pt1(0)=Pt0(0)+Dist*CosD(angDrs) Pt1(1)=Pt0(1)+Dist*SinD(angDrs) Return Pt1 End Sub
warwound Expert Licensed User Longtime User Apr 4, 2012 #3 The rank of an array is the number of dimensions it contains. So your error message sounds like you have a problem with the number of dimensions in an Array. The thread i linked to above may help. Martin.
The rank of an array is the number of dimensions it contains. So your error message sounds like you have a problem with the number of dimensions in an Array. The thread i linked to above may help. Martin.
Erel B4X founder Staff member Licensed User Longtime User Apr 4, 2012 #4 I'm not getting any error when I try to compile this code.