Consultor Eletrônico



Kbase P58254: How to write the NULL character - CHR(0) to a file ?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Unverified

GOAL:

How to write the NULL character - CHR(0) to a file ?

FACT(s) (Environment):

Progress 9.x

FIX:


You can use the NULL keyword to output null characters (\0)
with PUT CONTROL.

DEFINE STREAM s1.
OUTPUT STREAM s1 TO cus.dat.

PUT STREAM s1 CONTROL NULL.

To write multiple NULLs :
PUT CONTROL NULL(n).
where n = number of nulls to be written.

To embed NULLs in between data :

PUT "This is to test".
PUT CONTROL NULL.
PUT "the null character" .


The output will be : "This is to test the null character."