Creating file with tab delimiters

Hi all, I’m trying to create an export file with tab delimters. Not a regular Dataport. I know how that works. But I need to create a report to exports my file. How can I add this tab character between my fields? Is there a system function? I couldn’t find it. Thanks. Roelof.

Hi Roelof, no, there is no system function to include a tab delimiter in an export file, but you could simply use a variable of type char and asign the value the tab ascii code to that variable. If I do remember well, it should be 32, but I am not really sure. Saludos Nils

quote:


If I do remember well, it should be 32, but I am not really sure.


I’m pretty sure it’s 9 - 32 is definitely space.

Yeah it is 9. and 32 is correctly a space. Its kinda weird that in some languages you can use pre-defined variables for these like… Delphi = VK_TAB Perl Dimensions = PD_TAB It would be really cool if developers of development software stopped making us remember these silly codes from the days of ANSI Scott

quote:


It would be really cool if developers of development software stopped making us remember these silly codes from the days of ANS


I completely agree with you, Scott, I wouldn’t have mixed up the codes in that case. [:D] Saludos Nils

Hi Nils, You quote: “but you could simply use a variable of type char and asign the value the tab ascii code to that variable.” How do I do that? (maybe an example). Thanks, Roelof.

Never mind Nils, I figured it out [:)] Thanks!

ok, that’s good to hear, and you must have been really fast figuring it out… not even 3 minutes between your posts [;)] Saludos Nils

LMAO Nils :slight_smile:

You can define two variables of type Char varTab := 9; varSpace := 32; txtTab := format(varTab); txtSpace := format(varSpace); And then in your writing to the file: File.Write(Field1 + txtTab + field2 + txtTab + Field3 …); Good luck, Steen

AC/DC… file.WRITE: If f.TEXTMODE is set to TRUE and Value is an integer, the system formats the integer into text and writes the result, followed by a new line character. If Value is a record, the system separates each field with a tab character. If f.TEXTMODE is FALSE and Value is an integer, the system writes the integer as an integer which is four bytes long.