Jump to content

Polymorphism: Difference between revisions

Line 20:
DECLARE SUB CircleInit1 (pthis AS Circle, x0 AS INTEGER)
DECLARE SUB CircleInit2 (pthis AS Circle, x0 AS INTEGER, y0 AS INTEGER)
DECLARE SUB CircleInit3 (pthis AS Circle, x0 AS INTEGER, y0 AS INTEGER, r0 AS INTEGER)
DECLARE SUB CircleInitP0 (pthis AS Circle, p as Point)
DECLARE SUB CircleInitP0 (pthis AS Circle, p as Point, r0 AS INTEGER)
DECLARE FUNCTION CircleGetX (pthis AS Circle)
DECLARE FUNCTION CircleGetY (pthis AS Circle)
Line 45 ⟶ 48:
CircleInit p
CirclePrint p
 
SUB PointInit0 (pthis AS Point)
pthis.x = 0
pthis.y = 0
END SUB
 
SUB PointInit1 (pthis AS Point, x0 AS INTEGER)
pthis.x = x0
pthis.y = 0
END SUB
 
SUB PointInit2 (pthis AS Point, x0 AS INTEGER, y0 AS INTEGER)
pthis.x = x0
pthis.y = y0
END SUB
 
FUNCTION PointGetX% (pthis AS Point)
PointGetX% = pthis.x
END SUB
 
FUNCTION PointGetY% (pthis AS Point)
PointGetY% = pthis.y
END SUB
 
SUB PointSetX (pthis AS Point, x0 AS INTEGER)
pthis.x = x0
END SUB
 
SUB PointSetY (pthis AS Point, y0 AS INTEGER)
pthis.y = y0
END SUB
 
SUB PointPrint (pthis AS Point)
PRINT "Point"
END SUB
 
SUB CircleInit0 (pthis AS Circle)
pthis.x = 0
pthis.y = 0
pthis.r = 0
END SUB
 
SUB CircleInit1 (pthis AS Circle, x0 AS INTEGER)
pthis.x = x0
pthis.y = y0
pthis.r = 0
END SUB
 
SUB CircleInit2 (pthis AS Circle, x0 AS INTEGER, y0 AS INTEGER)
pthis.x = x0
pthis.y = y0
pthis.r = 0
END SUB
 
SUB CircleInit3 (pthis AS Circle, x0 AS INTEGER, y0 AS INTEGER, r0 AS INTEGER)
pthis.x = x0
pthis.y = y0
pthis.r = r0
END SUB
 
SUB CircleInitP0 (pthis AS Circle, p as Point)
pthis.x = p.x
pthis.y = p.y
pthis.r = 0
END SUB
 
SUB CircleInitP0 (pthis AS Circle, p as Point, r0 AS INTEGER)
pthis.x = p.x
pthis.y = p.y
pthis.r = r0
END SUB
 
FUNCTION CircleGetX% (pthis AS Circle)
CircleGetX% = pthis.x
END SUB
 
FUNCTION CircleGetY% (pthis AS Circle)
CircleGetY% = pthis.y
END SUB
 
FUNCTION CircleGetR% (pthis AS Circle)
CircleGetR% = pthis.r
END SUB
 
SUB CircleSetX (pthis AS Circle, x0 AS INTEGER)
pthis.x = x0
END SUB
 
SUB CircleSetY (pthis AS Circle, y0 AS INTEGER)
pthis.y = y0
END SUB
 
SUB CircleSetR (pthis AS Circle, r0 AS INTEGER)
pthis.r = r0
END SUB
 
SUB CirclePrint (pthis AS Circle)
PRINT "Circle"
END SUB
 
==[[C]]==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.