Link to home
Start Free TrialLog in
Avatar of JDL129
JDL129

asked on

I need help converting VB6 code to .Net

Hi All,

Please help with converting the attached vb6 code to .net.

Thanks in advance,

Jerry
DefInt A-Z
Option Explicit
 
Global PPath$                                   'program path
 
Global CancelFlag As Boolean
Global Const CCSetup_Reclen = 99
 
'Credit Card company setup
Type CCcompanyType
    Company As String * 2
    Path As String * 30
    TID As String * 32
End Type
Global CCcompany As CCcompanyType
 
'Debit Card file structure
Type DCtype
    Company As Integer
    TID As String * 32
    Phone1 As String * 20
    Phone2 As String * 20
    'fdf 3/1/2001 added..begin
    WorkingKey As String * 16
    Processor As String * 4
    Default As String * 1
    MasterKey As String * 1
    KeyManagement As String * 1
    SerialNumber As String * 16
    Blank As String * 15
    'fdf 3/1/2001 added..end
'    Blank As String * 54
End Type
Global DC As DCtype
 
'Check Services company setup
Type CHKcompanyType
    Company As String * 2
    SiteID As String * 32
    Service As String * 2
    Blank As String * 28
End Type
Global CHKcompany As CHKcompanyType
 
'fdf 2/19/2001 added..begin
'Debit Card file structure
Type GCtype
    'Company As Integer
    Company As String * 1
    TID As String * 32
    Phone1 As String * 20
    Phone2 As String * 20
    Blank As String * 54
End Type
Global GC As GCtype
'fdf 2/19/2001 added..end
 
'general program constants
Global CR$
Global LF$
 
Global Action As String

Open in new window

Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

DefInt does not exist anymore.

Do you really have to use Fixed-Lenght strings? .Net does not really support them.
Perhaps it's easier to tell what you exactly want.
As far as I see it, you just can create a class (a small very easy example below)
Public Class CCcompanyType
    Public Company As String
    Public Path As String
    Public TID As String
 
End Class

Open in new window

Avatar of JDL129
JDL129

ASKER

Thank you both for the responses!!
Dhaest!!
This is a class from vb6 that is used to process information to send to credit card companies.  I am a VERY newbie in .Net but am making some headway learning a new language and need this snippet changed to run in .Net.

So you can just replace 'Type' with 'Class'?  With I tried to run the in .Net the error said that 'Type' had been replaced with 'Structure'.

Can I use the following?
Public Company As String * 2

How would you dimension the 'Global's'

Thanks Again,

Jerry



>> Public Company As String * 2

As explained by emoreau, .net doesn't really support it

How to declare global Variables in VB.NET and C#?
http://smartypeeps.blogspot.com/2006/06/how-to-declare-global-variables-in.html

Structures
http://www.startvbdotnet.com/oop/structure.aspx

I wouldn't recommand just trying to translate your program from vb6 into vb.net, but just reprogramme the complete application
Avatar of JDL129

ASKER

Dhaest!!

Any ideas how to handle the * values?

Thanks,

Jerry
PS:  I am in the middle of reprogramming
SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial