Normal Topic [Solved] PrintString Question (Read 504 times)
Don Haley
Member
*
Offline


No personal text

Posts: 38
Location: Plymouth, Devon, UK
Joined: Jan 23rd, 2004
[Solved] PrintString Question
Sep 29th, 2007 at 12:07pm
Print Post Print Post  
I am experimenting with PrintString for the first time and I am having difficulties in aligning a money element.  I would like the alignment to be right instead of the default left.

Any help gratefully received.  I am using Sesame v2.

Thanks Don
« Last Edit: Oct 1st, 2007 at 9:39pm by Hammer »  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: PrintString Question
Reply #1 - Sep 29th, 2007 at 12:27pm
Print Post Print Post  
Version 2 added an alignment argument to PrintString. Check out the new documentation.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Don Haley
Member
*
Offline


No personal text

Posts: 38
Location: Plymouth, Devon, UK
Joined: Jan 23rd, 2004
Re: PrintString Question
Reply #2 - Sep 29th, 2007 at 12:43pm
Print Post Print Post  
Hi Erika

I had read that but couldn't work out where to place it in the programming.

This is what I am using

PrintString("£" + @Decimals(Sup_Cost, 2), 650, 600, 0, " Arial", 16, 0)

Thanks

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


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: PrintString Question
Reply #3 - Sep 29th, 2007 at 1:06pm
Print Post Print Post  
I don't have a printer here, but try something like this.

GLOBAL CODE
#include "sbasic_include.sbas"

YOUR OTHER EVENT
    PrintString("£" + @Decimals(Sup_Cost, 2), 650, 600, 100, " Arial", 16, 0, PRINTSTRING_ALIGN_RIGHT)

The 100 in the 4th argument sets the width to which you want to right-align. Adjust as needed.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Don Haley
Member
*
Offline


No personal text

Posts: 38
Location: Plymouth, Devon, UK
Joined: Jan 23rd, 2004
Re: PrintString Question
Reply #4 - Sep 29th, 2007 at 1:24pm
Print Post Print Post  
Hi Erika

Thanks very much.  I hadn't put anything in the GLOBAL CODE, so when I had put PRINTSTRING_ALIGN_RIGHT in the correct place all I got was an error on testing.

We live and learn.

Thanks  Don
  
Back to top
 
IP Logged