-
need help with a program...gremlinsa help again!!!
Hi, I need help with a program again. I am having trouble writing it.. here are the instructions..
The sun rises every morning and sets every night. There is a certain time during the day that is halfway in between called high noon. Your job is to write a program where you enter the times in minutes and hours for sunrise and sunset. Then you must determine when high noon is. Aumme that the data is correct, the form below shows how your data might look
sunrise am:
Sunset pm"
High noon is at.....
calculate
If someone can help me write this please let me knwo..!!!Gremlin Sa you helped me before if you see this please help again
-
Re: need help with a program...gremlinsa help again!!!
I'll look into this one. Can you post the entry format and the output format IE Sunrise Time in HH:MM or HH in one textbox, MM in another??
The calculation would be 1/2 of Time diference + Sunrise time... do I assume right - Is it given ???..
Gremmy..
-
Re: need help with a program...gremlinsa help again!!!
Yea the hours and minutes are in two seperate text boxes.. thank you so much.. ive been sittin here trying to do this for the past hour
-
1 Attachment(s)
Re: need help with a program...gremlinsa help again!!!
Gremlin.. here is the form i was using...
-
Re: need help with a program...gremlinsa help again!!!
Is my assumption about the Calculation correct.. or is it not given ???
Gremmy..
-
Re: need help with a program...gremlinsa help again!!!
The calculation was not given, but the calculation you did for me was the same one i came upw ith also..
-
Re: need help with a program...gremlinsa help again!!!
The example give was as follows
Sunrise (am) 7:08
Sunset (pm) 8:30
High noon is at 1:49 pm
(when calculated.)
-
Re: need help with a program...gremlinsa help again!!!
Quote:
Originally Posted by sharib0816
The example give was as follows
Sunrise (am) 7:08
Sunset (pm) 8:30
High noon is at 1:49 pm
(when calculated.)
Must the time be in Am/Pm format or can we use the 24 hour Clock ???
Gremmy..
-
Re: need help with a program...gremlinsa help again!!!
AM/PM format... since the answer must say whether it is am or pm for the answer
-
Re: need help with a program...gremlinsa help again!!!
Okay .. You Know the Drill .. Post what you got... And i will help you sort it out..
Gremmy..
-
1 Attachment(s)
Re: need help with a program...gremlinsa help again!!!
Its not much, im really stuck on what to do, but here it is...
-
Re: need help with a program...gremlinsa help again!!!
Do you have any idea on how to do this??? cause what you did for me last time was such a great help, i didnt hand in what you gave me, i changed the stuff so it was in my wording, but it worked out great.. I dont knwo how you are so good at this, but it is amazing because for you to be able to help me out like thsi you have no idea how much i appreciate it.
-
Re: need help with a program...gremlinsa help again!!!
Give me a few minutes to work things out..
Post for you as soon as i have something..
Gremmy..
Ps.. I do know how to do this... Very simular code to the last one..
-
Re: need help with a program...gremlinsa help again!!!
Thank you so much... ill be here.. :-)
-
Re: need help with a program...gremlinsa help again!!!
Quote:
Originally Posted by sharib0816
Sunrise (am) 7:08
Sunset (pm) 8:30
High noon is at 1:49 pm
Is this right ??? I'm getting 2:49 PM in my calculations ???
Gremmy??
-
Re: need help with a program...gremlinsa help again!!!
-
Re: need help with a program...gremlinsa help again!!!
-
1 Attachment(s)
Re: need help with a program...gremlinsa help again!!!
Sorry -- Me being an idiot... It is right.
Here is the project for you ....
I did it in my own form.. you can go through it and write your own in your form..
Enjoy....
Gremmy....
-
Re: need help with a program...gremlinsa help again!!!
Gremmy, for some reason i cant open it, it is saying that i cant open it because it was made with a different visual basic program, can you post the form on here? so i can see it?
-
Re: need help with a program...gremlinsa help again!!!
Quote:
Originally Posted by sharib0816
Gremmy, for some reason i cant open it, it is saying that i cant open it because it was made with a different visual basic program, can you post the form on here? so i can see it?
What ver. of VB are you Using.. I got VB6 Pro....
Try by Dbl clicking on form1 instead of project1 to open it ..
-
Re: need help with a program...gremlinsa help again!!!
im using 6.0 but when i click on it, it says error during load... it wont let em open it or do anyhting with it.
-
Re: need help with a program...gremlinsa help again!!!
in the corner where it says form, there is a little lock icon on the form
-
Re: need help with a program...gremlinsa help again!!!
oK, I copied what you did over to my visual basic form, but it said invalid property array.. what shoudl i do about that?
-
1 Attachment(s)
Re: need help with a program...gremlinsa help again!!!
Quote:
Originally Posted by sharib0816
oK, I copied what you did over to my visual basic form, but it said invalid property array.. what shoudl i do about that?
i've re attached the form...
Try this one.
----Edit----
New attachement..
Form1.frx included....
-
Re: need help with a program...gremlinsa help again!!!
Here's why you get that error:
Inputting values into a list from the IDE inserts the items into a Form1.frx file. That file isn't included, so the listboxes can't get the values, but the Form1.frm file itself references the Form1.frx file as to what is in the listbox.
Hence, the error, and hence the error message that comes on load, which says:
Quote:
Line 32: Property ItemData in AM_PM had an invalid file reference.
Line 34: Property List in AM_PM had an invalid file reference.
Line 70: Property ItemData in AM_PM had an invalid file reference.
Line 72: Property List in AM_PM had an invalid file reference.
Line 80: Property ItemData in AM_PM had an invalid file reference.
Line 82: Property List in AM_PM had an invalid file reference.
If you look at Form1.frm in a plain text editor at those lines, you'll see references to Form1.frx:
Code:
'From Form1.frm
Begin VB.ListBox AM_PM
Enabled = 0 'False
Height = 255
Index = 2
ItemData = "Form1.frx":0000
Left = 1800
List = "Form1.frx":0007
TabIndex = 9
Top = 1320
Width = 615
End
'...
You'd have to open it through the project, or have Gremmy upload the FRX separately.
I don't get why it doesn't open for you. It did for me (VB6 Enterprise Edition).
But, in any case, you could just manually open the form by itself, then add AM and PM as list items in all three ListBoxes. That should get it working for you.
-
Re: need help with a program...gremlinsa help again!!!
Quote:
Originally Posted by ChaosTheEternal
Here's why you get that error:
Inputting values into a list from the IDE inserts the items into a Form1.frx file. That file isn't included, so the listboxes can't get the values, but the Form1.frm file itself references the Form1.frx file as to what is in the listbox.
---- SNIP ----
Gremmy needs to upload the FRX file.
Thanks Chaos.... :thumb:
added it to the upload..
-
Re: need help with a program...gremlinsa help again!!!
Just thought I'd point out an easier way to do the calculation:
Code:
Private Sub HighNoon()
Dim dRise As Date, dSet As Date, dNoon As Date
dRise = CDate("7:08 AM")
dSet = CDate("8:30 PM")
dNoon = dRise + ((dSet - dRise) / 2)
Debug.Print (dNoon)
End Sub