[Zope] Newbie: help with math syntax?

David Robson robson555@yahoo.com
Thu, 16 Sep 1999 11:43:26 -0700 (PDT)


...in fact I’m not quite experienced enough to be a newbie. 

I’m trying to write a series of simple DTML Documents to learn syntax.
I’ve read lots of Zope docs but haven’t found an example of add,
subtract, multiply, divide.  (Probably too simple.) Here’s my
unsuccessful attempt in two DTML pages:


Code for index_html


<!--#var standard_html_header-->
<h2><!--#var title_or_id--></h2>
<p>
This is the <!--#var id--> Document.
<BLOCKQUOTE>

<FORM ACTION="addTotal">
<P>Enter a number:
<INPUT TYPE="text" SIZE="3" NAME="number1"></P>
<P>Enter a number:
<INPUT TYPE="text" SIZE="3" NAME="number2"></P>
<P>Enter a number:
<INPUT TYPE="text" SIZE="3" NAME="number3"></P>

<INPUT TYPE="submit" VALUE="Compute">
</FORM>

</p>
</BLOCKQUOTE>
<!--#var standard_html_footer-->

/\/\/\/\/\/\

The above DTML Document seems to work OK. It calls the DTML Document
addTotal which reads back the parameters OK but won’t sum them…no doubt
because I’m using the wrong syntax. Here’s code for addTotal including
my unsuccessful guesses.



<!--#var standard_html_header-->
<h2><!--#var title_or_id--></h2>

<P>The first number is <!--#var number1--></P>

<P>The second number is <!--#var number2--></P>

<P>The third number is <!--#var number3--></P>

The total is: 
<!--#var number1-->+<!--#var number2-->+<!--#var number3--><BR>

Not!</P>

<P>Perhaps the total is: 
<!-- expr="#var number1+#var number2+#var number3"-->
<!-- #var expr="#var number1+#var number2+#var number3"-->
<!-- #var expr(#var number1+#var number2+#var number3)-->
<!-- #var expr(#var number1+#var number2+#var number3)-->
<!-- expr(#var number1+#var number2+#var number3)-->
<!-- expr("#var number1+#var number2+#var number3")-->
<!-- #var expr(#var number1+#var number2+#var number3)-->
<!-- #var expr("#var number1+#var number2+#var number3")-->
<!-- expr(#var "number1"+"#var number2"+"#var number3")-->
<!-- expr(#var "number1+#var number2+#var number3")-->
<!-- #var expr(#var number1+#var number2+#var number3)-->
<!-- #var expr("#var number1"+"#var number2"+"#var number3")-->

<BR><BR>Still not!<BR><BR>

<!--#var standard_html_footer-->


/\/\/\/\

Can someone please write the correct sum expression for me?
While you’re at it, how about the expression for finding the square
root of one of the numbers?

Thanks!


===

David Robson            robson555@yahoo.com
Computer Support        Towson High School, MD, USA

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com