#
# sgltyp.rb
#
# $Id: sgltyp.rb,v 1.1 2000/11/21 03:02:07 keiko Exp $
#
require "narray"
require "numru/dcl"
include NumRu
include Math
n = 2
x = NArray.sfloat(n)
y = NArray.sfloat(n)
#-- graph ---
iws = (ARGV[0] || (puts ' WORKSTATION ID (I) ? ;'; DCL::sgpwsn; gets)).to_i
DCL::sgopn iws
DCL::sgfrm
DCL::sgtxzv(0.5, 0.9, 'LINE TYPE', 0.04, 0, 0, 3)
x[0]=0.4
x[1]=0.8
for i in 1..5
if (1 <= i && i <= 4)
itype=i
else
cpat = "0011111111001001"
itype = ("0b" + cpat).oct
DCL::sgsplt(itype)
end
cttl = format("ITYPE = %5d", itype)
y[0]=0.7-(i-1)*0.12
y[1]=y[0]
DCL::sgtxzv(0.1, y[0], cttl, 0.02, 0, -1, 3)
if (i == 5)
DCL::sgtxzv(0.1, y[0]-0.05, '(' + cpat + ')', 0.015, 0, -1, 3)
end
DCL::sgplzv(x, y, itype, 3)
end
DCL::sgcls
syntax highlighted by Code2HTML, v. 0.9.1