Normal Topic printstring formatting (Read 916 times)
pineberry
Full Member
***
Offline


No personal text

Posts: 115
Location: Strawberry, AZ  USA
Joined: Nov 30th, 2002
printstring formatting
Apr 7th, 2009 at 11:06pm
Print Post Print Post  
I vaguely recall seeing a function or subroutine sometime ago that would right justify number fields and include trailing zeroes in a field like 123.40. Can anyone tell me where i might have seen it? I didn't find in using the search feature but then I always have problems using it. I guess I just don't understand it.
Thanks for any assistance,
Harley
  
Back to top
 
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: printstring formatting
Reply #1 - Apr 8th, 2009 at 12:09pm
Print Post Print Post  
Hello Harley!

You can see it in Insidesesame October 2006 page 8.

var text1 as String
var text2 as String
NewPage(650, 900)
PrintPageMargin(72, 72, 72, 72)
PrintPagePaper(28)
text1 = @PromptForUserInput("Your full name, please","")
text2 = @PromptForUserInput("Your phone number, please","")
PrintString(text1, 0, 0, 0, "Verdana", 14, 0)
PrintString(text2, 0, 0, 0, "Verdana", 14, 1)
PrintString(text2, 645 - @PageExtentX(), 0, 0,"Verdana", 14, 0)
FinishPage()
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
pineberry
Full Member
***
Offline


No personal text

Posts: 115
Location: Strawberry, AZ  USA
Joined: Nov 30th, 2002
Re: printstring formatting
Reply #2 - Apr 8th, 2009 at 4:41pm
Print Post Print Post  
Hello Dr. Belhareth,
Thank you for the response. My copy of October 2006 page 8 refers to an answer to Natalie's question regarding copying data between main form and subform. I'm not sure your example is the answer to the function I want but I appreciate your routine.

Harley
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: printstring formatting
Reply #3 - Apr 8th, 2009 at 6:46pm
Print Post Print Post  
Hi Harley,

I forget are you Version 1 or Version 2?

In Version 2.X there is an argument where you can specify alignment for PrintString(), in Version 1.X there is a subroutine that I can give you that will print right aligned.

To include the Decimals in the printing, you would use @Decimals inside PrintString. Example:
Code
Select All
PrintString(@Decimals(NumberElement, 2), 100, 100, 0, "Verdana", 14, 0)  



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
pineberry
Full Member
***
Offline


No personal text

Posts: 115
Location: Strawberry, AZ  USA
Joined: Nov 30th, 2002
Re: printstring formatting
Reply #4 - Apr 8th, 2009 at 10:32pm
Print Post Print Post  
Hi Ray,
I am on 2.1 and aware of PrintString_Align_Right but forgot about the @Decimals but am not sure how to combine them. I'll experiment and probably find the solution.
Thanks,
Harley
  
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: printstring formatting
Reply #5 - Apr 9th, 2009 at 12:28am
Print Post Print Post  
Quote:
am not sure how to combine them


Look at Ray's example, he has given you an example.  
Just replace NumberElement with the name of the field that you want to extend the decimals on,
and insert the number of decimals you want..

PrintString(@Decimals(NumberElement, 2), 100, 100, 0, "Verdana", 14, 0)  
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
pineberry
Full Member
***
Offline


No personal text

Posts: 115
Location: Strawberry, AZ  USA
Joined: Nov 30th, 2002
Re: printstring formatting
Reply #6 - Apr 9th, 2009 at 3:38pm
Print Post Print Post  
Thanks Bob,
Already done.
Harley
  
Back to top
 
IP Logged