Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proper usage of Using
Message
From
22/07/2015 09:03:34
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Proper usage of Using
Environment versions
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01622368
Message ID:
01622368
Views:
40
I have a Using support in the code like this:
                    ' Create the object
                    Using loSOAPSVC = New Framework.SOAPSVC(oApp)
For tracing purposes, I am doing this temporarily:
                    oApp.AddError("1")
                    Continue For

                    ' Create the object
                    Using loSOAPSVC = New Framework.SOAPSVC(oApp)
This works.

However, if I do this:
                    ' Create the object
                    Using loSOAPSVC = New Framework.SOAPSVC(oApp)

                        oApp.AddError("1")
                        Continue For
After the Continue For is executed, I have:

"Object reference not set to an instance of an object."

Something seems to be stuck in memory because the Continue For is inside the Using. Anyone can explain this?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform