Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / .net functions

Author
Message
theplake
16
Years of Service
User Offline
Joined: 30th Nov 2007
Location:
Posted: 16th May 2008 19:00
How i can use the .net function in Darkgdk?
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
theplake
16
Years of Service
User Offline
Joined: 30th Nov 2007
Location:
Posted: 16th May 2008 19:51
I will convert a char to int.
This is my problem:
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 16th May 2008 19:55 Edited at: 16th May 2008 20:32
wrong use of dbInput IMHO.

I would just loop and wait for a key... for the messages... like this:


[edit]tossed in a sleep command so pc not hung while waiting[/edit] if it causes issue, add #include <windows.h> and you should be fine.

theplake
16
Years of Service
User Offline
Joined: 30th Nov 2007
Location:
Posted: 16th May 2008 19:58
Big THX!

But is unconfortable!
DarkGDK with .net framework functions where easyer.
I can write it in one Line Convert::ToInt...
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 16th May 2008 20:07 Edited at: 16th May 2008 20:11
As Jason said, your code is incorrect. Your 'colors' variable uses the data type 'char*', meaning it is an address to an array of chars(in this case), doing 'if (colors < 1 || colors > 5)' would be seeing if the address is lower or greater than 1 and 5, respectively. If you know the ASCII value for the number 1, then it's just a simple case of, 'int number = colors[0]-theLovelyASCIIVlueFor1;', the resulting number would be zero based, you could also use int number = *colors-blah.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 16th May 2008 20:35 Edited at: 16th May 2008 20:36
edited code above to add a sleep command so not hung... dark coder's suggestion applies to alot of different things by the way... and I know that the dbKeyState is not the same as ASCII so don't get those confused. dbKeyState literally boils down to wires in you're keyboard... and is why some key combos just don't work... (if wire already crossed, crossing twice doesn't register) where char, ascii, dbEntry - are all related.

[edit] Wife changed to wire... changes meaning entirely[/edit]

Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 16th May 2008 21:18
I wouldn't use a clear screen command immediately after printing something to the screen.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 16th May 2008 21:29
@theplake : In C, it is also 1 line, using function atoi, which is what .NET will use after going through any marshalling in both directions, that is.

@jps : I was going to say that wife crossing can be done many, many times...until wife gets converted to ex-wife. It registers. Wife swapping is something I am only half familiar with, and not the good half, either. Wires, I can handle.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 16th May 2008 21:50

Login to post a reply

Server time is: 2024-09-29 21:19:40
Your offset time is: 2024-09-29 21:19:40