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


No personal text

Posts: 115
Location: Strawberry, AZ  USA
Joined: Nov 30th, 2002
printstring formatting
Apr 21st, 2009 at 10:43pm
Print Post Print Post  
I am having a problem with alignment. With alignment set to 0 the numbers print in a column but are aligned left. When I use the following statement the numbers no longer appear on the form.

PrintString(@decimals(vAmount,2), 380,-1,0, "Arial", 12,PrintString_Align_Right)

NewPage (850, 110) is what I use and 380 for xpos prints where I want it except I would like it right aligned in the column.

Suggestions or corrections would be greatly appreciated.

Harley
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: printstring formatting
Reply #1 - Apr 23rd, 2009 at 2:07am
Print Post Print Post  
Alignment is the 8th parameter. You have it in the 7th location, which is the measure_only parameter.

In your example, PRINTSTRING_ALIGN_RIGHT puts a "1" in the measure_only parameter, which is why you are not getting any output (you are telling Sesame not to print, but to only measure).

So, add another parameter after the fontsize parameter ("12,") like this:
PrintString(@decimals(vAmount,2), 380, -1, 0, "Arial", 12, 0, PrintString_Align_Right)
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
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 23rd, 2009 at 4:42pm
Print Post Print Post  
Thanks Carl,
That solved the alignment problem but it didn't solve the placement of the data problem. When I printed the value before adding align right the data printed where I wanted it but now prints at the extreme right of the page. Is the xpos using different units when using
PrintString_Align_Right ? This is the statement as I have it now

PrintString(@decimals(vAmount,2), 380,-1,0, "Arial", 12,0,PrintString_Align_Right)

I tried changing the 380for xpos to 280 and that didn't change the position of the value.

Harley
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: printstring formatting
Reply #3 - Apr 23rd, 2009 at 4:55pm
Print Post Print Post  
If you want to right-align, I believe you need to set a width of something other than 0. Otherwise, we have no idea where the right edge is meant to be and can only use the edge of the page as "right".
  

- Hammer
The plural of anecdote is not data.
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 23rd, 2009 at 5:31pm
Print Post Print Post  
Thanks Ericka,
That solved the problem of placement on the page.

Harley
  
Back to top
 
IP Logged