[fusionpro] RE: Combining 2 rules to function properly

2007-06-02 Thread hwills
hi dan,

thank you for all of your suggestions! i will attempt them on monday and
see what i come up w/!! i appreciate your help!

sorry about not signing my posting! my bad! i'm so used to my personal
email w/ its auto-signature!!

-Heather

:-)

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



[fusionpro] Re: Combining 2 rules to function properly

2007-06-01 Thread Ryan Blackmer

What's the code you're using for (Rule(Address1FONTRULE))?

Ryan

---

On Jun 1, 2007, at 8:54 AM, [EMAIL PROTECTED] wrote:


hello everyone,

i have a rule that i've been working on but cannot seem to get the  
results

i need. here is the rule i currently am at:


if (Field (Address1) == 666 fifth avenue)
;
return  1234567890 main street + 'p' + anywhereville, ca 92075
+(Rule(Address1FONTRULE));


i need that 1234567890 main street + 'p' + anywhereville, ca  
92075 to
actually print but i also need it to follow the Address1FONTRULE as  
this

will make the digits and text 2 different fonts.

what i'm getting now w/ my present rule is both of them combined  
(which is

what the + is doing). because i'm still in the learning curve of
javascript rules, i don't know the expression(s) or symbol(s) to  
put in

there to make that return follow the Address1FONTRULE.

does this make sense? does anyone have any suggestions? i hope so  
and any

help would be greatly appreciated. thank you in advance!!


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



[fusionpro] Re: Combining 2 rules to function properly

2007-06-01 Thread hwills
please forgive this question - code?

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



[fusionpro] Re: Combining 2 rules to function properly

2007-06-01 Thread Ryan Blackmer
Please copy and paste the your secondary rule so we can see how it's  
written.


The (Rule(Address1FONTRULE)) rule.

Ryan

---

On Jun 1, 2007, at 11:21 AM, [EMAIL PROTECTED] wrote:


please forgive this question - code?



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



[fusionpro] Re: Combining 2 rules to function properly

2007-06-01 Thread hwills
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
--



[fusionpro] Re: Combining 2 rules to function properly

2007-06-01 Thread Ryan Blackmer
Again... without knowing all the parts you're using to create the  
final results you could simply return the longer rule itself by  
changing the second line.


Inside the longer rule, replace the second line stating:

string1 = Field(Address1);

with:

string1 = 1234567890 main street + 'p' + anywhereville, ca 92075

or something that matches your data:

	string1 = Field(Address1) + br + Field(City) + ,  + Field 
(State) +   + Field(Zip);


and make sure to check the Treat string as tagged text box.

Outside of that, why are you using an If/Then statement? Do you have  
fixed location addresses that require different forced full addresses?


Let us know if this works for what you're trying to do.

Ryan


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



[fusionpro] RE: Combining 2 rules to function properly

2007-06-01 Thread Dan Korn
Well, you could change the order in which you're returning things from your 
rule so that the tags in the other rule modify the literal strings, like so:

  return Rule(Address1FONTRULE) + 1234567890 main street +
  'p' + anywhereville, ca 92075;

But, I don't think that will do what you're trying to accomplish.  You want the 
numbers and letters in 1234567890 main street to be in different fonts, 
right?  Simply calling the one rule and appending more text to that result 
won't do it.

It seems that what you're trying to do here is to have one rule pass input 
parameters to another rule.  Unfortunately, you can't do that, since rules 
don't take parameters.  You could set some global variables in the first 
(caller) rule and have the second (callee) rule access them.  But, what you 
really want to do in a case like this is to make a function.

Fortunately, turning a rule into a function is very easy.  All you have to do 
is cut-and-paste the body of the rule into a function block, like so:

  function MyFunctionName()
  {
// copy the rule's code here
  }

Then add the parameters between the parentheses after the function name.  The 
function can be defined either in your JavaScript Globals or in the rule which 
is calling it.

In your case, it looks like you want to use the Address1FONTRULE as a function. 
 It seems that you have one parameter called string1.  So, the function would 
look something like this:

  function AddressFonts(string1, changedChars_font, annon_changedChars_font)
  {
var changedChars_font = MetaPlusBook;
var non_changedChars_font = MetaPlusBookCaps;

//new_string1 will contain the return value
new_string1 = ;

// COPY ALL THE REST OF THE RULE AFTER THE LINE ABOVE HERE
  }

You can give the function whatever name you want.  Once you have the function, 
you can call it with the parameters you want.  For instance:

  return AddressFonts(1234567890 main street + 'p' + anywhereville, ca 
92075);

Or simply:

  return AddressFonts(Field(Address1));

You could also make changedChars_font and non_changedChars_font parameters of 
the function if you want.  You can even make them optional by providing 
defaults, like so (sorry for the wrapping in the email):

  function AddressFonts(string1, changedChars_font_in, 
annon_changedChars_font_in)
  {
var changedChars_font = changedChars_font_in || MetaPlusBook;
var non_changedChars_font = annon_changedChars_font_in || 
MetaPlusBookCaps;

//new_string1 will contain the return value
new_string1 = ;

// COPY ALL THE REST OF THE RULE AFTER THE LINE ABOVE HERE
  }

By the way, a much shorter version of the function would be:

  function AddressFonts(string1, changedChars_font_in, 
annon_changedChars_font_in)
  {
var changedChars_font = changedChars_font_in || MetaPlusBook;
var non_changedChars_font = annon_changedChars_font_in || 
MetaPlusBookCaps;

return f name=\ + non_changedChars_font + \ + 
s.replace(/\d+/g, f name=\ + changedChars_font + \$/f) +
/f;
  }

Regular expressions rock!

Dan

P.S.  Please sign your name at the bottom of your posts so that others know how 
to address you.


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