Re: [fpc-pascal]opening files from a text list

2003-12-22 Thread Anton Tichawa
Hello! On Monday 22 December 2003 19:37, DONALD PEDDER wrote: >When I've read everything up to the score (using scanblack/scanwhite), > and then do "read(line,awayscore)" the program hangs (using read now, as I > want to read the number and not a word). Experimentation showed me it was > waiti

Re: [fpc-pascal]opening files from a text list

2003-12-22 Thread DONALD PEDDER
>When I've read everything up to the score (using scanblack/scanwhite), > and then do "read(line,awayscore)" the program hangs (using read now, as I > want to read the number and not a word). P.S. "awayscore" IS defined as an integer, in case anyone is going to ask me if I've defined it cor

Re: [fpc-pascal]opening files from a text list

2003-12-22 Thread DONALD PEDDER
Firstly, my current challenge, and then some responses to some other comments that were made. > > replace result:= by scanblack:= > >That was the missing piece of the puzzle. Thank you (and to Anton > too)! I've started actually writing my code now (I have a very busy life, so it someti

RE: [fpc-pascal]opening files from a text list

2003-11-29 Thread Alan Mead
Donald, What happens if the "Mighty Ducks" or the "White Sox"--or my favorite, "Eat at Joe's" play? The compiler reads strings just fine but you as the programmer need to understand data types. You also need to understand your problem. Parsing arbitrary and possibly inconsistent psuedo-English

Re: [fpc-pascal]opening files from a text list

2003-11-29 Thread Florian Klaempfl
Marco van de Voort wrote: here is just another approach. I'll have a look at that as well. Why doesn't the compiler have the ability to read a word? All of this extra code needed because I have to read words one character at a time! It would be the single most useful addition. I don't understa

Re: [fpc-pascal]opening files from a text list

2003-11-29 Thread Anton Tichawa
On Saturday 29 November 2003 13:32, you wrote: > > >>here is just another approach. > > > > > >I'll have a look at that as well. Why doesn't the compiler have the > > > ability to read a word? All of this extra code needed because I have to > > > read words one character at a time! It would be

Re: [fpc-pascal]opening files from a text list

2003-11-29 Thread Laurent Cocea
Or you could wrap it around a Perl script. Perl is particularly good at parsing text and generating arrays from strings and vice-versa. And then you can call your Pascal-generated code from within the script using the array elements as arguments, liek this: #!/usr/bin/perl -w my @arguments; my $a

Re: [fpc-pascal]opening files from a text list

2003-11-29 Thread Marco van de Voort
> >>here is just another approach. > > > > > >I'll have a look at that as well. Why doesn't the compiler have the > > ability to read a word? All of this extra code needed because I have to > > read words one character at a time! It would be the single most useful > > addition. I don't unders

Re: [fpc-pascal]opening files from a text list

2003-11-29 Thread Florian Klaempfl
DONALD PEDDER wrote: here is just another approach. I'll have a look at that as well. Why doesn't the compiler have the ability to read a word? All of this extra code needed because I have to read words one character at a time! It would be the single most useful addition. I don't understand wh

RE: [fpc-pascal]opening files from a text list

2003-11-28 Thread DONALD PEDDER
> here is just another approach. I'll have a look at that as well. Why doesn't the compiler have the ability to read a word? All of this extra code needed because I have to read words one character at a time! It would be the single most useful addition. I don't understand why compilers have no

Re: [fpc-pascal]opening files from a text list

2003-11-28 Thread DONALD PEDDER
> replace result:= by scanblack:= That was the missing piece of the puzzle. Thank you (and to Anton too)! dp. ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal

RE: [fpc-pascal]opening files from a text list

2003-11-28 Thread ZINTEL Gerhard
Hello Donald, >If I have a file which contains on the first line... > > 49ers at Giants 16 13 > >I want to open a file called "49ers" and a file called > "Giants" and do > some processing. Although FP handles strings, I believe that > you can still > only read a character at a time, so

Re: [fpc-pascal]opening files from a text list

2003-11-27 Thread Marco van de Voort
> On Fri, 28 Nov 2003, Anton Tichawa wrote: > > > function scanblack(var s: string): string; > > var > > i: integer; > > begin > > i := 1; > > repeat > > if i > length(s) then begin > > break; > > end; > > if s[i] = ' ' then begin > > break; > > end; > > inc(i

Re: [fpc-pascal]opening files from a text list

2003-11-27 Thread DONALD PEDDER
On Fri, 28 Nov 2003, Anton Tichawa wrote: > function scanblack(var s: string): string; > var > i: integer; > begin > i := 1; > repeat > if i > length(s) then begin > break; > end; > if s[i] = ' ' then begin > break; > end; > inc(i); > until false; > result

Re: [fpc-pascal]opening files from a text list

2003-11-27 Thread Anton Tichawa
Hello! >If I have a file which contains on the first line... > > 49ers at Giants 16 13 > >I want to open a file called "49ers" and a file called "Giants" and do > some processing. Although FP handles strings, I believe that you can still > only read a character at a time, so I don't know h