1. Gastón Clara
  2. PowerBuilder
  3. Monday, 16 December 2024 17:57 PM UTC

Hi,

In our company, we are using a translation DLL in order to get values for different languages. Our latest client is from Finland, so we need to translate the system to finish. 

From the DLL we get a converted string like this "Olet valinnut MRI-haun, mutta et ole määrittänyt hakuehtoja.~n~rVoit etsiä koko tietokannasta..." into a variable, then we assign this variable to the Text property of a multilineedit object. It seems that the control is not able to recognize the "~n~r" in order to add a new line when renderizing. We would like to have the message splited into two different lines.

It's strange, if I direclty assing a string with  "~n~r" then it is correctly shown on the screen.

Is there something I can do to correctly display string recovered from the DLL (or database)?

 

Thanks.

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 16 December 2024 20:19 PM UTC
  2. PowerBuilder
  3. # 1

Hi Gaston;

  Try "~r~r" instead.  HTH

Regards ... Chris 

Comment
  1. Gastón Clara
  2. Tuesday, 17 December 2024 09:01 AM UTC
Nothing Chris, still the same error. But now the string looks like this:



"Olet valinnut MRI-haun, mutta et ole määrittänyt hakuehtoja.~r~rVoit etsiä koko tietokannasta, mutta tämän hakeminen voi kestää useita minuutteja. Voit nopeuttaa hakua merkittävästi antamalla osittaisen sukunimen, sukupuolen, yksikön numeron tai osittaisen sukunimen ja syntymäajan.~r~rHaluatko antaa lisätietoja?"



  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Monday, 16 December 2024 20:26 PM UTC
  2. PowerBuilder
  3. # 2

Hi, Gastón -

Have you verified that the DLL is returning a Carriage-Return/New-Line (~r~n) sequence, not simply a New-Line character?

What encoding is used for the string that is returned from the DLL? PB uses Unicode 16LE encoding internally.

Best regards, John

Comment
There are no comments made yet.
Gastón Clara Accepted Answer Pending Moderation
  1. Tuesday, 17 December 2024 09:40 AM UTC
  2. PowerBuilder
  3. # 3

I finally get to a workaround. I just pre-process the string before assign it to the MLE.

 

ls_string = Replace(inv_errorattrib.is_text, pos(inv_errorattrib.is_text, "~~r~~n"), 4, CHAR(13)+CHAR(10))
ls_string = Replace(inv_errorattrib.is_text, pos(inv_errorattrib.is_text, "~~t"), 3, CHAR(9))

That code make the trick.

 

Thanks.

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 17 December 2024 13:32 PM UTC
Hi Gastón;

Thanks for providing the solution. I've never seen this requirement before with the double tildes but I wonder if it's because of the language / translation features in effect.

Glad that you found a solution!

Regards ... Chris
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.