Be Excellent To Each Other

And, you know, party on. Dude.

All times are UTC [ DST ]




Reply to topic  [ 127 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:27 

Joined: 30th Mar, 2008
Posts: 8679
If you're running a command line program from windows it'll close the window when it's finished. There's plenty of ways to get it to pause though. Alternatively, start a windows command line and run said program from that.

Edit : 3 answers in as many minutes, does this place rock or what?


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:28 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
I've fathomed a way. I was running it and debugging, but if I run it without debugging it keeps it open. Presumably when it debugs, it just runs the program to test it and then closes it.

edit: It does indeed rock!


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:30 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17154
Location: Just Outside That London, England, Europe
The easy way would be to chuck in a breakpoint just before the program ends if you want it to pause with no extra work while debugging.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:33 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
Yeah that would be easy, were it not my first ever program in C# :p

I'm just following the book!

Am I right in thinking that debug does just that? Checks the program and closes it? Whereas running it without debug is like running it from the point of view of an end user who may have downloaded my program?


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:34 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17154
Location: Just Outside That London, England, Europe
jonarob wrote:
Yeah that would be easy, were it not my first ever program in C# :p

I'm just following the book!

Am I right in thinking that debug does just that? Checks the program and closes it? Whereas running it without debug is like running it from the point of view of an end user who may have downloaded my program?


No, the point of debug is to enable you to debug it (after all, how does it know a bug as compared to the behaviour you wanted, you may have wanted it to horribly crash). Breakpoints are places where you stop the program from running, and then it allows you to step through each instruction and see what values things are taking, hence allowing you to find wrong ones, and find the bug causing it. Just one of the things that debuggers allow you to do.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:36 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
Right. So does anyone know why the book tells me that the console will show my "hello world" when in fact it just closes the cmd prompt? Is the book BROKEN? I've followed the instructions exactly.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:38 
User avatar
lazy eye patch

Joined: 27th Mar, 2008
Posts: 3955
Location: Telford, UK
Are you seeing Hello World at all before it closes?
Oh. So, do you have a command prompt, but running your program then closes that prompt? Even though you already had a prompt anyway before running the program?

_________________
Photographs


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:40 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17154
Location: Just Outside That London, England, Europe
I wouldn't think it's broken - certainly not in terms of teaching you to program as compared to using visual studio. Did it actually ask you to debug it as compared to just running it? Could be that VS2008 works differently from 2005. Could be the professional version works differently to the express version. As it stands the program is doing exactly what it's supposed to, it's just the enviroment around it that isn't behaving quite as you'd expect, but don't worry.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:41 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
Basically, I've written the Hello World in Visual C# Express, I click "start debugging" like the book says, the cmd prompt flashes up for a split second with my Hello World in it and closes immediately. It is there, but it closes. However, if I click "start without debugging" the cmd prompt stays open. However, the book says to click "start debugging" and shows the cmd prompt OPEN. Bah!

I don't already have the cmd prompt open, by the way.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:43 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17154
Location: Just Outside That London, England, Europe
Right, time to install c# express (2008, I'm guessing) and see what's up.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:46 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
I'm not sure anything is actually wrong. I always thought debugging something runs the program and closes it?


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:49 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17154
Location: Just Outside That London, England, Europe
As I said, the programs fine, the enviroment isn't behaving as you expect. I'm just looking to see if there's a way to change that.

I do remember an option about whether the console closes automatically, but it's been a long time since I've done anything console based.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:53 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
To be honest, it looks like it moves onto Windows based stuff pretty soon, so fuck it! :)


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:57 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17154
Location: Just Outside That London, England, Europe
Bugger me, express is sparse. No option there, but I get exactly the same results as you do (that is one pauses, one doesn't), and I wouldn't worry about it.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 19:58 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
Aces! Thanks, Dave :) (And CUS)


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 20:12 
User avatar
lazy eye patch

Joined: 27th Mar, 2008
Posts: 3955
Location: Telford, UK
PHP.

_________________
Photographs


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 20:14 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
Shh!


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 20:14 
SupaMod
User avatar
Commander-in-Cheese

Joined: 30th Mar, 2008
Posts: 49232
CUS wrote:
PHP.


Goddamned hippy.

_________________
GoddessJasmine wrote:
Drunk, pulled Craster's pork, waiting for brdyime story,reading nuts. Xz


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 20:15 
User avatar
lazy eye patch

Joined: 27th Mar, 2008
Posts: 3955
Location: Telford, UK
(I have idly started to write a book called 'How to learn how to program (with PHP)'. It is written in PHP. It's actually forming together scarily well, so that even when I inevitably completely forget about it in a day or two, it might be worth posting anyway, as a 'How to write a book (with PHP' example.)

_________________
Photographs


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 20:17 
SupaMod
User avatar
Commander-in-Cheese

Joined: 30th Mar, 2008
Posts: 49232
CUS wrote:
(I have idly started to write a book called 'How to learn how to program (with PHP)'. It is written in PHP. It's actually forming together scarily well, so that even when I inevitably completely forget about it in a day or two, it might be worth posting anyway, as a 'How to write a book (with PHP' example.)


How does it bind the pages? With $string?


I AM THE FUNNIEST PERSON EVER.

_________________
GoddessJasmine wrote:
Drunk, pulled Craster's pork, waiting for brdyime story,reading nuts. Xz


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 20:20 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
Craster wrote:
CUS wrote:
PHP.


Goddamned hippy.


I'm meeting you half-way you stupid hippies.

Image


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 20:21 
User avatar
lazy eye patch

Joined: 27th Mar, 2008
Posts: 3955
Location: Telford, UK
jonarob wrote:
I'm meeting you half-way you stupid hippies.

Image

"Make it £1 a month!"

_________________
Photographs


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 22:30 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69507
Location: Your Mum
Haaaaaaa-rooooooooo!

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Fri Apr 11, 2008 22:45 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
I can do a mean Nixon impression, me.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Sat Apr 12, 2008 0:01 
User avatar
lazy eye patch

Joined: 27th Mar, 2008
Posts: 3955
Location: Telford, UK
You order the deaths of civilian north Koreans in unlawful air strikes? FUCKING HELL JONAROB!!! :o

_________________
Photographs


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Sat Apr 12, 2008 0:03 
User avatar

Joined: 27th Mar, 2008
Posts: 14497
Only playing, though.


Top
 Profile  
 
 Post subject: Re: Programming
PostPosted: Sat Apr 12, 2008 0:10 
User avatar
lazy eye patch

Joined: 27th Mar, 2008
Posts: 3955
Location: Telford, UK
Oh if you're only playing that's okay.

_________________
Photographs


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 127 posts ]  Go to page Previous  1, 2, 3

All times are UTC [ DST ]


Who is online

Users browsing this forum: Malc and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search within this thread:
You are using the 'Ted' forum. Bill doesn't really exist any more. Bogus!
Want to help out with the hosting / advertising costs? That's very nice of you.
Are you on a mobile phone? Try http://beex.co.uk/m/
RIP, Owen. RIP, MrC.

Powered by a very Grim... version of phpBB © 2000, 2002, 2005, 2007 phpBB Group.