Forums

Forums (http://www.abandonia.com/vbullet/index.php)
-   Tech Corner (http://www.abandonia.com/vbullet/forumdisplay.php?f=23)
-   -   Vb6 (http://www.abandonia.com/vbullet/showthread.php?t=1771)

Yamcha 17-12-2004 09:07 AM

I just received it. First I tought It was great and then I saw that here is only the lesson DIsk without the program :ranting: :ranting: :cry:

And Is VB6 a good language for your first time?

Kon-Tiki 17-12-2004 01:29 PM

They teach it as a starting language, along with Java. There're enough basic tutorials for VB, and if you're stuck, I'd be happy to help out (more practice for me, too, then :ok: )

Rogue 17-12-2004 01:40 PM

If I'm right, you don't have a VB but some tutorials. :) I had somewhere student version of VB (got it with the book). It does not have all features of full product.

But again, you should get VB.NET.

Yamcha 17-12-2004 01:56 PM

Quote:

Originally posted by Anubis@Dec 17 2004, 04:40 PM
If I'm right, you don't have a VB but some tutorials. :) I had somewhere student version of VB (got it with the book). It does not have all features of full product.

But again, you should get VB.NET.

Yes I've beem fooled. I asked my father if there is a CD and it was there. The problem was that the Cd contained only the tutorials and not the Program :cry:

Rogue 17-12-2004 02:01 PM

:(

I can check if I got that student version still around. Only thing you have to agree when you install it that you will not make comercial stuff with it, and that you will use it for educational purpose.

VB.net standard or academic is not that expensive around here.

Yamcha 17-12-2004 02:02 PM

Quote:

Originally posted by Anubis@Dec 17 2004, 05:01 PM
:(

I can check if I got that student version still around. Only thing you have to agree when you install it that you will not make comercial stuff with it, and that you will use it for educational purpose.

VB.net standard or academic is not that expensive around here.

No i got a friend who buied the Full version ill just ask him

Rogue 17-12-2004 02:07 PM

That's even better. :ok:

Have a fun. :bye:

It might be nice if you post your progress here.

Yamcha 17-12-2004 02:35 PM

Quote:

Originally posted by Anubis@Dec 17 2004, 05:07 PM
That's even better. :ok:

Have a fun. :bye:

It might be nice if you post your progress here.

Yes but first the vacances must be over so i can get it or ill just buy it

Omuletzu 17-12-2004 02:47 PM

Quote:

Originally posted by yamcha565656@Dec 17 2004, 12:07 PM

And Is VB6 a good language for your first time?

As i understand it it's the easiest to learn and use among the powerful programming programs.
I learned the basics quickly, but i got bored with the complicated(advanced) stuff

Kon-Tiki 17-12-2004 03:23 PM

And I'm still trying to figure out how to do animations, for the Tamagotchi I'm working on in there :D

Omuletzu 17-12-2004 03:25 PM

Yea i also encountered this problem:
How do you make animations animate during a VB program???

Kon-Tiki 17-12-2004 03:30 PM

I got to the point of using the gdi library and bitblt function, but I still don't see how to use that one for animations.

Koen 17-12-2004 04:30 PM

I'm busy writing a rpg in VB6 using the DirectX 8 libraries. I'll post a link when I have it on my site.

.EDIT.

Download it here:

http://vbstuff.siteburg.com/index.php?acti...d&file=yrpg.zip

Koen 17-12-2004 05:08 PM

BTW making games with the DX8 SDK is much more faster than bitblt and stuff.

Kon-Tiki 17-12-2004 05:27 PM

Yeah, but everybody who uses it would need to have DX8 or higher :D

Koen 18-12-2004 11:35 AM

Quote:

Originally posted by Kon-Tiki@Dec 17 2004, 06:27 PM
Yeah, but everybody who uses it would need to have DX8 or higher :D
You can do it with DX7 too... But you'll have less effects then if you want to program 3D apps. (For DirectDraw, you can even use DX3, and that's on every windows computer...)

btw, DX9 is impossible in VB6. It's only possible in VB.NET

Kon-Tiki 18-12-2004 02:30 PM

Well, what I want to do, is animate a Tamagotchi. Not so much 3D in there, so got no need for 3D animation.

Koen 18-12-2004 05:09 PM

Quote:

Originally posted by Kon-Tiki@Dec 18 2004, 03:30 PM
Well, what I want to do, is animate a Tamagotchi. Not so much 3D in there, so got no need for 3D animation.
LOL :D

I once made a tamagotchi-like program in quick basic... :P

It's not too hard to make that using the DX7 SDK, if you have a bit of VB6 knowledge.

Kon-Tiki 18-12-2004 05:13 PM

Indeed. Only two problems I see: The animation and saving the critter to a file, so you don't have to start all over every time you close it (and which could allow more than one pet)

Koen 18-12-2004 10:45 PM

Quote:

Originally posted by Kon-Tiki@Dec 18 2004, 06:13 PM
Indeed. Only two problems I see: The animation and saving the critter to a file, so you don't have to start all over every time you close it (and which could allow more than one pet)
Well, you could put all animation graphics in one file, but you need some knowledge of binary writing for that. For my RPG, for example, I put all graphics of the player in one .CHR file. In-game, I let it unpack to a temporary directory (this all works very fast). It's like zipping/unzipping without compression...

Animation is not too hard. You let the program load all animation frames at the start in buffers, and animating the thing isn't that hard anymore after that.

I can make a little program of my RPG char walking on screen if you want using DX7. Maybe you can use it.

Kon-Tiki 18-12-2004 11:00 PM

Doesn't hurt to learn it, so go ahead, although DirectX for a Tamagotchi...

Yamcha 19-12-2004 09:10 AM

Yey I got thnx Tiki :kosta: :kosta: :kosta: :kosta: :kosta:

Yamcha 21-12-2004 10:58 AM

I got my first lucky seven :bannana: :bannana: with some modifications :angel:

Kon-Tiki 21-12-2004 05:29 PM

What's your lucky seven?

Yamcha 25-12-2004 11:04 AM

The normal but I just added my name and avatar :D Anyway this VB programing looks very :sick: I mean that the program is cool but the graphics :not_ok: Is there anyway to boost them up? :help:

Kon-Tiki 25-12-2004 02:05 PM

The buttons and such? In their properties, set the mode to Graphical, then load a picture in them. To change the picture, use this:

Code:

Buttonname.picture = loadpicture("newpic.jpg")

Yamcha 25-12-2004 04:16 PM

Where is the mode oprion?

Kon-Tiki 25-12-2004 04:45 PM

If you put the properties as Categorized, it's under Appearance, at the option: "Style"

Yamcha 25-12-2004 05:10 PM

OK...lets try it

No its not. In the Picture line I put the file then i change the style
In the code i change the name of the file and still nothing.
Only the button is white and the text is down

Yamcha 25-12-2004 05:24 PM

Wait i got it wrong. If im right this will change my button after I click. the thing I need is that my button looks in another way when he's stopped. Or change his form. I mean not to be the rectangle but the form i want or if this is posiblle that the form is a picture that i made.

Kon-Tiki 25-12-2004 06:10 PM

Ehmm... Koen? :whistle:

Yamcha 25-12-2004 06:38 PM

Or maybe I should finish the to step by step books and then asking questions :huh:

Btw
Tiki, which book you used?

Kon-Tiki 25-12-2004 09:25 PM

Three or four tutorials, to learn the syntax. No real good ones. One went waaaaaaaaaaay too slow, the other finally got me to the coding part after 'bout five chapters on how to make the form (which I skipped, as it's point'n click and reading whatever the tags say :D )

Koen 26-12-2004 10:48 AM

Quote:

Originally posted by Kon-Tiki@Dec 25 2004, 07:10 PM
Ehmm... Koen? :whistle:
Yeah sorry. I finally got holiday now, and between christmas and new year's day I'll do it... :tomato:

Koen 29-12-2004 06:08 PM

Ok here it is! Learn from it, and tell me if it works...

BTW, there is a way to draw all this in a window, but I don't know how, because I've only been making full-screen apps with directdraw...

Also try searching for SnowEngine. It's an DX engine for VB6!

twisted-mystic 29-12-2004 06:24 PM

What would you suggest for anyting 2D in DX9 since dd is gone? Good, low level tutorials for managed dx seem to be hard to come by.

Kon-Tiki 29-12-2004 07:03 PM

Oy, didn't know VB was so flexible as to allow structs. This opens whole new dimensions :D The DD specific things're still a bit unclear though. Should experiment with it, and find some tutorial on it, I guess.

Koen 30-12-2004 04:40 PM

Quote:

Originally posted by Kon-Tiki@Dec 29 2004, 08:03 PM
Oy, didn't know VB was so flexible as to allow structs. This opens whole new dimensions :D The DD specific things're still a bit unclear though. Should experiment with it, and find some tutorial on it, I guess.
Visual Basic can be very complex if you want, but is so very much slower than other languages if you use complex language... :cry:

Kon-Tiki 30-12-2004 04:52 PM

Slower than Java? :bleh:

twisted-mystic 30-12-2004 06:39 PM

If you move to .net you'll find that VB.NET is as fast as C# wich is "Almost" as quick as C++

Rogue 30-12-2004 07:14 PM

Quote:

Originally posted by Kon-Tiki@Dec 30 2004, 12:52 PM
Slower than Java? :bleh:
Compatibility on multiple systems comes with some cost. :crazy:

Kon-Tiki 30-12-2004 07:21 PM

The slowness is too noticable. You know that Java-assignment I had a couple of weeks ago, right? The one that was kinda a complicated Sokoban... well, just moving was lagging from time to time.

Koen 30-12-2004 08:07 PM

Quote:

Originally posted by twisted-mystic@Dec 30 2004, 07:39 PM
If you move to .net you'll find that VB.NET is as fast as C# wich is "Almost" as quick as C++
I have vb.net already, but I didn't like the fact that the whole vb language was #*$% up... Maybe I should try programming in vb.net...

twisted-mystic 30-12-2004 09:14 PM

Quote:

Originally posted by Koen+Dec 30 2004, 09:07 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (Koen @ Dec 30 2004, 09:07 PM)</td></tr><tr><td id='QUOTE'> <!--QuoteBegin-twisted-mystic@Dec 30 2004, 07:39 PM
If you move to .net you'll find that VB.NET is as fast as C# wich is "Almost" as quick as C++
I have vb.net already, but I didn't like the fact that the whole vb language was #*$% up... Maybe I should try programming in vb.net... [/b][/quote]
Well it depends on how you feel it was #*$% up'ed. It's moved to a more object oriented design without loosing "Much" of the syntax. And, eventhough i know people will say it's not, it is cross platform compatable, if your making web apps or the like. The mono project has done a great deal in bringing .net to the linux platform, they just have'nt moved any of the Windows.Form namespaces.

Koen 04-01-2005 09:15 PM

I reinstalled vs.net 2003 now, and my harddisk is full! :cry: Why can't they keep it small... :crazy:

twisted-mystic 04-01-2005 09:32 PM

You've got to have the latest and greatest bells and whistles!! :D

Koen 04-01-2005 09:59 PM

Quote:

Originally posted by twisted-mystic@Jan 4 2005, 11:32 PM
You've got to have the latest and greatest bells and whistles!!* :D
Then just ring the bells from a distance... Let me download what I NEED... :cry:

Yamcha 07-01-2005 12:55 PM

Can some1 plz help me with this. Is the first program that I made from the book. The lucky seven. I just wanted to add something, so when one of the numbers is 7 and the sum of the three numbers is bigger than 15 the message shows.
Code:

Private Sub Command1_Click()
Dim First, Second, Third

First = Val(Label1.Caption)

Second = Val(Label2.Caption)

Third = Val(Label3.Caption)

Image1.Visible = False * * * * *'скриване на монетите
Label1.Caption = Int(Rnd * 10) *'избиране на числа
Label2.Caption = Int(Rnd * 10)
Label3.Caption = Int(Rnd * 10)
'ако някое от заглавията е 7 показваме монетите
'и издаваме звук
If (Label1.Caption = 7) Or (Label2.Caption = 7) _
 *Or (Label3.Caption = 7) Then
 * *Image1.Visible = True
 * *Beep
 * *End If
If (Label1.Caption = 7) Or (Label2.Caption = 7) _
 *Or (Label3.Caption = 7) And First + Second + Third >= 15 Then
 * *Label5.Visible = True
 * *Label5.Caption = "What A CHANCE!!!"
 *Else
 * *Label5.Visible = False
 * *End If
End Sub

the problem is that once the message shows but not every time. Sometimes it shows even if the sum of 3 numbers is less than 15 :help:

Tuttle 07-01-2005 01:47 PM

The problem is the location of:
Code:

First = Val(Label1.Caption)
Second = Val(Label2.Caption)
Third = Val(Label3.Caption)

By putting that at the top of the sub, you're setting those three variables to whatever the labels are before you generate the new values. That means down the bottom when you display the message box you're actually testing to see if both of the following are true:
  • One of the three numbers generated this time is a 7; and
  • The sum of the three numbers that were in the labels before you pressed the button is at least 15.
To fix that, you need to move those three assignment statements to below the lines where you set the labels to random numbers, ie:
Code:

Label1.Caption = Int(Rnd * 10)
Label2.Caption = Int(Rnd * 10)
Label3.Caption = Int(Rnd * 10)
First = Val(Label1.Caption)
Second = Val(Label2.Caption)
Third = Val(Label3.Caption)


Kon-Tiki 07-01-2005 01:49 PM

As I see it, the values of First, Second and Third are set to the values of Label1.caption, Label2.caption and Label3.caption from the last time it ran. Can't be sure without seeing the function Val() though, although my bet is that that's the problem. Besides, you don't really need to add that ;) If you're already using with the caption-properties as variables (which I don't really recommend in bigger projects), you can keep using them for the counting up :ok:

A few tips on improving that code...
You can put the checking for 15 as an extra if-block within the if-block that checks for a 7.

Try to put the End If on the same indention as the If... like this:
Code:

If (x = 5) Then
 * // Code
End If

It greatly enhances readability for both you and those who read the code after you... or for you when you reread the code in a few months or so.

Yamcha 07-01-2005 03:55 PM

@tuttle
That help a little bit, Thanks :ok:

@Kon Tiki
Yes I know that this isnt nescesery to add, but I just wanted to be more functional. But there is still a problem: ex: the results are 7 0 4 and I still get the message. I dont understand the separation. I mean I want that if one of the numbers is 7 and the sum of the 3 is more or = to 15 the message shows. By separating I think that this will became two different functions.
1 if 1 number is 7 the message shows
2 if the sum is >= 15 the message shows too
My goal is to combine those too things.

Danny252 07-01-2005 04:13 PM

being only experienced in some java and wbasic, I can understand this and my probably useless idea is(excuse the commands in captials, thats Qbaisc for you):
Code:

If (Label1.Caption = 7) Or (Label2.Caption = 7) _
 Or (Label3.Caption = 7) THEN
 * * IF First + Second + Third => 15 THEN
 * * * * * * *Label5.Visible = True
 * * * * * * *Label5.Caption = "What A CHANCE!!!"
 * * Else
 * * * * * * *Label5.Visible = False
 * * End If
 End If

Hope that helps. also >= might be affecting it. I always thought it used => in these things. but oh well ;)

Kon-Tiki 07-01-2005 04:40 PM

Danny's suggestion's pretty damn useful. If it's not because of it, then at least for readability. The => won't work, though. It's >= for sure. As for combining the two ifs into one block... Danny's got the idea right, and the code too (except for the =>), although I'd put the First + Second + Third between brackets too.

Yamcha 07-01-2005 04:56 PM

Danny forgot the End if and if i put this it will separate the actions - the think i dont want

Kon-Tiki 07-01-2005 05:06 PM

Nope, two If statements and two End Ifs... on the right spots.

Yamcha 07-01-2005 05:14 PM

oops havent saw

Edit:still some carzy results. 7 0 3 and i get the message :blink:

Danny252 07-01-2005 05:18 PM

well, it is a descendent of basic.. but still, wow, I did something useful outside of school for once!

Kon-Tiki 07-01-2005 05:25 PM

Yamcha, could you post your full code here? Well, the code you have now.

Yamcha 07-01-2005 05:29 PM

I think that I muist remove something but im not sure what :help:
Code:

Private Sub Command1_Click()
Dim First, Second, Third

First = Val(Label1.Caption)

Second = Val(Label2.Caption)

Third = Val(Label3.Caption)

Image1.Visible = False * * * * *'скриване на монетите
Label1.Caption = Int(Rnd * 10) *'избиране на числа
Label2.Caption = Int(Rnd * 10)
Label3.Caption = Int(Rnd * 10)
'ако някое от заглавията е 7 показваме монетите
'и издаваме звук
If (Label1.Caption = 7) Or (Label2.Caption = 7) _
 *Or (Label3.Caption = 7) Then
 * *Image1.Visible = True
 * *Beep
 * *End If
If (Label1.Caption = 7) Or (Label2.Caption = 7) _
Or (Label3.Caption = 7) Then
 * *If First + Second + Third >= 15 Then
 * * * *Label5.Visible = True
 * * * *Label5.Caption = "What A CHANCE!!!"
 * *Else
 * * * *Label5.Visible = False
 * *End If
 * *End If
End Sub


Kon-Tiki 07-01-2005 05:42 PM

Nope, nothing needs to be removed, just moved. As we said in the beginning, the position of
First = Val(Label1.Caption)
Second = Val(Label2.Caption)
Third = Val(Label3.Caption)
makes them take on the value of Label*.Caption from the last time it ran. Put those three lines under the randomizing of the value of Label*.Caption and it'll work fine :ok:

Yamcha 07-01-2005 06:09 PM

The mistake was that i havent saved the think. And when i strarted again the thinks were like this :D Now it must work :D


The current time is 10:26 AM (GMT)

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.