try-catch question

G

Guest

hi, i was wondering if it was possible to catch a change in a variable...for
instance

Private x as integer

try
''code here that user changes X variable

catch x as integer

''do code here if x becomes an integer

catch x as string

''do other stuff if x is a string

end try

thanks
 
H

Herfried K. Wagner [MVP]

iwdu15 said:
hi, i was wondering if it was possible to catch a change in a
variable...for
instance

Private x as integer

try
''code here that user changes X variable

catch x as integer

''do code here if x becomes an integer

catch x as string

''do other stuff if x is a string

end try


No, that's not possible. I suggest to enable 'Option Strict' (add 'Option
Strict On' on top of the file) which will prevent you from assigning a
variable of type 'Object' to a variable of type 'Integer', for example.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top