VB6 to .Net conversion (FixedLengthString = ArraysHelper.InitializeArray)
-
06 Ağustos 2012 Pazartesi 10:52
am newbie to this programming segment
i am just trying to change the below from VB6 VB.Net
Dim TxnDate() As FixedLengthString = ArraysHelper.InitializeArray(Of FixedLengthString())(New Integer() {11}, New Object() {6})
Can somebody guide me how to do this.
Tüm Yanıtlar
-
06 Ağustos 2012 Pazartesi 11:25You can read this link http://msdn.microsoft.com/en-gb/library/aa480541.aspx#vb6tovbnetupgrade_relatedtitles and download this guide (Upgrading Visual Basic 6.0 Applications to Visual Basic .NET and Visual Basic 2005) at this link http://www.microsoft.com/en-us/download/details.aspx?id=13232 although somebody will probably be on here in awhile that knows how to do it.
You've taught me everything I know but not everything you know.
- Düzenleyen Mr. MonkeyboyMicrosoft Community Contributor 06 Ağustos 2012 Pazartesi 11:30
-
06 Ağustos 2012 Pazartesi 11:49
am newbie to this programming segment
i am just trying to change the below from VB6 VB.Net
Dim TxnDate() As FixedLengthString = ArraysHelper.InitializeArray(Of FixedLengthString())(New Integer() {11}, New Object() {6})
Can somebody guide me how to do this.
Hi,
Not sure what the 11 and the 6 refer to here.
I am guessing that you want a 6 character DATE as a string such as 251212 ( for Christmas Day ) or as ( 122512 ).
Anyway I also presume you want 12 items in the array from indexes 0 to 11.
'
Nearest I can come up with is this.>>
Public Class Form1 Public Structure TxDate <VBFixedString(6)> Public value As String End Structure Dim TxnDate(11) As TxDate End Class
Regards,

Click this link to see the NEW way of how to insert a picture into a forum post.
Installing VB6 on Windows 7
App Hub for Windows Phone & XBOX 360 developers.
- Düzenleyen John Anthony Oliver 06 Ağustos 2012 Pazartesi 11:50
- Düzenleyen John Anthony Oliver 06 Ağustos 2012 Pazartesi 11:51
- Düzenleyen John Anthony Oliver 06 Ağustos 2012 Pazartesi 11:53
- Yanıt Olarak İşaretleyen venkat_330 06 Ağustos 2012 Pazartesi 12:18
-
06 Ağustos 2012 Pazartesi 11:56
Hi again,
You may find it easier to use a DATE for each array element and then format the output of each date stored in the array to just show
Date / Month / Year
or
Month / Date / Year
where appropriate in your code. :)
Public Class Form1 Dim TxnDate(11) As Date End Class
Regards,
Click this link to see the NEW way of how to insert a picture into a forum post.
Installing VB6 on Windows 7
App Hub for Windows Phone & XBOX 360 developers.
-
06 Ağustos 2012 Pazartesi 12:24You need to find what this ArraysHelper object is, and what the InitializeArray method of that object does. It seems to be initializing the fixed length string array to some array sze and string length. You might be able to work that out from how the code makes use of that array - for instance, is that fixed length string some form of compound data item (like a dictionary)? Or you might need to look at the code in the InitializeArray method. It's possible that you can convert that ArraysHelper class and its methds into .Net, or it might be that there's no need to because whatever InitializeArray does might be replaced with a simpler procedure in .Net that does not require a special class (or even a fixed-length string array) to do the job.