Also, wenn b mit d belegt ist, ist b=d dann d=d, was immer TRUE (wahr) ist. Ist b mit r (oder irgendwas anderem) belegt, ist b=d gleich r=d, was Undefined (Undefiniert) ist. Bei einer If-Abfrage muss aber TRUE oder FAlSE rauskommen, bei Undefined kommt dann eben "Nicht definierbares Ergebnis in Bedingungsbeurteilung".
So ähnlich bei print d = d; hat d jetzt z.B. den Wert 20, so ist d = d dasselbe wie 20=20, was TRUE ist, folglich TRUE ausgegeben. Hingegen ist r = d/2 dasselbe wie r = 20/2 gleich r = 10, was weder TRUE noch FALSE noch UNDEFINED ist, daher nicht als Bedingungsbeurteilung aufgefasst und r = 10 ausgegeben.
Ein funktionierender Code wäre:
[CODE]
local b
local y
local tmp
local tmp2
local tmp3
local tmp4
local tmp5
InputStr b
strcmp b,"d",tmp
strcmp b,"r",tmp2
strcmp b,"u",tmp3
strcmp b,"a",tmp4
strcmp b,"A",tmp5
1îy
If tmp=0
then
clrtext
locate 1,y,"d="
locate 13,y,x
y+12îy
locate 1,y,"r="
locate 13,y,x/2
y+12îy
locate 1,y,"u="
locate 13,y,xîî
y+12îy
locate 1,y,"A="
locate 13,y,îî((x^2)/4)
return
ElseIf tmp2=0
then
clrtext
locate 1,y,"d="
locate 13,y,xî2
y+12îy
locate 1,y,"r="
locate 13,y,x
y+12îy
locate 1,y,"u="
locate 13,y,xî2îî
y+12îy
locate 1,y,"A="
locate 13,y,îîx^2
return
ElseIf tmp3=0
then
clrtext
locate 1,y,"d="
locate 13,y,x/î
y+12îy
locate 1,y,"r="
locate 13,y,x/(2î)
y+12îy
locate 1,y,"u="
locate 13,y,x
y+12îy
locate 1,y,"A="
locate 13,y,x^2/4î
return
ElseIf (tmp4=0) OR (tmp5=0)
then
clrtext
locate 1,y,"d="
locate 13,y,îP(4î(x/î))
y+12îy
locate 1,y,"r="
locate 13,y,îP(x/î)
y+12îy
locate 1,y,"u="
locate 13,y,îP((x/î)î2î)
y+12îy
locate 1,y,"A="
locate 13,y,x
return
IfEnd
[/CODE]
Aus dem Manager kopiert, î ist der Zuweisungspfeil (=>) und die restlichen Symbole dann eben die Wurzel und Pi Zeichen für die Berechungungen.
André