[Zope] More REQUEST.set() not incrementing

Jerry.Spicklemire@IFLYATA.COM Jerry.Spicklemire@IFLYATA.COM
Tue, 11 Jan 2000 16:49:58 -0500


Hi again,

No response to my first distress call, so I thought maybe some more details
would 
help.

When I insert some print commands, the assigned "counter" (u_*) variables
exist, but are reported as being equal to zero (0). So, it appears that the
original assignment is "taking". 

Except that when I look at all of the variables by printing <dtml-var
REQUEST>, the same variables appear as being equal to one (1), so it seeems
like the incrementing is happening. 

Except that, the number never increases beyond one, so that it seems that
what appeared to be incrementing was really just re-setting the variable to
zero plus 1 (0 + 1), as if each pass through the loop is refreshing the
values to the original assignment. 

So, one might conclude that the _ variables are not persistent, or are too
persistent, depending on how you look at it.

The assorted ways I've tried to assign and retrieve these variable, e.g. in
:

<dtml-var u_all>
<dtml-var "u_all">
<dtml-var _[u_all]>
<dtml-var _["u_all"]>
<dtml-var "_[u_all]">
<dtml-var "_['u_all']">

Thanks for looking at this silly thing,
Jerry S.

<dtml-with "REQUEST.set('z_t', _.string.split(_.str(ZopeTime()))[0])">
<dtml-let u_all="_.string.atoi('0')" u_logged="_.string.atoi('0')"
u_today="_.string.atoi('0')">
 <dtml-var u_all> <dtml-var u_logged> <dtml-var u_today><br>
REQUEST = <dtml-var REQUEST>
 <dtml-in count_users_logged>
  <dtml-call "REQUEST.set('u_all',_.int(u_all)+1)">
users_with_access = <dtml-var u_all> <br>
  <dtml-if logged_on>
   <dtml-call "REQUEST.set('u_logged',_.int(u_logged)+1)">
users_logged_ever = <dtml-var u_logged> <br>   <dtml-if
"z_t==_.string.split(_.str(_.DateTime(logged_on)))[0]">
    <dtml-call "REQUEST.set('u_today',_.int(u_today)+1)">
users_logged_today = <dtml-var u_today> <br>   </dtml-if>
  </dtml-if>
 </dtml-in>
users_with_access = <dtml-var u_all> <br>
users_logged_ever = <dtml-var u_logged> <br>
users_logged_today = <dtml-var u_today> <br>
REQUEST = <dtml-var REQUEST></dtml-let>
</dtml-with>