Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need a reorg for .NET Framework 4
Message
De
23/07/2010 12:20:53
 
 
À
23/07/2010 11:50:00
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01473537
Message ID:
01473600
Vues:
49
The only way to resolve the double character equivalent for a carriage return issue with the Split() method is to parse each item of the array, after it has been created, and call a method that removes carriage returns before and after. So, basically, in the LoadString() method, I have added a For/Next at the end to clean that up. Basically, Split() works on a one delimiter character. But, a carriage return is usually CHR(13)+CHR(10). So, it keeps the CHR(10). I tried to look for an option in it in regards to that but couldn't find it. This is what it gives for the LoadString(), the MemLines() and the MLine() methods. It is faster than before and works ok.
        ' Load the string into the string builder
        ' expC1 String
        Public Function LoadString(ByVal tcString As String) As Boolean
            Dim lnCounter As Integer = 0

            ' Make sure to clear the string builder
            oStringBuilder.Length = 0

            oStringBuilder.Append(tcString)

            ' Initialize the array
            oLine = oStringBuilder.ToString.Split(oApp.cCR)

            ' Count the number of lines
            nLine = MemLines()

            ' For each line
            For lnCounter = 1 To nLine
                oLine(lnCounter - 1) = oApp.NoCr(oLine(lnCounter - 1))
            Next

            Return True
        End Function

        ' Return the number of lines in a string
        Public Function MemLines() As Integer
            Return oLine.Length - 1
        End Function

        ' Return the specific line in a string
        ' expN1 Line
        Public Function MLine(ByVal tnLine As Integer) As Boolean

            ' Reset the values
            cLine = ""

            ' If the value passed is smaller or eqaul to the number of lines
            If tnLine - 1 <= nLine Then
                cLine = oLine(tnLine - 1)
            End If

            Return True
        End Function
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform