Question

jstn2378
02-19-2002, 11:21 PM
I need to know how to keep variables values the same from Ex. Form1 to Form2.
Say in Form1 I need hp(hitpoints) to equal 20 and when Form2 loads up I still need hp to equal 20 from the previous form1. How do I do this?

I know this is probably a really simple thing but i haven't figured it out. Any help is appreciated.

orufet
02-19-2002, 11:36 PM
Declare the variable as:

Public hp As Integer

This will make the variable usable thoughout the project.

wild wolf
02-20-2002, 02:18 AM
yeah declaring it as public makes the variable Global and can be used by other forms, a good programming practice is to use header files or modules....where u can declare all variables and refer to them everytime u wan to use them by using example u want to use variable a and it is declared in another form or module called form1, use form1.a (u can use pointers also to refer to them but that is in C)

jstn2378
02-20-2002, 03:41 PM
thanks for the help

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum