发新话题
打印

Convert Pascal to Visual Basic

Convert Pascal to Visual Basic

Hi,
I am facing the problem in visual basic. My quesion is how to convert the below pascal in vb.

procedure coordinates(x, y:real; var sx, sy:integer; var OnScreen:boolean);
begin
sx:= round((getmaxx / Rx) * x + ((-getmaxx/Rx) * X_max + getmaxx));
sy:= round((-getmaxy / Ry) * y + ((getmaxy/Ry) * Y_min + getmaxy));
onscreen:= not ((sx < 0) or (sy < 0) or (sx > getmaxx) or (sy > getmaxy));
end;

thanks
Joe

TOP

Sub coordinates(x As Single, y As Single, sx As Integer, sy As Integer, OnScreen As Boolean)
    sx = Round((getmaxx / Rx) * x + ((-getmaxx / Rx) * X_max + getmaxx))
    sy = Round((-getmaxxy / Ry) * y + ((getmaxy / Ry) * Y_min + getmaxy))
    OnScreen = Not ((sx < 0) Or (sy < 0) Or (sx > getmaxx) Or sy > (getmaxy))
End Sub

TOP

Thanks a lot

TOP

发新话题