It is currently Sat May 18, 2013 7:51 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Printer_lib v1.10 and the `&` sign
PostPosted: Tue Apr 10, 2012 8:31 pm 
Offline
New User
New User

Joined: Tue Apr 10, 2012 8:23 pm
Posts: 3
Hi

I am using Printer_lib ver 1.10 with Purebasic 4.60 (Windows 7) and everything was working OK until I noticed the & sign doesn't print.

I am using the following code with prints fine except it replaces the & with a _

Print_DrawText(x, 5,width,10," Sample text & text")

I need to use printer_lib as the standard printer functions doesn't support selecting the printer in code.

I have tried changing the font but this makes no difference (Times New Roman and Arial)

Can someone help me out with this problem.
Thanks
Andyf


Top
 Profile  
 
 Post subject: Re: Printer_lib v1.10 and the `&` sign
PostPosted: Tue Apr 10, 2012 8:38 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jan 21, 2011 8:25 am
Posts: 540
Try && if it behaves the same like WinAPI on this. :)

_________________
Image
ImageImageImageImage
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds


Top
 Profile  
 
 Post subject: Re: Printer_lib v1.10 and the `&` sign
PostPosted: Tue Apr 10, 2012 8:41 pm 
Offline
New User
New User
User avatar

Joined: Fri Mar 30, 2012 2:30 am
Posts: 7
Location: Southbury, CT
I am just as new to PureBasic as you are, but this probably has something to do with a "NOPREFIX" style for printing or something. This basically means that the ampersand (&) is ignored and the next character is underlined.

Someone might be able to tell you how to disable that function so that an ampersand (&) will print correctly.

This happened to me when programming in another language in a static text control so instead of just adding the SS_NOPREFIX style I believe I just used "&&" and the ampersand showed up correctly. Maybe you could try that.....


EDIT: ...... NINJA'd ......

{:0)

Brandon

_________________
Windows 7 Home Premium 64-bit Intel(R) Quad Core(TM) i5 CPU M 430 @ 2.27GHz 4GB DDR3 RAM


Last edited by Brandon Parker on Thu Apr 26, 2012 1:19 am, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Printer_lib v1.10 and the `&` sign
PostPosted: Tue Apr 10, 2012 8:46 pm 
Offline
New User
New User

Joined: Tue Apr 10, 2012 8:23 pm
Posts: 3
Shield wrote:
Try && if it behaves the same like WinAPI on this. :)



Yes, that works. Thanks

I am printing the contents of a string gadget so I will need to check for `&` signs
and if detected, insert another`& after each detection.


Andyf


Top
 Profile  
 
 Post subject: Re: Printer_lib v1.10 and the `&` sign
PostPosted: Wed Apr 11, 2012 6:59 am 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1069
Location: Germany
you could also try with #DT_NOPREFIX :wink:

Code:
Print_DrawText(20,250,100,100,"A&bc&&d",#DT_NOPREFIX)

_________________
http://www.PureBasicPower.de


Top
 Profile  
 
 Post subject: Re: Printer_lib v1.10 and the `&` sign
PostPosted: Fri Apr 13, 2012 10:55 am 
Offline
New User
New User

Joined: Tue Apr 10, 2012 8:23 pm
Posts: 3
ABBKlaus wrote:
you could also try with #DT_NOPREFIX :wink:

Code:
Print_DrawText(20,250,100,100,"A&bc&&d",#DT_NOPREFIX)


That works great, thanks for your help.

Andyf


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye