 |

10-05-2002, 11:36 PM
|
|
|
View my program please
|
Well, this is not very effecient, I know, but would you look at my program. It's only my second one. My first was Tic-Tac-Toe. So, as a newbie programmer, other than telling me to make my code more effecient, what advice could you offer? There aren't really any statements, so if you can figure out my naming system, you are a genius. 
|
Last edited by Robby; 10-05-2002 at 11:59 PM.
|

10-06-2002, 12:01 AM
|
 |
Code Factory
Retired Moderator * Expert *
|
|
Join Date: Jan 2001
Location: Montreal, Ca.
Posts: 5,565
|
|
|
Do not attach only the form, Zip your poject and re-post it.
To Zip your project...copy your files into a folder then Zip the entire folder.
|
|

10-06-2002, 01:29 AM
|
|
Contributor
|
|
Join Date: Sep 2002
Location: Michigan
Posts: 623
|
|
|
Heh..
Well ill test it once yor RE-post it.
Adam
|
|

10-06-2002, 12:03 PM
|
|
|
Oops, sorry about that. Here's the zipped .exe
Any comments are appreciated.
Edit: removed EXE
|
Last edited by Robby; 10-06-2002 at 09:22 PM.
|

10-06-2002, 12:23 PM
|
|
|
|
This is just the .frm so you can see the code. If you try to run it from visual basic you will get errors because all the pictures were stored on my c: drive. This is just so you can look at the code. The program itself is posted right above this.
|
|

10-06-2002, 01:25 PM
|
 |
Contributor
|
|
Join Date: Jun 2002
Location: Switzerland
Posts: 560
|
|
|
A typ the exe also needs your pix
|
__________________
Please use [vb][\vb] tags for your codes, or at least [code][\code] ([\] = [/])
The most important things of a vb programmer:msdn, google, Allapi and the best always comes last: the EVBF
Death is only the Beginning - Imhotep
|

10-06-2002, 01:30 PM
|
 |
Dead dog's ghost
Forum Leader * Expert *
|
|
Join Date: Feb 2001
Location: Celje, Slovenia, Europe
Posts: 2,601
|
|
First: Your declaration aren't good! This:
Code:
Dim ddealn, ddeals, dhitn, dhits, pdealn, pdeals, phitn, phits As String
Dim ptotaln1, ptotaln2, ptotaln3, ptotaln4, ptotaln5, dtotaln1, dtotaln2, dtotaln3, dtotaln4, dtotaln5, phitcounter, dhitcounter, pacetest, dacetest As Integer
only declares phits as string and dacetest as integer, all others are variants!
Second: Never use End to end your program! Use Unload Me.
Third: You could use control array for images
|
__________________
Yes, MSDN comes with VB! Yes, you must have at least 25 post to have an avatar! No, you cant write your OS in VB! and NO, YOU CAN NOT DECOMPILE IT!
I'm sure there are things that are more important than me - I just can't thing of any...
|

10-06-2002, 02:42 PM
|
|
|
|
1) I'll fix up my naming system.
2) I know to use Unload Me, just wasn't thinking when I typed End.
3)How do you setup a control array? I've heard about them, but never used them.
|
|

10-06-2002, 03:38 PM
|
|
|
|
Okay, if you put all the pictures in a folder on your C: drive in this path: C:\Documents and Settings\Stephen\My Documents\My Pictures\Cards and then run the game it should work. Alternatively, you could just put the pictures wherever you want then in the .frm edit the path name to wherever you put them. Sorry for posting this freakin' file so many times. I would just really like advice on this one, seeing as that I'm so new to all this. Thanks.
|
|

10-06-2002, 04:35 PM
|
 |
Hell's Angel
Retired Moderator * Guru *
|
|
Join Date: Jul 2001
Location: Yorkshire, UK
Posts: 10,394
|
|
|
Also, you could replace all those pTotalIn's and dTotalIn's with a pair of arrays.
|
__________________
A wise one man once said "what you talking about dog breath"
|

10-06-2002, 04:58 PM
|
|
|
|
Okay, but one question. How do you do an array?
|
|

10-06-2002, 05:54 PM
|
 |
Centurion
|
|
Join Date: Sep 2002
Location: australia
Posts: 155
|
|
when you declare the variables, you can declare something as an array by doing it like this :
Code:
dim ThisIsAnArray(10)
which will return an array with 11 "slots", 0 to 10. When you want to use the array, you simple call it like any other variable, but specify what "slot" you're using, ie
Code:
ThisIsAnArray(5) = 12
or whatever...
|
__________________
the conscious part of the brain...
is the bit that's soluble in alcohol.
|

10-07-2002, 12:45 AM
|
 |
Dead dog's ghost
Forum Leader * Expert *
|
|
Join Date: Feb 2001
Location: Celje, Slovenia, Europe
Posts: 2,601
|
|
Quote:
|
3)How do you setup a control array? I've heard about them, but never used them.
|
To do this, place one instance of control on your form (select it, if it has lost focus), press Ctrl+C, click on the form and press Ctrl+V. VB will notify you, that you allready have that control on your form and ask you, if you want to create the Control array. Click Yes. The copy of that control will appear in the upper-left corner of the form. This can be repeated (without the VB's prompt) up to 255 times (I think...)).The original instance of the control will be given Index 0, the first copy will have Index 1, and so on.
Then you can siply refer to the control by selecting its index. Like this (assumming you have control array of ImmageBoxes):
Code:
'Immage1(Index)....
'i.e.:
Immage1(5)...'this will adress the fifth copy (Image number 6) of the imageBox
If you do so, you can then easily loop thru the array with For/Next loop.
|
__________________
Yes, MSDN comes with VB! Yes, you must have at least 25 post to have an avatar! No, you cant write your OS in VB! and NO, YOU CAN NOT DECOMPILE IT!
I'm sure there are things that are more important than me - I just can't thing of any...
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|