FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour PADR and LEN
Posts: 22
Joined: Wed Nov 09, 2005 09:43 AM
PADR and LEN
Posted: Fri Feb 10, 2006 09:55 AM

In my program I have a comments field, which, if empty, will save the filename used and place .rpt extension onto the filename. However, although the majority of these work, a few of them will show the filename with a large gap before the .rpt extension. how can I solve this?

EXAMPLE ;

[Monthly Account Invoice Proof .rpt]

The above should be displayed as

[Monthly Account Invoice Proof.rpt]

Here is the code used;

IF !Empty(cApp)
IF mFile == 1
mReportID := Alltrim(cApp)+".rpt"
mReportName := PADR(cApp,LEN(REPDETS->REP_NAME))
mRepComm := ("["+PADR(cApp,len(REPDETS->REP_NAME))+".rpt]")
RepIdValid()

Posts: 22
Joined: Wed Nov 09, 2005 09:43 AM
PADR and LEN
Posted: Fri Feb 10, 2006 11:25 AM

I tried using Alltrim instead of PADR on the
mRepComm := ("["+PADR(cApp,len(REPDETS->REP_NAME))+".rpt]") line, which seemed to fix a few of the records. although some still had a large gasp before the .rpt extension, with some records not even showing .rpt extension. am I doing something wrong or could this be a bug?

Many Thanks

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
PADR and LEN
Posted: Fri Feb 10, 2006 07:05 PM

I don't understand why you are using PADR(). This will put trailing spaces onto your filename, which is what you don't want. Use rtrim() instead.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion