Different TEXT INTO results under different compilers

Different TEXT INTO results under different compilers

Postby hua » Thu Jan 12, 2023 3:41 am

Hi guys,
I have a rtf string in my code enclosed within TEXT INTO .. ENDTEXT.
It is displayed correctly when I compiled under xHarbour
When I recompiled using Harbour+FWH1912 (my latest FWH), the rtf text doesn't appear.
When I compared the ppo generated by the compilers the implementation of TEXT INTO is drastically different
How to fix this?

TIA

.ppo of xHarbour+FWH11.8
Code: Select all  Expand view

cGet := "" ; hb_setwith( {|_1| cGet += _1 } );
__TextInto( "{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang17417{\fonttbl{\f0\fnil\fcharset0 Calibri;}{\f1\fnil\fcharset2 Symbol;}}" )
__TextInto( "{\colortbl ;\red0\green0\blue255;}" )
__TextInto( "{\*\generator Riched20 10.0.18362}\viewkind4\uc1" )
__TextInto( "\pard\sa200\sl276\slmult1\b\f0\fs32\lang9 Definition Of Wages\b0\fs22\par" )
__TextInto( "" )
__TextInto( "\pard\sl240\slmult1\b\fs24 Payments considered as wages\b0\fs22\par" )
__TextInto( "" )
__TextInto( "\pard\sa200\sl276\slmult1 Any  remuneration payable in money to an employee is taken as wages for purposes of SOCSO contributions. This includes the following payments:\par" )
__TextInto( "" )
__TextInto( "\pard{\pntext\f1'B7\tab}{\*\pn\pnlvlblt\pnf1\pnindent0{\pntxtb'B7}}\fi-360\li720\sl240\slmult1 Salary\par" )
__TextInto( "{\pntext\f1'B7\tab}Overtime payments\par" )
__TextInto( "{\pntext\f1'B7\tab}Commission and service charge\par" )
__TextInto( "{\pntext\f1'B7\tab}Payments for leave; such as annual, sick, maternity, rest day, public holidays and etc\par" )
__TextInto( "{\pntext\f1'B7\tab}Allowances such as incentives, shift, food / meal, cost of living, housing and etc\par" )
__TextInto( "" )
__TextInto( "\pard\sa200\sl276\slmult1\par" )
__TextInto( "" )
__TextInto( "\pard\sl240\slmult1\b\fs24 Payments NOT considered as wages\b0\fs22\par" )
__TextInto( "" )
__TextInto( "\pard{\pntext\f1'B7\tab}{\*\pn\pnlvlblt\pnf1\pnindent0{\pntxtb'B7}}\fi-360\li720\sl240\slmult1 Payments by an employer to any statutory fund for employees\par" )
__TextInto( "{\pntext\f1'B7\tab}Mileage claims\par" )
__TextInto( "{\pntext\f1'B7\tab}Gratuity payments or payments for dismissal or retrenchments\par" )
__TextInto( "{\pntext\f1'B7\tab}Annual bonus\par" )
__TextInto( "" )
__TextInto( "\pard\sl240\slmult1\par" )
__TextInto( "" )
__TextInto( "\pard\sa200\sl276\slmult1\b Note:\b0  For further clarification on definition of wages, kindly contact  SOCSO offices or Customer Service Careline\par" )
__TextInto( "\par" )
__TextInto( "" )
__TextInto( "\pard\sl240\slmult1\b Source (see \i Definition of Wages\i0  section):\par" )
__TextInto( "\b0  {{\field{\*\fldinst{HYPERLINK https://www.perkeso.gov.my/index.php/en ... ligibility }}{\fldrslt{https://www.perkeso.gov.my/index.php/en/24-social-security-protection/employer-and-employee-eligibility\ul0\cf0}}}}\f0\fs22\par" )
__TextInto( "}" )
hb_SetWith( )
 


Rtf string produced
Code: Select all  Expand view
{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang17417{\fonttbl{\f0\fnil\fcharset0 Calibri;}{\f1\fnil\fcharset2 Symbol;}}{\colortbl ;\red0\green0\blue255;}{\*\generator Riched20 10.0.18362}\viewkind4\uc1\pard\sa200\sl276\slmult1\b\f0\fs32\lang9 Definition Of Wages\b0\fs22\par\pard\sl240\slmult1\b\fs24 Payments considered as wages\b0\fs22\par\pard\sa200\sl276\slmult1 Any  remuneration payable in money to an employee is taken as wages for purposes of SOCSO contributions. This includes the following payments:\par\pard{\pntext\f1\'B7\tab}{\*\pn\pnlvlblt\pnf1\pnindent0{\pntxtb'B7}}\fi-360\li720\sl240\slmult1 Salary\par{\pntext\f1'B7\tab}Overtime payments\par{\pntext\f1'B7\tab}Commission and service charge\par{\pntext\f1'B7\tab}Payments for leave; such as annual, sick, maternity, rest day, public holidays and etc\par{\pntext\f1'B7\tab}Allowances such as incentives, shift, food / meal, cost of living, housing and etc\par\pard\sa200\sl276\slmult1\par\pard\sl240\slmult1\b\fs24 Payments NOT considered as wages\b0\fs22\par\pard{\pntext\f1'B7\tab}{\*\pn\pnlvlblt\pnf1\pnindent0{\pntxtb'B7}}\fi-360\li720\sl240\slmult1 Payments by an employer to any statutory fund for employees\par{\pntext\f1'B7\tab}Mileage claims\par{\pntext\f1'B7\tab}Gratuity payments or payments for dismissal or retrenchments\par{\pntext\f1'B7\tab}Annual bonus\par\pard\sl240\slmult1\par\pard\sa200\sl276\slmult1\b Note:\b0  For further clarification on definition of wages, kindly contact  SOCSO offices or Customer Service Careline\par\par\pard\sl240\slmult1\b Source (see \i Definition of Wages\i0  section):\par\b0  {{\field{\*\fldinst{HYPERLINK https://www.perkeso.gov.my/index.php/en ... ligibility }}{\fldrslt{https://www.perkeso.gov.my/index.php/en/24-social-security-protection/employer-and-employee-eligibility\ul0\cf0}}}}\f0\fs22\par}




.ppo of Harbour+FWH1912
Code: Select all  Expand view

cGet:=e"{\rtf1\ansi\ansicpg1252deff0\nouicompatdeflang17417{\fonttbl{\f0\fnil\fcharset0 Calibri;}{\f1\fnil\fcharset2 Symbol;}}\n{colortbl ;\red0green0\blue255;}\n{*generator Riched20 10.0.18362}\viewkind4uc1\npardsa200sl276slmult1\b\f0\fs32lang9 Definition Of Wages\b0\fs22par\n\npardsl240slmult1\b\fs24 Payments considered as wages\b0\fs22par\n\npardsa200sl276slmult1 Any  remuneration payable in money to an employee is taken as wages for purposes of SOCSO contributions. This includes the following payments:par\n\npard{pntext\f1'B7\tab}{*pnpnlvlbltpnf1pnindent0{pntxtb'B7}}\fi-360li720sl240slmult1 Salarypar\n{pntext\f1'B7\tab}Overtime paymentspar\n{pntext\f1'B7\tab}Commission and service chargepar\n{pntext\f1'B7\tab}Payments for leave; such as annual, sick, maternity, rest day, public holidays and etcpar\n{pntext\f1'B7\tab}Allowances such as incentives, shift, food / meal, cost of living, housing and etcpar\n\npardsa200sl276slmult1par\n\npardsl240slmult1\b\fs24 Payments NOT considered as wages\b0\fs22par\n\npard{pntext\f1'B7\tab}{*pnpnlvlbltpnf1pnindent0{pntxtb'B7}}\fi-360li720sl240slmult1 Payments by an employer to any statutory fund for employeespar\n{pntext\f1'B7\tab}Mileage claimspar\n{pntext\f1'B7\tab}Gratuity payments or payments for dismissal or retrenchmentspar\n{pntext\f1'B7\tab}Annual bonuspar\n\npardsl240slmult1par\n\npardsa200sl276slmult1\b Note:\b0  For further clarification on definition of wages, kindly contact  SOCSO offices or Customer Service Carelinepar\npar\n\npardsl240slmult1\b Source (see i Definition of Wagesi0  section):par\n\b0  {{\field{*\fldinst{HYPERLINK https://www.perkeso.gov.my/index.php/en ... ligibility }}{\fldrslt{https://www.perkeso.gov.my/index.php/en/24-social-security-protection/employer-and-employee-eligibilityul0cf0}}}}\f0\fs22par\n}\n"
 


Rtf string produced
Code: Select all  Expand view
{
tf1nsinsicpg1252deff0
ouicompatdeflang17417{ onttbl{ 0 nil charset0 Calibri;}{ 1 nil charset2 Symbol;}}
{colortbl ;
ed0green0lue255;}
{*generator Riched20 10.0.18362} iewkind4uc1
pardsa200sl276slmult1 0 s32lang9 Definition Of Wages0 s22par

pardsl240slmult1 s24 Payments considered as wages0 s22par

pardsa200sl276slmult1 Any  remuneration payable in money to an employee is taken as wages for purposes of SOCSO contributions. This includes the following payments:par

pard{pntext 1'B7    ab}{*pnpnlvlbltpnf1pnindent0{pntxtb'B7}} i-360li720sl240slmult1 Salarypar
{pntext 1'B7    ab}Overtime paymentspar
{pntext 1'
B7    ab}Commission and service chargepar
{pntext 1'B7    ab}Payments for leave; such as annual, sick, maternity, rest day, public holidays and etcpar
{pntext 1'
B7    ab}Allowances such as incentives, shift, food / meal, cost of living, housing and etcpar

pardsa200sl276slmult1par

pardsl240slmult1 s24 Payments NOT considered as wages0 s22par

pard{pntext 1'B7    ab}{*pnpnlvlbltpnf1pnindent0{pntxtb'B7}} i-360li720sl240slmult1 Payments by an employer to any statutory fund for employeespar
{pntext 1'B7    ab}Mileage claimspar
{pntext 1'
B7    ab}Gratuity payments or payments for dismissal or retrenchmentspar
{pntext 1'B7    ab}Annual bonuspar

pardsl240slmult1par

pardsa200sl276slmult1 Note:0  For further clarification on definition of wages, kindly contact  SOCSO offices or Customer Service Carelinepar
par

pardsl240slmult1 Source (see i Definition of Wagesi0  section):par
0  {{ ield{* ldinst{HYPERLINK https://www.perkeso.gov.my/index.php/en ... ligibility }}{ ldrslt{https://www.perkeso.gov.my/index.php/en/24-social-security-protection/employer-and-employee-eligibilityul0cf0}}}} 0 s22par
}
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Different TEXT INTO results under different compilers

Postby hua » Thu Jan 12, 2023 5:13 am

For now resolved by placing this line that I took from hbcompat.ch into the PRG that has TEXT INTO
I don't like this solution though.

Code: Select all  Expand view
  #xcommand TEXT INTO <v> => #pragma __text|<v>+=%s+hb_eol();<v>:=""
 
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Different TEXT INTO results under different compilers

Postby hua » Thu Jan 12, 2023 5:26 am

I end up editing fivewin.ch so the change to TEXT INTO is global.
I inserted the line #include "xhb.ch".
I did not test whether TEXT INTO .. ADDITIVE works or not though.

Code: Select all  Expand view

#ifndef __XHARBOUR__
   #xcommand TEXT INTO <v> => #pragma __cstream|<v>:=%s
   #xcommand TEXT INTO <v> ADDITIVE => #pragma __cstream|<v>+=%s
   #include "c:\harbour\contrib\xhb\xhb.ch"
#endif

 
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Different TEXT INTO results under different compilers

Postby Antonio Linares » Fri Jan 13, 2023 5:47 am

Dear Hua,

Many thanks for sharing it :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 107 guests