You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Blue Blazes

Beginner

  • "Blue Blazes" started this thread

Posts: 15

Date of registration: Aug 14th 2009

  • Send private message

1

Saturday, August 22nd 2009, 9:04pm

Passing parameters via Call statement in VB6

Hello, please comment on this situation.
Here is an example of a routine:


Public Sub cmdTest_Click()
Dim X As String, Y As String

X="X": Y="Y"

Msgbox X & Y '-----> XY
Call MyRoutine(X, Y)
MsgBox X & Y '-----> XY why??????????
End Sub


Public Sub MyRoutine (X As String, Y As String)
Y=X

MsgBox X & Y '-----> XX
End Sub


This example works in many VB6 programs. What to do?
Thank you.

OlimilO

Intermediate

  • "OlimilO" is male

Posts: 277

Date of registration: Jan 18th 2009

Location: Germany

Occupation: software engineer

  • Send private message

2

Saturday, August 22nd 2009, 9:12pm

Hi Blue Blazes,



maybe reading this could be helpful for you: :)



ByRef in VB and in Jabaco



Concerning ByRef strings please do not use "String" use StringBuilder or StringBuffer instead.

Or simply return the String from a Function.



regards

OlimilO

Blue Blazes

Beginner

  • "Blue Blazes" started this thread

Posts: 15

Date of registration: Aug 14th 2009

  • Send private message

3

Saturday, August 22nd 2009, 11:58pm

Many thanks to you, OlimilO, for the deeper explanation of a number of concepts. For example, ByRef/ByVal, StringBuilder/StringBuffer.

Many businesses and persons have libraries full of vintage as well as recently written VB6 programs. The hopes and wishes of these folks is to convert these programs "seamlessly" or with as few code "touches" as possible. Certainly, the learning curve associated with mastering a new language or technology (for a staff trained in VB6) is to be minimized or avoided. A big concern is the percentage of conversion effort that must be manual in nature. The greater this effort, the greater the cost in money and time, and the lower the probability of success in a given time frame. Basics like string manipulation, subroutine arguments, non-database I/O, etc. are performed often and very simply in VB6 programs. The natural hope is that these basic functions could/would be converted automatically, or with as little syntax change (as opposed to mastering fundamental technological differences) as possible. I hope these ideas are helpful to Jabaco.

turkulainen

Beginner

  • "turkulainen" is male

Posts: 20

Date of registration: Jun 30th 2009

Location: Turku, Finland

Occupation: engineer

  • Send private message

4

Saturday, August 29th 2009, 3:55pm

I agree with this. The big attraction of Jabaco is that most of VB6 stuff does not have to be changed. But if all the VB6 syntax could be accepted, more people will be interested in converting more and bigger programs to Jabaco. I realise that Jabaco is built on completely object oriented .Net -like framework. People are today able to get VB Express 2008 do the conversion from VB6 with equal ease. It is therefore highly desirable that Jabaco provides slightly more value in terms of syntax compatibility for at least the commonly used syntax (file operations, simple drawing, type declarations, etc.). This in my opinion will make Jabaco more attractive than the alternatives where syntax is different but an automatic procedure can change most of it.
Many thanks to you, OlimilO, for the deeper explanation of a number of concepts. For example, ByRef/ByVal, StringBuilder/StringBuffer.

Many businesses and persons have libraries full of vintage as well as recently written VB6 programs. The hopes and wishes of these folks is to convert these programs "seamlessly" or with as few code "touches" as possible. Certainly, the learning curve associated with mastering a new language or technology (for a staff trained in VB6) is to be minimized or avoided. A big concern is the percentage of conversion effort that must be manual in nature. The greater this effort, the greater the cost in money and time, and the lower the probability of success in a given time frame. Basics like string manipulation, subroutine arguments, non-database I/O, etc. are performed often and very simply in VB6 programs. The natural hope is that these basic functions could/would be converted automatically, or with as little syntax change (as opposed to mastering fundamental technological differences) as possible. I hope these ideas are helpful to Jabaco.

Rate this thread
WoltLab Burning Board