It seems that the part you're trying to return somehow got mixed up with
the comparison you're making in the "if" statement. I think we need to
step back from the code and look at what the requirements are. As you
said:
"the final result i need from this rule is this: the address field will
have 2 different fonts. the numbers that are typed in will be the font
MetaPlusBookRoman and the letters that are typed in will be the font
MetaPlusBookCaps."
So, what's needed here is more than a simple comparison like "If the
value of the field is A then do B, else do C." It's more like "For EACH
character in the field value: if the character is a digit (number), put
it in MetaPlusBookRoman, else put it in MetaPlusBookCaps."
In other words, if I understand you correctly, you don't want to just
set the entire field value in one font, you want to set individual
characters in different fonts. Right?
Now, this is one way you could accomplish that:
//var input = "a1b2c3"; // to test
var input = Field("Address");
var result = "";
for (var i = 0; i < input.length; i++)
{
if ("1234567890".indexOf(input[i]) != -1)
result += "<f name=MetaPlusBookRoman>";
else
result += "<f name=MetaPlusBookCaps>";
result += input[i];
}
return result;
Dan
--
Users of FusionPro Desktop have unlimited free email support. Contact Printable
Support at [EMAIL PROTECTED]
--
View FusionPro Knowledge Base, FusionPro Samples at
www.printable.com/vdp/desktop.htm
--
You are currently subscribed to fusionpro as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
--
--
Note: All e-mail sent to or from this address will be received or otherwise
recorded by the e-mail recipients of this forum. It is subject to archival,
monitoring or review by, and/or disclosure to someone other than the recipient.
Our privacy policy is posted on www.printplanet.com
--