[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Incrementing a scatch variable.
****** message to minivend-users from Ramsey French <rammjet@mindspring.com> ******
I don't believe that a scratch variable can be incremented this way:
[scratch count + 1]
I believe it needs to be: [calc] [scratch count] + 1 [/calc]
On 1/17/00 6:40 PM, Hans-Joachim Leidinger at jojo@buchonline.net wrote:
> ****** message to minivend-users from Hans-Joachim Leidinger
> <jojo@buchonline.net> ******
>
> Aboubacar Diare wrote:
>> Does anyone know how to increment a scratch variable?
>> The following is a portion of the code i am using:
>>
>> [if scratch count == 6]
>> </tr><tr>
>> [else]
>> [set count][scratch count + 1][/set]
>> [/else]
>> [/if]
>>
>> i initially set count to 1. It does not increment count for some reason
>> in the [else] statement.
>>
>> Any help would be appreciated. Thank you.
>
>
> Hmmm...which some reason?
>
> test...with a loop (e.g. 25 or more)
>
> count = 1 -> if count == 6 --> no --> count = count +1 = 2
> count = 2 -> if count == 6 --> no --> count = count +1 = 3
> count = 3 -> if count == 6 --> no --> count = count +1 = 4
> count = 4 -> if count == 6 --> no --> count = count +1 = 5
> count = 5 -> if count == 6 --> no --> count = count +1 = 6
> count = 6 -> if count == 6 --> YEEESS! --> </tr><tr>
> count = 6 -> if count == 6 --> YEEESS! --> </tr><tr>
> count = 6 -> if count == 6 --> YEEESS! --> </tr><tr>
> count = 6 -> if count == 6 --> YEEESS! --> </tr><tr>
> ..
> ..
> ..
> count = 6 -> if count == 6 --> YEEESS! --> </tr><tr>
> count = 6 -> if count == 6 --> YEEESS! --> </tr><tr>
> and so on ....
>
> Hmmm...maybe i miss something like
>
>
> [if scratch count == 6]
> </tr><tr>
> [set count]1[/set]
> [else]
> [set count][scratch count + 1][/set]
> [/else]
> [/if]
>
> Maybe this can help..
>
> [if scratch count == 6]
> </tr><tr>
> [perl arg=scratch]
> $Safe{'scratch'}->{'count'} = 1;
> return '';
> [/perl]
> [else]
> [perl arg=scratch]
> $a = $Safe{'scratch'}->{'count'} + 1;
> $Safe{'scratch'}->{'count'} = $a;
> return '';
> [/perl]
> [/else]
> [/if]
>
>
> or without any setting of scratch count at the start
>
> [if scratch count == 6]
> </tr><tr>
> [perl arg=scratch]
> $Safe{'scratch'}->{'count'} = 0;
> return '';
> [/perl]
> [/if]
>
> [perl arg=scratch]
> $a = $Safe{'scratch'}->{'count'} + 1;
> $Safe{'scratch'}->{'count'} = $a;
> return '';
> [/perl]
>
> Regards,
>
> Joachim
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list