Microsoft tells me today that this VB6.0 bug dates from 1998 !!

a quick note on vb.net ....  VB.NET looks to be real improvement.  But if
you are using VB like I am to automate excel and word, be aware that the VBE
in excel is still VB6.0 .  So you cant write common classes in VB.NET and
use them in your excel VBE code.  You have to wait for Office XP for that.

Steve Richter

-----Original Message-----
From: midrange-l-admin@midrange.com
[mailto:midrange-l-admin@midrange.com]On Behalf Of Steve Richter
Sent: Monday, February 25, 2002 8:18 PM
To: Midrange-L@Midrange.Com
Subject: a VB bug story



I am using Visual Basic more and more in my work.  I highly recommend it to
AS400 pgmrs to broaden their skills and marketability.  But definitely,
buyer beware.  Here is a story of a bug and microsoft's response to it.


A one line description of the bug:
   VB6.0 bug:  a ByRef argument does not set its reference to a class public
property.

A fuller explanation follows. But in as400 speak, it means that when I call
an ILE function with a ByRef parameter and pass a field from a rcdfmt, the
returned ByRef parameter value is dropped, with the caller getting blanks
when it should get a return value. But call the function with a standalone
field and the ByRef parm does return the value correctly.

I call Microsoft tech support using 1 of my 2 free tech support instances.
I email my code, they run it, acknowledge the bug, agree that the bug is
occuring in a core component of VB and tell me I will not be charged for my
call ( decremented ) .  Then they tell me that there is no public
documentation of the bug, that there will not be any in the future and that
the bug will not be fixed in VB6.0 .  ( it is fixed in VB.NET ).

Not only will they not fix the bug, they will not even document it.


Steve Richter



Here is a full description:


In VB you can create a class. At its simplest, you can use a class just like
you use a rcdfmt in rpg. Here is such a simple class:

'The class name is AcDemo1.  So this class code is placed in a class module
( srcmbr )
'the class will contain 2 public properties ( fields )
   Public sName as String
   Public sAddr as String



Now I code a Sub Procedure. ( ile function ).  Arg 2 of the procedure is
passed "ByRef". This is the same as in ILE.  A ByRef argument can receive a
value on the call, and return a value when the Sub Procedure ends.
This procedure will simply return with Arg2 = Arg1.
  Public Sub CopyArg1ToArg2( sValue as string, ByRef sRtnVlu as String )
    sRtnVlu = sValue
  End Sub


Next I code some mainline code that declares an instance of the class and
calls the sub:
  Dim demo1 as New AcDemo1
  Dim sDoesWork as String

  CopyArg1ToArg2( "abc", sDoesWork )
  MsgBox sDoesWork            'this works. sDoesWork = "abc"

  CopyArg1ToArg2( "abc", demo1.sName )
  MsgBox demo1.sName           'does not work. demo1.sName = ""


_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.