Removal of a blank line at the end of a text file

jamese

New Member
Hello,

I've got a procedure that outputs data to a text file, this works fine, the file can be opened where it is and there isn't a blank line at the end. However the file automatically gets attached to an email, when the file is opened once it's received by email it has a blank line at the end of it.. Has anyone had this before or know of a solution please?

cheers.
 

kartikvbn

New Member
Please modify according your need.
this code return last char

/*******************/
DEFINE VARIABLE cLine AS CHARACTER NO-UNDO.
DEFINE VARIABLE mLine AS MEMPTR NO-UNDO.
DEFINE VARIABLE cFile AS CHARACTER NO-UNDO.
ASSIGN cFile = "d:\kartikeya\read.txt" .
INPUT FROM VALUE(cFile) BINARY.
SEEK INPUT TO END .
SEEK INPUT TO (SEEK(INPUT) - 1).
SET-SIZE(mLine) = 0.
SET-SIZE(mLine) = 1.
IMPORT UNFORMATTED mLine .
INPUT CLOSE .
MESSAGE "LAST CHAR = " KEYLABEL(GET-BYTE(mLine,1)) SKIP
KEYCODE(KEYLABEL(GET-BYTE(mLine,1)))
VIEW-AS ALERT-BOX INFO BUTTONS OK.
SET-SIZE(mLine) = 0.
 
Top