Normal Topic Concatenate two strings while using PrintString() (Read 441 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Concatenate two strings while using PrintString()
May 22nd, 2008 at 9:43pm
Print Post Print Post  
While Concatenating two strings using PrintString ( ) command, 2nd string is treated as the column eventhough Width in the column specification is 0.  This is obvious when the second string is quite long so as it is required to be wrapped.

var vString1 as String = "This is test String1."
var vString2 as String = "This is testString2. Let us see how does this concatenate with printString command. The second string is treated as the last column from the starting postion."

NewPage (850, 1100)
PrintPageMargin (36, 36, 36, 36)
AlternateDefaultPrinter ("Adobe PDF")
Printstring (vString1, 0, 0, 0, " Arial", 17, 0)
PrintString (vString2, -1, -1, 0, " Arial", 17, 0)

FinishPage ( )

Expected:
This is test String1.This is testString2. Let us see how does this concatenate with printString command.   The second string is treated as the last column from the starting postion.

Instead of above, I am getting 2nd string as the last column starting from the end of first string.

Is this Aberrant behavior? I understand, I can always concatenate them before using it in the printstring () command in order to get it right. 

Printstring (vString1+ " " + String2, 0, 0, 0, " Arial", 17, 0)


  
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: Concatenate two strings while using PrintStrin
Reply #1 - May 23rd, 2008 at 1:50pm
Print Post Print Post  
Hello Bharat,

If you want the data to be treated as one continuous chunk of data, you will need to concatenate before calling PrintString.

PrintString does not concatenate data that is printed next to each other. Each piece of data that is printed with PrintString is treated as it's own chunk of data.

-Ray
  

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