Page 1 of 1

Difference between /varcalc and ${Math.Calc[]}?

Posted: Tue May 04, 2004 8:50 pm
by LordGiddion
This code errors with test[1] not found and then echos 30.

Code: Select all

Sub Main
   /declare test[30] int outer
   /varset test[1] 30
   /varcalc test[1] ${test[1]}-5
   /echo ${test[1]}
/return
this Code works as expected and echos 25.

Code: Select all

Sub Main
   /declare test[30] int outer
   /varset test[1] 30
   /varset test[1] ${Math.Calc[${test[1]}-5]}
   /echo ${test[1]}
/return

Posted: Tue May 04, 2004 8:52 pm
by ml2517
Sounds to me like /varcalc doesn't like arrays.

Posted: Tue May 04, 2004 9:45 pm
by Lax
/varcalc and /vardata would both error if you tried to set arrays. fixed for next zip.