Qbasicnews.com

Full Version: Visual Basic....Basic questions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ok, I programmed a few data masterfile programs in pds7.1 (Teamid , teamname, car1, car2 are the fields for a random file teammstr) . Now I thought that I would play with vb 5.0 and try to program the same programs. Please let me know if I am on the right track. I created the forms. Do you declare your type staments in a module? How do you pass variable values between the subroutines?? I take it you can not use the share statement. If this is not the proper site to ask VB questions, please let me know of a site that will be helpful, becase I'm sure that there will be plenty more questions.
If you go with 1 question at a time I will be glad to help you Smile Next time on the "general programming" section.

1. Yeah, type statements can be declared anywhere, but it is more tidy to make them all in a module.

2. To pass values to SUB and FUNCTIONs you use parameters... what am I missing? Everything you declare as "PRIVATE" or "PUBLIC" outside functions and sub in a module is a shared variable in that module. PRIVATE ones are only visible in the module, and PUBLIC ones can be used from outside using the moudle name, a dot, and the variable name, for example, in MODULE1.BAS called "Module1" you can have this:

PUBLIC data1 AS INTEGER
PRIVATE data2 AS INTEGER

Both variables can be accessed from any SUB and FUNCTION in the module, plus data1 can be accessed also from outside just writing module1.data1.