Font 2:Randomize:Cls Rnd(8^8)
Declare a![1323,50,20],b![50,100],c![50],d!,e![]
Declare a$[0,0,0],b$[1,0],c$[0],e$,f$[]
Declare x&,y&,z&, typ$,di& '= Dimensionen (0: Skalar)
'Parameterwert in der Klammer testweise tauschen:
GetXYZ( a![] ) ' belegt Variablen typ$, di& und, falls
' sinnvoll die Variablen x&,y&,z&
WaitInput
End
'----------------------------------------------------
PROC GetXYZ
var pt$=ptype$(1)
var verbose%=1 ' 1: Kontrollausgabe ein
typ$=mid$(pt$,1,1)
if match$(",[0-9]+,",pt$)>""
x&=val(match$("[0-9]+",match$("~[[0-9]+",pt$) ))
y&=val(match$("[0-9]+",match$(",[0-9]+,",pt$) ))
z&=val(match$("[0-9]+",match$(",[0-9]+~]",pt$) ))
di&=3:case verbose%:print x&,y&,z&,-di&
elseif match$("~[[0-9]+,[0-9]+~]",pt$ )>""
x&=val(match$("[0-9]+",match$("~[[0-9]+",pt$) ))
y&=val(match$("[0-9]+",match$(",[0-9]+~]",pt$) ))
di&=2:case verbose%:print x&,y&,-di&
elseif match$("~[[0-9]+~]",pt$) >""
x&=val(match$("[0-9]+",match$("~[[0-9]+~]",pt$) ))
di&=1:case verbose%:print x&,-di&
elseif match$("~[", pt$ ) = ""
di&=0:case verbose%:print -di&;" Skalarwert"
elseif match$("~[]", pt$ ) > ""
di&=-1:case verbose%:print -di&;": Dynamisches Array!"
else
print "ERROR: Interpretationsfehler ptype in GetXYZ()"
Endif
case verbose%: print "Typ = "; typ$
ENDPROC