oleooo Posted November 1, 2019 Share Posted November 1, 2019 (edited) 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 November 1, 2019 by oleooo Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted November 1, 2019 Share Posted November 1, 2019 (edited) 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 November 1, 2019 by ThomasLewis Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.