Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] Problem with [calc] and [scratch] variables



******    message to minivend-users from Frank Miedreich <miedreich@acm.org>     ******

>******    message to minivend-users from Ramsey French 
><rammjet@mac.com>     ******
>
>Dear List,
>
>I have looked in the list archives and cannot resolve this problem.
>
>When I [calc] two [scratch] variables and place the result into a [scratch]
>variable, an extra space or unprintable character ends up prepended to the
>final [scratch] variable.  This presents a problem when testing with [if] or
>using it as a key for searching in a table.
>

In set and seti everything between the opening and closing tags is 
assgnied to the named variable. This includes any whitespace and 
control (e.g. cr, lf) characters you use in your formatting. You 
would see that if you check the length of the scratch variable with 
perl or calc. In your example:
>     [seti my_test]
>         [calc][scratch my_var1]+[scratch my_var2][/calc]
>     [/seti]

there is whitespace both before and after the calc tags. To avoid 
this put the calc tag directly after the set, and the end calc tag 
directly before the end set tag.

To see the actual content of your scratch variable after 
interpolation it will not be enogh to look at the HTML display, but 
to copy the content of a source view into an editor that displays 
whitespace.

Cheers, Frank

-- 
Frank Miedreich
-
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


Search for: Match: Format: Sort by: