Author Topic: Question How do I write a null char (ASCII 0) to a file?  (Read 147 times)

0 Members and 1 Guest are viewing this topic.

Offline rpmolecule

  • Full Member
  • *
  • Posts: 229
  • Karma: +1/-0
  • Seize the Day!
    • View Profile
Question How do I write a null char (ASCII 0) to a file?
« on: December 16, 2008, 07:49:13 AM »
I need to use ASCII character 0 as a spacer in a file becuase of the program that uses the file. I tried to use this code:

public subroutine f_writeFixedNumericField (integer outputfilehandle, String text, integer length);
      int i,z
      if Len( text ) > length then
            FileWrite( outputfilehandle, Left( text, length ) )
            FileWrite( outputfilehandle, text )
            z = length - Len( text )
            for i = 1 to z step 1
                  FileWrite( outputfilehandle, ToANSI( String( Char(0) ) ) )
      end if
end subroutine

but to no avail. It seems to treat the Char(0) as undecipherable text and ignore it. Unfortunately, the program that will use the file insist on seeing the char(0) since it expects and ISAM format. I worte a program in java that will do it but I want to use power builder if possible becuase of the better GUI.

Techronnati | where technology never sleeps

Question How do I write a null char (ASCII 0) to a file?
« on: December 16, 2008, 07:49:13 AM »

Mountain View


Related Topics

  Subject / Started by Replies Last post
0 Replies
Last post August 28, 2008, 05:26:03 AM
by rpmolecule
1 Replies
Last post November 04, 2008, 12:05:28 AM
by Transformer10
0 Replies
Last post November 27, 2008, 02:03:28 AM
by MrSpecialist
0 Replies
Last post December 16, 2008, 07:15:57 AM
by rpmolecule
1 Replies
Last post November 29, 2015, 10:26:21 AM
by rpmolecule

Posting Disclaimer: Any individual may post a message in this forum and may do so anonymously. Therefore, the sole author is exclusively and entirely responsible for all opinions in that message. They do not represent the official opinions of Techronnati, its administrators or moderators or the Techronnati Management. Techronnati is merely acting as an impartial conduit for constitutionally protected free speech and is not responsible and will not be held liable for the content of such messages. All images and service logos are trademarks of their respective owners.