D - File identifier error
- "Andrew Edwards" <crxace13 comcast.net> Sep 11 2002
- Patrick Down <pat codemoon.com> Sep 11 2002
- Pavel Minayev <evilone omen.ru> Sep 11 2002
- "Andrew Edwards" <crxace13 comcast.net> Sep 12 2002
the following error:
test.d(5): identifier 'File' is not defined
was generated when I trued to compile the following code:
import string;
import file;
int main (char[][] args)
{
File file = new File;
file.create('test.dat');
int a = 0, b = 1;
for (int i = 0; i < 1000; i++)
{
int c = a + b;
file.write(c);
a = b; b = c;
}
return 0;
}
how would I go about addressing this problem?
Sep 11 2002
"Andrew Edwards" <crxace13 comcast.net> wrote in news:aloj8o$1qjj$1 digitaldaemon.com:the following error: test.d(5): identifier 'File' is not defined was generated when I trued to compile the following code: import string; import file; int main (char[][] args) { File file = new File; file.create('test.dat'); int a = 0, b = 1; for (int i = 0; i < 1000; i++) { int c = a + b; file.write(c); a = b; b = c; } return 0; }
Don't have variable names the same as imports.
Sep 11 2002
Andrew Edwards wrote:the following error: test.d(5): identifier 'File' is not defined was generated when I trued to compile the following code: import string; import file;
class File is defined in stream.d, not in file.d
Sep 11 2002
Thanks Pavel, I imported the wrong file. String vs Stream. BTW the problem with the unittest in stream.d is that the string "Testing stream.d:" contains 17 characters, not 18. "Pavel Minayev" <evilone omen.ru> wrote in message news:alp2aq$29um$1 digitaldaemon.com... | Andrew Edwards wrote: | > the following error: | > test.d(5): identifier 'File' is not defined | > was generated when I trued to compile the following code: | > | > import string; | > import file; | | class File is defined in stream.d, not in file.d |
Sep 12 2002









Patrick Down <pat codemoon.com> 