Re: Converting string to ascii value

2014-03-07 Thread Nick Sabalausky
On 3/7/2014 5:33 PM, H. S. Teoh wrote: long x = cast(ubyte) stringarray[0]; long x = cast(ubyte) stringarray[0][0]; ;)

Re: Converting string to ascii value

2014-03-07 Thread Nick Sabalausky
On 3/7/2014 5:37 PM, Setra wrote: Thanks! Now I feel kind of dumb. For some reason I thought it would not be that simple... In a lot of languages it isn't that simple ;)

Re: Converting string to ascii value

2014-03-07 Thread Nick Sabalausky
On 3/7/2014 5:21 PM, Setra wrote: Hello all! I am having trouble converting a letter in a array of string to the ascii value. For example: First of all: string[] stringarray[3]; This isn't your main problem, but that line is incorrect. Actually, I'm kinda surprised that even works. It sho

Re: Converting string to ascii value

2014-03-07 Thread Setra
Thanks! Now I feel kind of dumb. For some reason I thought it would not be that simple...

Re: Converting string to ascii value

2014-03-07 Thread Setra
On Friday, 7 March 2014 at 22:21:06 UTC, Setra wrote: Hello all! I am having trouble converting a letter in a array of string to the ascii value. For example: string[] stringarray[3]; stringarray[0] = "blahblahblah"; stringarray[1] = "a"; stringarray[2] = "5"; long y = to!long(stringarray[2]);

Re: Converting string to ascii value

2014-03-07 Thread H. S. Teoh
On Fri, Mar 07, 2014 at 10:21:57PM +, Setra wrote: > On Friday, 7 March 2014 at 22:21:06 UTC, Setra wrote: > >Hello all! I am having trouble converting a letter in a array of > >string to the ascii value. For example: > > > >string[] stringarray[3]; > >stringarray[0] = "blahblahblah"; > >string

Re: Converting string to ascii value

2014-03-07 Thread Ali Çehreli
On 03/07/2014 02:21 PM, Setra wrote: > On Friday, 7 March 2014 at 22:21:06 UTC, Setra wrote: >> Hello all! I am having trouble converting a letter in a array of >> string to the ascii value. For example: >> >> string[] stringarray[3]; That is three string slices, not three strings. This works fo

Converting string to ascii value

2014-03-07 Thread Setra
Hello all! I am having trouble converting a letter in a array of string to the ascii value. For example: string[] stringarray[3]; stringarray[0] = "blahblahblah"; stringarray[1] = "a"; stringarray[3] = "5"; long y = to!long(stringarray[2]); // makes y the value 5 long x = to!long(stringarray[1]

Re: Best way to reference an array in a child class...

2014-03-07 Thread captain_fid
On Friday, 7 March 2014 at 13:57:31 UTC, Steven Schveighoffer wrote: On Thu, 06 Mar 2014 17:44:09 -0500, captain_fid wrote: this() {items = [ {10, "first"}, {20, "second"}];} strangely enough, when modeling this the first time (using items as a class) and 'new item() syntax) there was

Re: exception handling and dynamic loading

2014-03-07 Thread Dicebot
On Friday, 7 March 2014 at 20:14:07 UTC, Carl Sturtivant wrote: I'm using DMD32 D Compiler v2.064 on windows This is the main problem. All recent work Martin Nowak has done on improving dynamic loading is Linux-only for now. Windows support is very limited compared to it.

exception handling and dynamic loading

2014-03-07 Thread Carl Sturtivant
I am loading my own small dynamic library of functions, using Runtime.loadLibrary in core.runtime and want an exception thrown in a function in the dynamic library to be caught close to where I call it, which is of course in the program that's doing the dynamic loading. How do I get the excep

Re: New to std.algorithm and generics, no idea how to make simple things to work

2014-03-07 Thread newguy
Text went nuts at least for me so here's raw pastebin of it http://pastebin.com/raw.php?i=JfLFdsNj

New to std.algorithm and generics, no idea how to make simple things to work

2014-03-07 Thread newguy
I really can't wrap my head around these. I fought whole day trying to figure out how to do the simplest thing one can imagine: remove an element from a doubly linked list. Here's what I've tried, see if there is a recurring mistake of thought or something: import std.stdio; import std.algorithm;

Re: Compiling D through command line

2014-03-07 Thread Bauss
- I apologize for it all, my bad. It wasn't even a problem with the compiler nor arguments. I thought I had file extensions to show, so my main.d was actually main.d.txt Explains why it couldn't read the file. Fixed and got everything compiled fine.

Re: Compiling D through command line

2014-03-07 Thread Bauss
On Friday, 7 March 2014 at 18:07:00 UTC, Steve Teale wrote: On Friday, 7 March 2014 at 16:59:30 UTC, Bauss wrote: What arguments would I do to compile a d project through command line. Been trying a few things, but can't get it working. I always get "Error: cannot read file x" Read around th

Re: Compiling D through command line

2014-03-07 Thread Steve Teale
On Friday, 7 March 2014 at 16:59:30 UTC, Bauss wrote: What arguments would I do to compile a d project through command line. Been trying a few things, but can't get it working. I always get "Error: cannot read file x" Read around the net and it most says it's an installation error and that r

Re: Compiling D through command line

2014-03-07 Thread Jeremy DeHaan
On Friday, 7 March 2014 at 16:59:30 UTC, Bauss wrote: What arguments would I do to compile a d project through command line. Been trying a few things, but can't get it working. I always get "Error: cannot read file x" Read around the net and it most says it's an installation error and that r

Re: Compiling D through command line

2014-03-07 Thread Bauss
On Friday, 7 March 2014 at 17:44:46 UTC, H. S. Teoh wrote: On Fri, Mar 07, 2014 at 04:59:29PM +, Bauss wrote: What arguments would I do to compile a d project through command line. Been trying a few things, but can't get it working. I always use the command line, and it has always worked

Re: Compiling D through command line

2014-03-07 Thread H. S. Teoh
On Fri, Mar 07, 2014 at 04:59:29PM +, Bauss wrote: > What arguments would I do to compile a d project through command > line. Been trying a few things, but can't get it working. I always use the command line, and it has always worked fine for me. (Caveat: I use Linux, so I've no idea if what I

Re: Compiling D through command line

2014-03-07 Thread Bauss
On Friday, 7 March 2014 at 17:08:24 UTC, Rene Zwanenburg wrote: On Friday, 7 March 2014 at 16:59:30 UTC, Bauss wrote: What arguments would I do to compile a d project through command line. Been trying a few things, but can't get it working. I always get "Error: cannot read file x" Read aroun

Re: Compiling D through command line

2014-03-07 Thread Rene Zwanenburg
On Friday, 7 March 2014 at 16:59:30 UTC, Bauss wrote: What arguments would I do to compile a d project through command line. Been trying a few things, but can't get it working. I always get "Error: cannot read file x" Read around the net and it most says it's an installation error and that r

Compiling D through command line

2014-03-07 Thread Bauss
What arguments would I do to compile a d project through command line. Been trying a few things, but can't get it working. I always get "Error: cannot read file x" Read around the net and it most says it's an installation error and that reinstalling should fix it, but it works when compiling

Re: Template mixins - why only declarations

2014-03-07 Thread Gary Willoughby
On Thursday, 6 March 2014 at 18:31:02 UTC, Frustrated wrote: On Thursday, 6 March 2014 at 17:27:35 UTC, Steve Teale wrote: Pretty much what the subject says. Why can't template mixins include statements ans so on? Is it just too hard, or is it just too much like C macros? Steve template mix

Re: Best way to reference an array in a child class...

2014-03-07 Thread Steven Schveighoffer
On Thu, 06 Mar 2014 17:44:09 -0500, captain_fid wrote: this() {items = [ {10, "first"}, {20, "second"}];} strangely enough, when modeling this the first time (using items as a class) and 'new item() syntax) there was no real issue. I thought using a static array of structs in the chi

Re: Template mixins - why only declarations

2014-03-07 Thread Steve Teale
On Thursday, 6 March 2014 at 18:36:12 UTC, Dejan Lekic wrote: Template mixins can't contain statements, only declarations, because they (template mixins) are a way to inject code into the context. Therefore it makes sense to forbid statements, as they can't appear in ANY context. If I sid

Re: Type-Safer Modern High-Level Performant OpenGL

2014-03-07 Thread ponce
On Thursday, 6 March 2014 at 23:03:35 UTC, Nordlöw wrote: On thing though...why did you choose SDL2 of GLFW3? I of course mean SDL2 *over* GLFW3. Mostly familiarity because I've never used GLFW. What I really like in SDL is the software/DirectX renderers, which provides a tiny feature set,

Re: Type-Safer Modern High-Level Performant OpenGL

2014-03-07 Thread ponce
On Thursday, 6 March 2014 at 23:16:26 UTC, Nordlöw wrote: GFM (my own, PLEASE, PLEASE CHOOSE ME) I'm trying to build your package using dub but I get the error θ61° [per:~/justd/gfm] master ± dub Error executing command run: Main package must have a binary target type, not none. Cannot