How to append a new line to a File/FileConduit?

2009-01-12 Thread Sam Hu
Hello everyone! Just found I can not append a new line to a file when writing data to a File or FileConduit instance. File file=new File("myfile.txt"); myfile.append("This is line 1"); myfile.append("This is line 2"); About code just generate "This is line 1This is line 2" I tried below code but

Re: using a typedefed variable with library classes

2009-01-12 Thread Sergey Gromov
Tue, 13 Jan 2009 05:59:58 +0900, Bill Baxter wrote: > On Tue, Jan 13, 2009 at 1:48 AM, Sergey Gromov wrote: > >> However, with a typedef, LocalType is a distinct type. Yes it casts to >> int implicitly, but likewise it casts implicitly to char, short and >> long. So compiler gets a whole load

Re: Foreach problem

2009-01-12 Thread Bill Baxter
On Tue, Jan 13, 2009 at 6:25 AM, Steven Schveighoffer wrote: > because that's basically what a foreach does when using opApply: create an > inner function and then pass a delegate pointing to that function to > opApply. > > I think the difference between the two is that the compiler handles forea

Re: Foreach problem

2009-01-12 Thread Steven Schveighoffer
"Denis Koroskin" wrote > On Sun, 11 Jan 2009 06:04:01 +0300, Tim M wrote: > >> On Sun, 11 Jan 2009 15:59:26 +1300, Tim M wrote: >> >>> On Sun, 11 Jan 2009 15:50:54 +1300, Daniel Keep >>> wrote: >>> Tim M wrote: > Why is this an error. Dmd wants to make sure that I declare a

Re: using a typedefed variable with library classes

2009-01-12 Thread Bill Baxter
On Tue, Jan 13, 2009 at 1:48 AM, Sergey Gromov wrote: > However, with a typedef, LocalType is a distinct type. Yes it casts to > int implicitly, but likewise it casts implicitly to char, short and > long. So compiler gets a whole load of File.write() functions matching > with conversions, and f

Re: array questions

2009-01-12 Thread yes
thank you I think I understand how it works

Re: using a typedefed variable with library classes

2009-01-12 Thread Sergey Gromov
Sun, 11 Jan 2009 18:09:15 -0800, Charles Hixson wrote: > Well, my use case just involves being able to use library function with > the proper base type. (I.e., int instead of long or byte when I do > typedef int LocalType; > LocalType t; > File f; > f.write(t); > > I'll grant that I *can* use a