Solved

question

Posted on 1998-12-22
9
247 Views
Last Modified: 2010-05-03
Suppose you have reference to muclass
could folloving code run and if then what  
Msgbox will display
Sub MySub(argObject as MyClass)

On Error Resume Next
Dim MyObject as New MyClass
Err.Clear
Set MyObject = argObject
argObject.Value = 100
Set argObject = Nothing
MsgBox MyObject.Value & "/" & Err.Description
End Sub

0
Comment
Question by:mativare
  • 6
  • 2
9 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1452088
No, code is not correct.
- err.clear will clear the description
- new is useless
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1452089
Your code is the same as this
Sub MySub(argObject as MyClass)
  argObject.Value = 100
End Sub

0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1452090
You probably meant this

Sub MySub(argObject as MyClass)
  On Error goto leave
  Set argObject  = new MyClass
  argObject.Value = 100
  exit sub
leave:
  MsgBox Err.Description
End Sub

0
 
LVL 1

Author Comment

by:mativare
ID: 1452091
No
Try to use only my code
I got it from so-called VB WWW tests.
Try to give a answer what messagebox will display
you are probably right that code is not right
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 13

Expert Comment

by:Mirkwood
ID: 1452092
It will display the old value of the argobject \

0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1452093
100\
0
 
LVL 1

Author Comment

by:mativare
ID: 1452094
Are you sure
Notice
Set MyObject = argObject
argObject.Value = 100
so argobject gets value after
are you sure
Set MyObject = argObject sets value of Myobject too automatically
it is confusing to me
can answer be     0\      ????

0
 
LVL 1

Accepted Solution

by:
mathies earned 50 total points
ID: 1452095
100/
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1452096
Tell me what you want to know
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now