why does this not work ?
hi, here is a code snipplet, which behaves misteriously (at least to me) <!--#if find --> <!--#call "REQUEST.set('qstemp',qs)" --> <!--#in find --> <!--#if sequence-start --> Insgesamt <!--#var sequence-length --> Treffer<BR> <!--#/if --> qstemp: <!--#var qstemp --> index: <!--#var "_['sequence-index']" --><br> <!--#call "REQUEST.set('si',_['sequence-index'])" --> <!--#var si -->,<!--#var qstemp --> <!--#if "si == qstemp" --> equal <!--#call "REQUEST.set('qs',_['sequence-index'] + 1)" --> <!---------------------- Form--------------------> Treffer Nr. <!--#var "_['sequence-index'] + 1" --><br> <a href="<!--#var document_id-->?qs=<!--#var qs -->&scol=<!--#var scol -->&srel=<!--#var srel -->&sval=<!--#var sval -->&go=<!--#var next -->"> nächster Treffer </a> </center> <!--#/if --> <!--#/in --> <!--#else --> not equal <!--#/if --> when I call this the first time I get: Insgesamt 9 Treffer qstemp: 0 index: 0 0,0 equal Treffer Nr. 1 nächster Treffer qstemp: 0 index: 1 1,0 not equal qstemp: 0 index: 2 2,0 not equal qstemp: 0 index: 3 3,0 not equal qstemp: 0 index: 4 4,0 not equal qstemp: 0 index: 5 5,0 not equal qstemp: 0 index: 6 6,0 not equal qstemp: 0 index: 7 7,0 not equal qstemp: 0 index: 8 8,0 not equal when I call it the second time, I get: Insgesamt 9 Treffer qstemp: 1 index: 0 0,1 not equal qstemp: 1 index: 1 1,1 not equal qstemp: 1 index: 2 2,1 not equal qstemp: 1 index: 3 3,1 not equal qstemp: 1 index: 4 4,1 not equal qstemp: 1 index: 5 5,1 not equal qstemp: 1 index: 6 6,1 not equal qstemp: 1 index: 7 7,1 not equal qstemp: 1 index: 8 8,1 not equal apparently the if evaluates only to true, if both values are "0". Any hint is welcome. Gruß Joachim Schmitz WWW-Consultant email: js@ac-copy.net tel: +49-241-89491-0 fax: +49-241-89491-29
Joachim Schmitz wrote:
here is a code snipplet, which behaves misteriously (at least to me)
[snip]
<!--#call "REQUEST.set('qstemp',qs)" -->
[snip]
<!--#if "si == qstemp" -->
[snip]
apparently the if evaluates only to true, if both values are "0".
Where does the value of 'qs' come from? If it originates as a form variable without an ':int' qualifier, as I suspect, then its value will be a string, while 'si' is an integer. Are you starting things off differently in the "0" case? You probably want to convert 'qs' to an integer, either by adding the qualifier or by explicitly using the "_.int()" function.
participants (2)
-
Evan Simpson -
Joachim Schmitz