Global Variables

• (2 Pages)
• 1
• 2

17 Replies - 200178 Views - Last Post: 25 August 2007 - 09:53 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=10415&amp;s=1de74f3caf08c57cab607cb94edc39a6&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

#16 zakary

• D.I.C Regular

Reputation: 27
• Posts: 427
• Joined: 15-February 05

Re: Global Variables

Posted 21 February 2005 - 09:29 AM

Thanks guys the private num As Integer = 0 works the way I wanted it

Thanks agian

This post has been edited by zakary: 03 March 2005 - 12:15 PM

#17 Roa_09

Reputation: 0
• Posts: 1
• Joined: 25-August 07

Re: Global Variables

Posted 25 August 2007 - 09:38 PM

BlackJesus, on 19 Feb, 2005 - 01:01 PM, said:

well he could set the value when the form loads...i dont know a lot about modules, but couldnt you declare it somewhere in there? what else is you program supposed to do besides count the number of clicks?

i have a problem regarding th eprogram im doing..
i have 5 forms of question
and 1 form of the result

code:

Opiton Explicit
Public A as Integer

_btn2 click()_

A = A+0
(+0 kc mali ung sagot na yan kya as is lng..)

Dim I as Integer

I = MsgBox ("Sure kng?", vbYesNo or vbQuestion)

If I = vbYes

Form2.show
Form1.hide

ElseIf I = vbNo

Form1.show

End If

End Sub

_btn 1 click_

A = A+1
(+1 because this buton carries the correct answer)

Dim I as Integer

I = MsgBox ("Sure kng?", vbYesNo or vbQuestion)

If I = vbYes

Form2.show
Form1.hide

ElseIf I = vbNo

Form1.show

End If

End Sub

A = +0
(because this is not the correct button of answer)

this the form 6 for the result:

(this form contains 1txtbox and a button)

Optin Explicit
Public A as Integer

_btn1Result click_

text1.text = Form1.A + Form2.A --etc..

my problem is every time i click the btnResult it gets the value of all A in all 5 forms,.

how can i get the value of A that ic click?

#18 PsychoCoder

Reputation: 1659
• Posts: 19,853
• Joined: 26-July 07

Re: Global Variables

Posted 25 August 2007 - 09:53 PM

Roa_09, on 25 Aug, 2007 - 09:38 PM, said:

my problem is every time i click the btnResult it gets the value of all A in all 5 forms,.

how can i get the value of A that ic click?

Before I offer any help you need to put that code into code blocks (the button with the # in the toolbar).

This post has been edited by PsychoCoder: 25 August 2007 - 09:53 PM