Hi, How can I store the value of a variable into another variable that wont be changed unless it meets certain criteria - Thanks

Hi, How can I store the value of a variable into another variable that wont be changed unless it meets certain criteria - Thanks

consider a and b are two variables
the value of a is 5
now let me assign the value for b as
b=a
In the forthcoming statement if the value of 'a' changes,the value of b won't change because on the time of initailization to b the value of a is 5.
If you want to change the value of b when the value of a changes
you can use the reference concept

Hi, How can I store the value of a variable into another variable that wont be changed unless it meets certain criteria - Thanks

Have you not been introduced to If-Then-Else blocks?

If (Condition) Then
   Do Something
Else 'Optional
   Do SomethingElse
End If
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.