Is the %s formatting operator limited to string(255) when used in conjunction with "execute in 4d"?

Neither the % operator nor "execute in 4d" are inherently limited to 255 characters.


$vt_Content is about a 2000 character text field (typed). It is an inline text file to be processed by PDF Plugin. Dumping locals shows $cmd correctly formated. Since it uses <> as parsing characters, I can only assume that it is being truncated because the same $vt_Content works fine in a 4D method.

I'm not sure what you mean by "it uses <> as parsing characters".

Sorry, was not very clear on that. It uses HTML like tags, but only opening. Below is an example of the inline text. The macro area is like css styles and the rest layout. That layout is flowed into a defined box area. Really pretty neat stuff - precision layout . As someone pointed out, I think Oliver, the 4D execute command is limited to a single line of text. I think only "<macro{ " was interpreted by 4d and the PDF Plugin parser balked at no closing ">" tag. So I have write a few wrapper to take care of multi-line text.

You don't need a wrapper, all you have to do is convert CR to char (13), like this:

$vt_Content := trim($vt_Content)
$vt_Content := replace string($vt_Content; "\r"; "\"+char(13)+\"")
$cmd := 'PDF Create Text Flow(%d;"%s")' % ($vl_PDFRef; $vt_Content)

In other words, you convert embedded CR into "+char(13)+" so that the execute won't see line endings and barf. You need to trim $vt_Content to make sure you don't end up with orphaned string parts.

Regards,

   Aparajita
   www.aparajitaworld.com

   "If you dare to fail, you are bound to succeed."
   - Sri Chinmoy   |   www.srichinmoylibrary.com


_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to