|
-
Feb 22nd, 2000, 01:11 AM
#1
Thread Starter
Junior Member
if the energy is 100 and then you defeat a enemy then you get more energy but how do i get the new energy in an other form.
-
Feb 22nd, 2000, 05:34 AM
#2
New Member
Say your original energy is the value in lable1 on form1. After defeating the enemy, your form1.visible = false, and form2.visible = true. On form2 you have another label1 for the new energy level. Here is how I would do it:
'new energy label
'x = the desired increasing amount
label1.caption = val(form1.label1 + x)
-
Feb 22nd, 2000, 03:55 PM
#3
PowerPoster
Well, this will work but it's a very stupid way.
Add a module where you can declare global vars so you can use them on each form.
-
'In module
Global A as Long
'In any form
A = 10
'In another form
Caption = A
-
-
Mar 1st, 2000, 10:15 AM
#4
New Member
Use Global
Go to a module and say:
Global energy as integer
then your variable will work in every form.
Easy as pie
-
Mar 1st, 2000, 07:19 PM
#5
New Member
Private Sub Form2_Load()
lblENG.Caption = Form1.lblENG.Caption
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|