Page Index Toggle Pages: [1] 2  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) Printout problem (Read 4198 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Printout problem
Nov 1st, 2007 at 2:19pm
Print Post Print Post  
My Workorders and Invoices use the @ symbol in text strings for noting price rates, for example: "1 Rigger, 3 hours @ $64.00 per hour, Uncrating"

However, on my printouts, everything after the @ symbol is not being printed.  Have I done something wrong with my PrintString command or is there special programming I need to put in place to make this work?
  

**
Captain Infinity
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: Printout problem
Reply #1 - Nov 1st, 2007 at 2:55pm
Print Post Print Post  
You have to use @Replace() to replace a single @ with @@.

-Ray
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #2 - Nov 1st, 2007 at 3:04pm
Print Post Print Post  
OK, thanks.  Where should this be done, when the string is first generated or just before it is printed?  If the former, I can easily do it in my programming when the different elements are put together to form the string (though I'd rather not have "@@" appear on the display, because I'm sure my users will be confused by it).  If the latter I'm afraid I'll need some further advice and hand-holding as it will be a wholesale overhaul of my print routine.  Which I don't mind, but I will need help.
  

**
Captain Infinity
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: Printout problem
Reply #3 - Nov 1st, 2007 at 3:18pm
Print Post Print Post  
You could do either of those but I would recommend the later, and don't worry I'm here if you need a hand.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printout problem
Reply #4 - Nov 1st, 2007 at 3:25pm
Print Post Print Post  
Another recommendation: Write a function for this. That way, if you need to add or adjust what special characters need attention, you can do so in one place and all your PrintString code will fall into line automatically.

Code
Select All
FUNCTION CleanPrintData(vIn as String) as String
var vRet as String

    vRet = vIn
    vRet = @Replace(vRet, "@", "@@")
    // Do any other stuff you need to do
    Return vRet

END FUNCTION

PrintString(CleanPrintData(PriceRate1), 100, 200, 0, "BArial", 33, 0)
PrintString(CleanPrintData(PriceRate2), 100, 250, 0, "BArial", 33, 0)
PrintString(CleanPrintData(PriceRate3), 100, 300, 0, "BArial", 33, 0)
 

  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #5 - Nov 1st, 2007 at 3:41pm
Print Post Print Post  
Are there any other characters I'll need to replace?
  

**
Captain Infinity
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: Printout problem
Reply #6 - Nov 1st, 2007 at 4:25pm
Print Post Print Post  
Not that I know of.

-Ray
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #7 - Nov 1st, 2007 at 7:09pm
Print Post Print Post  
Can @Replace be used within the Printstring command, to alter the value of the element being printed?  That is, can
Code
Select All
Printstring(Laborer_1, 335, vPosY + 375, 0, vFont, vSize, 0) 


become
Code
Select All
Printstring(@Replace(Laborer_1, "@", "@@), 335, vPosY + 375, 0, vFont, vSize, 0) 


?
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printout problem
Reply #8 - Nov 1st, 2007 at 7:46pm
Print Post Print Post  
Infinity wrote on Nov 1st, 2007 at 7:09pm:
Can @Replace be used within the Printstring command, to alter the value of the element being printed?

Yes, but the way I showed you will make your life much easier in the long run than embedding this in each of your PrintString calls. Up to you though.  Smiley
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #9 - Nov 1st, 2007 at 7:54pm
Print Post Print Post  
Sorry Erika, I didn't see your earlier reply.  Thanks, I'll give it a try.
  

**
Captain Infinity
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #10 - Nov 1st, 2007 at 8:34pm
Print Post Print Post  
I'm having partial success, and am very confused by what I am seeing.

Here is one of my current print routines:

Code
Select All
Var vWillItFit as Int
Var vTextToPrint as String
Var vMaxWidth as Int
Var vLen as Int
Var vWidth as Int

// Prints the Pickup Company name
vWillItFit = 0
vTextToPrint = CleanPrintData(Pickup_Company)
vLen = @Len(vTextToPrint)
vMaxWidth = 300 //This is the Max printed width
While((vWillItFit = 0) And (vLen > 0))
{
	Printstring(vTextToPrint, 0, 0, 0, vFont, vSize, 1)
	If @PageExtentX() <= vMaxWidth Then
	{
		vWillItFit = 1
	}
	Else
	{
		vLen = vLen - 1
		vTextToPrint = @Left(vTextToPrint, vLen)
	}
}
Printstring(vTextToPrint, 160, vPosY + 255, 0, vFont, vSize, 0) 



When the value stored in Pickup_Company is "Company @ Name", the printout is "Company".

When the value stored in Pickup_Company is "@ Name", the printout is "@ Name".

???
  

**
Captain Infinity
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: Printout problem
Reply #11 - Nov 1st, 2007 at 9:30pm
Print Post Print Post  
Hello Scott,

I see what you are seeing here. I think it has to do with a problem in an underlying library and the @ symbol. I'll pass it on to development.

In the meantime what you can do is change that function Erika gave you to

Code
Select All
FUNCTION CleanPrintData(vIn as String) as String
var vRet as String

    vRet = vIn
    vRet = @Replace(vRet, " @ ", " at ")
    // Do any other stuff you need to do
    Return vRet

END FUNCTION 



-Ray
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #12 - Nov 1st, 2007 at 10:19pm
Print Post Print Post  
Thanks Ray.  Whew, am I relieved!  I hate to hear that there's a bug in the program but I gotta tellya, this was driving me absolutely nuts this afternoon.
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printout problem
Reply #13 - Nov 2nd, 2007 at 1:06am
Print Post Print Post  
Infinity wrote on Nov 1st, 2007 at 10:19pm:
Thanks Ray.  Whew, am I relieved!  I hate to hear that there's a bug in the program but I gotta tellya, this was driving me absolutely nuts this afternoon.

This one isn't even our program. It's one of the base libraries. Makes it extra fun to find.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #14 - Nov 2nd, 2007 at 10:27am
Print Post Print Post  
Quote:
This one isn't even our program. It's one of the base libraries. Makes it extra fun to find.

I don't envy you that.  Make it fun; make it a contest.

While you're digging in there, is it possible to redesign PrintString() so that it can handle @ symbols without jumping through hoops (to coin a phrase)?  Seems like just about everybody will need to print the symbol at some point, what with email addresses being so ubiquitous.
  

**
Captain Infinity
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send Topic Send Topic Print Print