Compound data type: Difference between revisions

Added solution for Action!
(→‎{{header|Go}}: simplify)
(Added solution for Action!)
Line 59:
point_x equ point_ram
point_y equ point_ram+MAX_POINT_OBJECTS</lang>
 
=={{header|Action!}}==
{{libheader|Action! Tool Kit}}
<lang Action!>INCLUDE "D2:REAL.ACT" ;from the Action! Tool Kit
 
TYPE PointI=[INT x,y]
TYPE PointR=[CARD rx,ry]
 
PROC Main()
PointI p1
PointR p2
REAL realx,realy
 
Put(125) PutE() ;clear screen
 
p1.x=123
p1.y=4567
 
ValR("12.34",realx)
ValR("5.6789",realy)
p2.rx=realx
p2.ry=realy
 
PrintF("Integer point p1=(%I,%I)%E",p1.x,p1.y)
 
Print("Real point p2=(")
PrintR(p2.rx) Print(",")
PrintR(p2.ry) Print(")")
RETURN</lang>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Compound_data_type.png Screenshot from Atari 8-bit computer]
<pre>
Integer point p1=(123,4567)
Real point p2=(12.34,5.6789)
</pre>
 
=={{header|ActionScript}}==
Anonymous user