Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

question

Posted on 1998-12-22
9
272 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
vb6 programatically bring window to front 8 75
Using "ScreenUpdating" 6 73
how to know if my Checkbox is True in VB6.0? 9 60
Advice in Xamarin 21 96
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…

840 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