Jump to content

shift Tab between Phone and email


oleooo

Recommended Posts

Trying to split the phone number and email in a rule. I have created a if else statement so that if the email is missing the phone will center and if the phone is missing the email centers. I just can not get the last part to work. where generally in most programs if you hit tab shift it will equally split them.

Is there a way to code this with a tag.

 

here is the code I put together.

if (Field("Phone") < 1) {

return '<center>'+Field("Email")+'</center>';

} else if (Field("Email") < 1 ) {

return'<center>'+ Rule("phone format Rule1")+'</center>';

} else {

return '<p br=false quad=L>'+Field("Phone")+'<p br=false quad=R>'+Field("Email");

}

 

this is an example

 

208-371-9041 Ole@DirectOrthocare.com

Edited by oleooo
Link to comment
Share on other sites

Change the 14400 to whatever your frame width is (or just slightly under). Value is inches times 7200.

 

if (Field("Phone") && Field("Email"))
   return '<p br=false quad=L tabstops="0;14400,Right">' + Field("Phone") + '<t>' + Field("Email");
else
   return '<p br=false quad=C>' + Field("Phone") + Field("Email");

 

Explanation of whats happening here.

 

First you are evaluating if there is a value in both fields, if so then you are replacing the default tabstops with only a right aligned stop at the edge. Then placing the value of both fields separated by a tab.

 

If both fields do not have values, then you are replacing alignment with center and returning the value of both fields, only one of which will have something in it.

Edited by ThomasLewis
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...