Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > View my program please


Reply
 
Thread Tools Display Modes
  #1  
Old 10-05-2002, 11:36 PM
ghost51423
Guest
 
Posts: n/a
Talking 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.
Reply With Quote
  #2  
Old 10-06-2002, 12:01 AM
Robby's Avatar
Robby Robby is offline
Code Factory

Retired Moderator
* Expert *
 
Join Date: Jan 2001
Location: Montreal, Ca.
Posts: 5,565
Default

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.
__________________
Visit...Bassic Software
Reply With Quote
  #3  
Old 10-06-2002, 01:29 AM
ayoung ayoung is offline
Contributor
 
Join Date: Sep 2002
Location: Michigan
Posts: 623
Default

Heh..

Well ill test it once yor RE-post it.

Adam
Reply With Quote
  #4  
Old 10-06-2002, 12:03 PM
ghost51423
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #5  
Old 10-06-2002, 12:23 PM
ghost51423
Guest
 
Posts: n/a
Default

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.
Attached Files
File Type: frm frmblackjack.frm (99.8 KB, 7 views)
Reply With Quote
  #6  
Old 10-06-2002, 01:25 PM
UncleSam's Avatar
UncleSam UncleSam is offline
Contributor
 
Join Date: Jun 2002
Location: Switzerland
Posts: 560
Default

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
Reply With Quote
  #7  
Old 10-06-2002, 01:30 PM
Ales Zigon's Avatar
Ales Zigon Ales Zigon is offline
Dead dog's ghost

Forum Leader
* Expert *
 
Join Date: Feb 2001
Location: Celje, Slovenia, Europe
Posts: 2,601
Default

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...
Reply With Quote
  #8  
Old 10-06-2002, 02:42 PM
ghost51423
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #9  
Old 10-06-2002, 03:38 PM
ghost51423
Guest
 
Posts: n/a
Default

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.
Attached Files
File Type: zip cards.zip (203.9 KB, 7 views)
Reply With Quote
  #10  
Old 10-06-2002, 04:35 PM
Banjo's Avatar
Banjo Banjo is offline
Hell's Angel

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Yorkshire, UK
Posts: 10,394
Default

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"
Reply With Quote
  #11  
Old 10-06-2002, 04:58 PM
ghost51423
Guest
 
Posts: n/a
Default

Okay, but one question. How do you do an array?
Reply With Quote
  #12  
Old 10-06-2002, 05:54 PM
AutoCOL's Avatar
AutoCOL AutoCOL is offline
Centurion
 
Join Date: Sep 2002
Location: australia
Posts: 155
Default

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.
Reply With Quote
  #13  
Old 10-07-2002, 12:45 AM
Ales Zigon's Avatar
Ales Zigon Ales Zigon is offline
Dead dog's ghost

Forum Leader
* Expert *
 
Join Date: Feb 2001
Location: Celje, Slovenia, Europe
Posts: 2,601
Default

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...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->