Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help tab delimitered files

0 views
Skip to first unread message

Allan Rasmussen

unread,
Mar 11, 2001, 4:57:56 PM3/11/01
to
HI somebody please help

I have a problem with a tab delimitered file.

I have created a file this way
temp := a String var + #9 + a string var + #9 + a string var and so on
Writeln(File, temp)

readln(File,lineIn);
the problem occours when I try the x := pos ('#9', lineIn) it allways
returns x = 0 even thoug the the first characters gives a string.

how can i count the numbers of tabs in each line??

Course I ned to know the numbers.


TIA
Allan


Bruce Roberts

unread,
Mar 11, 2001, 9:17:56 PM3/11/01
to

"Allan Rasmussen" <a...@get2net.dk> wrote in message
news:3AABF4E4...@get2net.dk...

> HI somebody please help
>
> I have a problem with a tab delimitered file.
>
> I have created a file this way
> temp := a String var + #9 + a string var + #9 + a string var and so on
> Writeln(File, temp)
>
> readln(File,lineIn);
> the problem occours when I try the x := pos ('#9', lineIn) it allways
> returns x = 0 even thoug the the first characters gives a string.
>
> how can i count the numbers of tabs in each line??
>

function CountTabChars (const s : string) : integer;

var i : integer;

begin
result := 0;
for i := 1 to Length (s) do
begin
if s [i] = #9
then inc (result);
end;
end;

Joe Booth

unread,
Mar 11, 2001, 9:47:08 PM3/11/01
to

Allan Rasmussen <a...@get2net.dk> wrote in message
news:3AABF4E4...@get2net.dk...
> HI somebody please help
>
> I have a problem with a tab delimitered file.
>
> I have created a file this way
> temp := a String var + #9 + a string var + #9 + a string var and so on
> Writeln(File, temp)
>
> readln(File,lineIn);
> the problem occours when I try the x := pos ('#9', lineIn) it allways
> returns x = 0 even thoug the the first characters gives a string.

Are you using x := pos('#9',lineIn) or x := pos(#9,lineIn)? The second
syntax
should work while the first will not...

0 new messages