Programming Assistance Thread

Website, internet, technology, and computer resources, discussion and assistance.

Unread postby Justin » Fri Oct 21, 2005 10:32 pm

Tyler wrote:Last year I took care of my HTML studies and this year I am taking Visual Basic .NET, C++, and Java for my programming languages. I was wondering if it is at all possible to have a click event procedure when you click on a menu item that loads a HTML page. Does anyone know the command for this I'm baffled.

I'm using the MSDN version of Vistual Studio 2003 if that helps.


Is this in an asp.net page? Or a regular windows form application?
My Website

My Blog

The Dungeon

Trouble maker extraordinaire!
User avatar
Justin
Scholar of Shen Zhou
 
Posts: 3356
Joined: Fri Jun 21, 2002 2:08 am
Location: Dropping it like it's hot

Unread postby Tyler » Sat Oct 22, 2005 3:32 am

I'm using your basic form application.
User avatar
Tyler
Scholar of Shen Zhou
 
Posts: 2877
Joined: Tue Mar 09, 2004 10:35 pm
Location: I am a Red Hat Penguin!

Unread postby Justin » Sun Oct 23, 2005 11:42 pm

Tyler wrote:I'm using your basic form application.


If I'm understanding this right on the menu click event you can shell out to the OS and have a windows explorer page open to a preset URL.
My Website

My Blog

The Dungeon

Trouble maker extraordinaire!
User avatar
Justin
Scholar of Shen Zhou
 
Posts: 3356
Joined: Fri Jun 21, 2002 2:08 am
Location: Dropping it like it's hot

Unread postby The Zibbuto » Thu Apr 27, 2006 11:31 am

Sorry if I poster a quite similar thread before... :oops:
Well, I got to make a program for an exam at the university and I have a little problem... My program should allow you to play the roulette. Everything is fine excpet for a little thing: when you come to put your "budget" (in order to play) and if you insert a letter from the keyboard, my program goes mad... this is the script that (I think) creates the problem:
for(i=0;i<ngiocatori;i++)
{
cout << "Player " << i+1 << ": please, tell us your budget";
cin >> budget;

/* while (budget[i]<=0||budget[i]>30000||cin.fail()||cin.bad())
NOTA: PROTEGGERE DA INPUT NON INTERI. */

while (budget[i]<=0||budget[i]>30000)
{ cout << "You can only insert a budget between 1 and 30000\n";
cout << "Please insert your budget again: ";
cin >> budget[i]; }

}
/* End budget. */

These are the lines, I think. I use the g++ program (Linux) to run the program....
I've proved everything, the [i]cast operation, ordering the program to not accept char but nothing!
If someone have a suggest, please, answer me here or with Messenger, ICQ, or private mail... I'm desperate!!!! :cry: :x
FUKUSHIMA: I hate tractor-beam! It makes me itching!
HONDA: are you sure that there aren't crab louses?
http://starkessen.altervista.org/Englis ... hPage.html
User avatar
The Zibbuto
Scholar of Shen Zhou
 
Posts: 888
Joined: Sun Sep 12, 2004 5:31 pm
Location: Somewhere in time... Planning to become Zhuge Liang's worse Nightmare

Unread postby Wix The Great » Thu Apr 27, 2006 7:06 pm

Since budget is an array of characters I assume, you need:

cout << "Player " << i+1 << ": please, tell us your budget";
cin >> budget[i];

*EDIT: Sorry, not an array of character. Probably an array of doubles or floats since it is a budget.
Last edited by Wix The Great on Sat Apr 29, 2006 5:53 am, edited 2 times in total.
Wix The Great
3/3 of Wei World Order
 
Posts: 654
Joined: Fri Jun 14, 2002 11:42 pm
Location: 127.0.0.1

Unread postby Justin » Thu Apr 27, 2006 9:39 pm

Bill wrote:Since budget is an array of characters I assume, you need:

cout << "Player " << i+1 << ": please, tell us your budget";
cin >> budget[i];


I believe Bill is right on this one. You need to tell the program where in the array to insert the value.
My Website

My Blog

The Dungeon

Trouble maker extraordinaire!
User avatar
Justin
Scholar of Shen Zhou
 
Posts: 3356
Joined: Fri Jun 21, 2002 2:08 am
Location: Dropping it like it's hot

Unread postby evizaer » Tue May 16, 2006 5:48 am

The Zibbuto wrote:Sorry if I poster a quite similar thread before... :oops:
Well, I got to make a program for an exam at the university and I have a little problem... My program should allow you to play the roulette. Everything is fine excpet for a little thing: when you come to put your "budget" (in order to play) and if you insert a letter from the keyboard, my program goes mad... this is the script that (I think) creates the problem:
for(i=0;i<ngiocatori;i++)
{
cout << "Player " << i+1 << ": please, tell us your budget";
cin >> budget;

/* while (budget[i]<=0||budget[i]>30000||cin.fail()||cin.bad())
NOTA: PROTEGGERE DA INPUT NON INTERI. */

while (budget[i]<=0||budget[i]>30000)
{ cout << "You can only insert a budget between 1 and 30000\n";
cout << "Please insert your budget again: ";
cin >> budget[i]; }

}
/* End budget. */

These are the lines, I think. I use the g++ program (Linux) to run the program....
I've proved everything, the [i]cast operation, ordering the program to not accept char but nothing!
If someone have a suggest, please, answer me here or with Messenger, ICQ, or private mail... I'm desperate!!!! :cry: :x


You need to have your program check the input first to make sure it is a valid integer. The way your code is now, if you don't input an double or an int, it'll spazz out on you. I haven't written C++ code in a few months, so i don't exactly recall how to test to see if something's an integer. There are plenty of C++ standard library resources on the 'net that probably can assist you.
User avatar
evizaer
Student
 
Posts: 110
Joined: Thu Apr 21, 2005 11:46 pm
Location: New Jersey, USA

Unread postby The Zibbuto » Sun Jun 18, 2006 12:39 pm

Me again, question about DevC++, my compiler for Windows... well, when I press "return" in order to give an order from the prompt... the window disappears! :shock: Does anyobdy know why and how can I make it work?
FUKUSHIMA: I hate tractor-beam! It makes me itching!
HONDA: are you sure that there aren't crab louses?
http://starkessen.altervista.org/Englis ... hPage.html
User avatar
The Zibbuto
Scholar of Shen Zhou
 
Posts: 888
Joined: Sun Sep 12, 2004 5:31 pm
Location: Somewhere in time... Planning to become Zhuge Liang's worse Nightmare

Unread postby Justin » Mon Jun 19, 2006 2:06 pm

The Zibbuto wrote:Me again, question about DevC++, my compiler for Windows... well, when I press "return" in order to give an order from the prompt... the window disappears! :shock: Does anyobdy know why and how can I make it work?


I think we need a little bit more info on what you're trying to do there.
My Website

My Blog

The Dungeon

Trouble maker extraordinaire!
User avatar
Justin
Scholar of Shen Zhou
 
Posts: 3356
Joined: Fri Jun 21, 2002 2:08 am
Location: Dropping it like it's hot

Unread postby The Zibbuto » Wed Jun 21, 2006 8:18 am

I've made the simplest program ever made, a simple addition... it takes teh number from the keyboard with the command cin , but when I press return to insert the number, the window from DevC++ disappear... and I don't know why.
(I can't stand having Linux...)
FUKUSHIMA: I hate tractor-beam! It makes me itching!
HONDA: are you sure that there aren't crab louses?
http://starkessen.altervista.org/Englis ... hPage.html
User avatar
The Zibbuto
Scholar of Shen Zhou
 
Posts: 888
Joined: Sun Sep 12, 2004 5:31 pm
Location: Somewhere in time... Planning to become Zhuge Liang's worse Nightmare

PreviousNext

Return to Foreign Kingdoms

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

Copyright © 2002–2008 Kongming’s Archives. All Rights Reserved