here is the Address1FONTRULE. its quite lengthy.
//a variable string1 is defined to hold content of the field.
string1 = Field("Address1");
//the following 2 variable values need to be changed to the desired fonts
var changedChars_font = "MetaPlusBook";
var non_changedChars_font = "MetaPlusBookCaps";
//new_string1 will contain the return value
new_string1 = "";
//create reusable strings that have the <f Name> tags for font changes
changedChars_font_tag = "<f Name =" + changedChars_font + ">";
non_changedChars_font_tag = "<f Name =" + non_changedChars_font + ">";
//count the characters in the input string
charCount = string1.length;
//set a flag variable to signify if a looked-for character is
encountered. Set to false initially.
found_lfc_flag = 0;
//a loop will be used to look at each character, determine if it is a
looked-for character,
//and decide if a point size tag is required.
for (x=1; x<=charCount; x++)
{
//get a character from the string and its ASCII code
single_char = Mid(string1, x, 1);
ascii_code = Asc(single_char);
//if the ASCII code is between 47 and 57, the character is a number
if (ascii_code >= 47 && ascii_code <= 57)
{
//At this point in the code, we know that the current char is a
looked-for character
//the found_lfc_flag tracks if the previous char was a number
//or not.
if (found_lfc_flag == 0)
{
//this code will set the flag to signify that a number was found
//and also add the tagged markup to the string to change the point
size.
found_lfc_flag = 1;
new_string1 = new_string1 + changedChars_font_tag;
}
}
else
{
//The else condition will execute if the current character is not a
looked-for character
//or if this is the first character in the string.
if (found_lfc_flag == 1 || x==1)
{
found_lfc_flag = 0;
new_string1 = new_string1 + non_changedChars_font_tag;
}
}
//lastly, the character we inspected is added to the string.
new_string1 = new_string1 + single_char;
}
return new_string1;
--
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
--