Re: why the array bounds array

2008-12-08 Thread Sergey Gromov
Mon, 8 Dec 2008 06:59:40 + (UTC), BCS wrote: > Reply to Bill, > >> On Mon, Dec 8, 2008 at 2:57 PM, BCS <[EMAIL PROTECTED]> wrote: >> >>> Reply to Michael P., >>> >>> rand() & TYPES_OF_TILES >>> >>> never use rand like that (the low order bit on many rands toggles >>> every >>> single time)

Inline Assembler: Getting the offset of a label. How?

2008-12-08 Thread poly
Hello d folk, I have a question about D 1.0 inline asm. Has anyone an idea how to get the offset of a label without using "call Label1", then "pop eax". Actually there would be an offsetof but it seems not to work. In other (inline) assemblers I'd just use offset or addr, but it seems that my Win

Re: Print a PDF

2008-12-08 Thread John
BCS Wrote: > Reply to John, > > > Hello! > > > > I'm wanting to use D to send a PDF to a printer. Is there an easy way > > to do this? Also, I may need to set which tray to go to and whether it > > should duplex or not. > > > > Could someone help me out? > > > > THANKS! > > > > You would do

Re: why the array bounds array

2008-12-08 Thread BCS
Reply to Sergey, Mon, 8 Dec 2008 06:59:40 + (UTC), BCS wrote: better (I think): rand() / (RAND_MAX / TYPES_OF_TILES) Don't use rand() like this, ever. ;) "RAND_MAX / TYPES_OF_TILES" is an integer expression, it rounds down, therefore your formula gives a slightly greater range of

Re: Inline Assembler: Getting the offset of a label. How?

2008-12-08 Thread Kagamin
poly Wrote: > I have a question about D 1.0 inline asm. Has anyone an idea how to get > the offset of a label without using "call Label1", then "pop eax". > Actually there would be an offsetof but it seems not to work. mov eax, Label1

Re: why the array bounds error

2008-12-08 Thread Kagamin
Michael P. Wrote: > I meant array bounds error, not array bounds array. :P http://www.digitalmars.com/d/2.0/arrays.html learn prefix and postfix syntax.

Re: Inline Assembler: Getting the offset of a label. How?

2008-12-08 Thread poly
Kagamin schrieb: > poly Wrote: > >> I have a question about D 1.0 inline asm. Has anyone an idea how to get >> the offset of a label without using "call Label1", then "pop eax". >> Actually there would be an offsetof but it seems not to work. > > mov eax, Label1 Hi Kagamin, I've just tried this

Freeing of memory (garbage collection)

2008-12-08 Thread Dan W
A couple of questions: 1: Even though D has an automatic garbage collector, is one still allowed to free the memory of a malloced array manually (using free () ), to avoid pauses in the program? 2: One justification on the website for using automatic garbage collection is how "allocated memory wi

Re: Freeing of memory (garbage collection)

2008-12-08 Thread BCS
Reply to Dan, A couple of questions: 1: Even though D has an automatic garbage collector, is one still allowed to free the memory of a malloced array manually (using free () ), to avoid pauses in the program? Yes, in fact if you malloc memory you MUST free it. Only stuff like dynamic arrays

Cyclic Dependencies

2008-12-08 Thread Ellery Newcomer
Hello all, I began learning D a few months ago, and now I have a question about cyclic dependencies (and some random whining). I come from a java background and have had no serious exposure to C++. In java, cyclic dependencies are legit to the best of my knowledge. I don't know about C++, th

Re: why the array bounds array

2008-12-08 Thread Zarathustra
Michael P. Wrote: > Okay, I'm getting an array bounds error, and I have no clue why. Here is the > code that affect it: > > //Constants > const int SCREEN_WIDTH = 640; > const int SCREEN_HEIGHT = 480; > const int TILE_WIDTH = 20; > const int TILE_HEIGHT = 20; //how big one tile is, in pixels > c

Re: Cyclic Dependencies

2008-12-08 Thread Zarathustra
Ellery Newcomer Wrote: > Hello all, > > I began learning D a few months ago, and now I have a question about > cyclic dependencies (and some random whining). > > I come from a java background and have had no serious exposure to C++. > In java, cyclic dependencies are legit to the best of my kn