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 / Current line number

Author
Message
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 18th Jun 2008 14:52
For the purpose of generating error messages, I wondered if there was a command that would return the current line number that the program is at. In the below example, I'd like the number 7 to be automatically generated. I don't want to hard code the number, because I intend to make changes and thus line numbers may change.

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 18th Jun 2008 16:10 Edited at: 18th Jun 2008 16:10
Use the __LINE__ macro. It's replaced with the line number at compile-time.

Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 18th Jun 2008 22:11
Dang, Benjamin beat me.

If you can do any models for FW, reply to the FleetWars thread.

Click here!
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 18th Jun 2008 22:13
@Zuka

If you are really 13, you know a lot of C++.
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 18th Jun 2008 22:15
Well, I started with Lua, and worked my way up. I've been making websites in HTML, Javascript, PHP, and Java since I was 6 or 7.

If you can do any models for FW, reply to the FleetWars thread.

Click here!
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 18th Jun 2008 22:19
You have know idea how much I envy you.

Out of curiosity, how did you get such an early start? Are your parents involved in programming and such?
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 18th Jun 2008 22:21
Not really, but I grew up with access to a high performance computer (since the age of 3), and I've used the internet since - it fascinated me. Of course, back then, there weren't any really good sites with great graphics, like the current Microsoft website or even TGC.

If you can do any models for FW, reply to the FleetWars thread.

Click here!
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 18th Jun 2008 22:23
I've always messed with/read about as much as I can dealing with computers. I just wish I had the head start that you have.

Login to post a reply

Server time is: 2024-11-20 13:20:57
Your offset time is: 2024-11-20 13:20:57