PDA

View Full Version : dumb noob question


DenB
02-28-07, 05:56 AM
Hello.

I have a really simple syntax question. I'm trying to parse two text fields into another single field I can pass to PayPal per their spec. I just can't seem to figure out the syntax to get the values of these two fields to display in the new field. Numerical calculations yes, but not text.

One field, "items_selected," contains a list of items a user has selected.

<mveval expr="{items_selected}"> produces a correct result.

The other field contains a simple version result.

<mveval expr="{version}"> produces a similarly correct result.

I don't work in Miva much (obviously) and only to edit really. I just can't seem to work this one out using hunt and peck. It seems as though this should work, or some variant of it, but no.

<MvASSIGN NAME="item_name" VALUE="{items_selected} for {version}">

... or

<MvASSIGN NAME="item_name" VALUE="{items_selected} ' for ' {version}">

I tried some ANDs too, but to no avail. Can someone offer a quick primer on joining two calculated text fields as a text result, both for MvASSIGN NAME and to produce a simple html result?

Thank you in advance.
DenB

Kent Multer
02-28-07, 08:30 AM
You're on the right track. The correct syntax is something like:


<MvASSIGN NAME="item_name" VALUE="{ items_selected $ ' for ' $ version }">


In other words, use one pair of curly braces to enclose the expression, and the dollar-sign operator for concatenating strings.

You might find this book helpful:

http://www.amazon.com/exec/obidos/ISBN=0966103211/magicmetalproducA

DenB
03-06-07, 09:51 PM
I've been meaning to thank you Ken.

Concantenation, yes. I'm glad I prefaced my inquiry with dumb. If only I worked more in this area, and with Miva especially. It's not like I never worked with databases. It's just that I hardly do anymore :)