Print New Line
Print New Line
(OP)
Hello experts
in my 4gl file
I need to print some file names
like resi,busi,cyta etc in some .txt file
they need to be displayed in new line
resi
busi
cyta
..etc
can somebody help me to print new lines in 4gl file coding
Thanks
in my 4gl file
I need to print some file names
like resi,busi,cyta etc in some .txt file
they need to be displayed in new line
resi
busi
cyta
..etc
can somebody help me to print new lines in 4gl file coding
Thanks
RE: Print New Line
Hope This Helps, PH.
FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?
RE: Print New Line
CODE
MAIN
START REPORT my_report TO "/tmp/file.txt"
OUTPUT TO REPORT my_report ("resi")
OUTPUT TO REPORT my_report ("busi")
OUTPUT TO REPORT my_report ("cyta")
FINISH REPORT my_report
END MAIN
REPORT my_report (output_line)
DEFINE
output_line CHAR(30)
OUTPUT
PAGE LENGTH 1
TOP MARGIN 0
LEFT MARGIN 0
BOTTOM MARGIN 0
FORMAT
ON EVERY ROW
PRINT COLUMN 1, output_line
END REPORT
Another way is to build a unix command such as echo'ing a string to a file, and using the 4GL RUN command to execute:
CODE
MAIN
DEFINE string CHAR(100)
LET output_file = "/tmp/file.txt"
LET string = "rm -f ", output_file cLIPPED
RUN string
LET string = build_command("resi")
RUN string
LET string = build_command("busi")
RUN string
LET string = build_command("cyta")
RUN string
END MAIN
FUNCTION build_command(file_name)
DEFINE
file_name CHAR(30),
str CHAR(100)
LET str = "echo \"", file_name CLIPPED, "\" >> ", output_file CLIPPED
RETURN str
END FUNCTION