Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   Creating a Zodiac Sign Program in Visual Basic (http://www.programmingforums.org/showthread.php?t=15305)

Rick Mar 3rd, 2008 4:13 AM

Creating a Zodiac Sign Program in Visual Basic
 
Hello all, I am trying to build a Zodiac Sign in Visual Basic and can't seem to get it to change names after selecting a different date and Month.... I have used, dim Dat as integer, Mon as string

but not sure if I have to

dim 1,2,3, etc. as integer, dim January, February, as string, etc., but cannot seem to figure out how to get lets say Aries to change to Taurus... march 21 to April 19 are Aries, so how would I write code to make it change from Aries to another sign??? if anybody can answer that, thanks.. :)

OpenLoop Mar 3rd, 2008 8:16 AM

Re: Creating a Zodiac Sign Program in Visual Basic
 
You'll have to post some code. Don't forget to use the CODE tags. Also, are you using VB.NET or VB6?

Rick Mar 3rd, 2008 8:32 AM

Re: Creating a Zodiac Sign Program in Visual Basic
 
Quote:

Originally Posted by OpenLoop (Post 141935)
You'll have to post some code. Don't forget to use the CODE tags. Also, are you using VB.NET or VB6?

<code>

<font color="red" font size="3">
I'm using VB.net 2005, here's my code...

Public Class Frm0

Dim Mon As String
Dim january, February, March, April, May, June, July, August, September, October, November, December As String
Dim Dat As String
Dim one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thrirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty, twenty_one, twenty_two, twenty_three, twenty_four, twenty_five, twenty_six, twenty_seven, twenty_eight, twenty_nine, thirty, thirty_one As String
Private Sub Frm0_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click
End
End Sub

Private Sub Button1_Clsick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn3.Click
Txt1.Text = " "
End Sub

Private Sub Btn2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn2.Click
If Mon = March And Dat >= twenty_one & Mon = April And Dat <= nineteen Then

Txt1.Text = "Your sign is: Aries"
End If


End Sub
End Class

</font>
</code>

Rick Mar 3rd, 2008 8:34 AM

Re: Creating a Zodiac Sign Program in Visual Basic
 
humm weird, I wonder why it displayed <code><font></font></code>

mrynit Mar 3rd, 2008 8:38 AM

Re: Creating a Zodiac Sign Program in Visual Basic
 
*rolls eyes*
its the # on the toolbar above the text field. replace {} with []
{CODE} {/CODE}

use phpBB tags not html tags.

Rick Mar 3rd, 2008 8:41 AM

Re: Creating a Zodiac Sign Program in Visual Basic
 
Quote:

Originally Posted by mrynit (Post 141939)
*rolls eyes*
its the # on the toolbar above the text field. replace {} with []
{CODE} {/CODE}

use phpbbs tags not html tags.



:


Ooh thanks, but never heard of phpbbs, I guess it's because I'm learning PHP..


OpenLoop Mar 3rd, 2008 6:38 PM

Re: Creating a Zodiac Sign Program in Visual Basic
 
I don't see where you set Mon and Dat? All you do is define them without setting any initial value.

Rick Mar 4th, 2008 11:35 AM

Re: Creating a Zodiac Sign Program in Visual Basic
 
:


yeah I got the values under those, the stupid thing kept throwing errors about who knows what... 
 I did Dat = "January"
and Dat = january

kept throwing errors that I can't do that, so I removed them and just did seperate  dims for the numbers and months, that worked fine, it does display what I put in betweeen " " but it doesn't switch when you select a different month or date




OpenLoop Mar 4th, 2008 11:55 AM

Re: Creating a Zodiac Sign Program in Visual Basic
 
You seem to be laking an understanding of the basics of Windows programming. You should try a VB.NET tutorial before writing your first program.

Dat will not magically change, you have to read the value from the textbox (or calandar) and assign it to Dat. I don't think I can help you any further.

Rick Mar 4th, 2008 5:48 PM

Re: Creating a Zodiac Sign Program in Visual Basic
 
:


yeah, I'll just stick with C++, I have better knowledge with that than anything but HTML...



All times are GMT -5. The time now is 4:16 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC