Results 1 to 4 of 4

Thread: *******-Please Help-----*******

  1. #1

    Thread Starter
    Lively Member mykg4orce's Avatar
    Join Date
    Oct 2000
    Location
    CANADA
    Posts
    92

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    : "." and "," and "?" and "'" and "-".
    a text field is it a file and if so give a few lines
    from the file and if it is comma delimited or not.

    the special characters...does it mean you don't count those as an ending..example jack ate melon. means you want to leave the . and end up with this kjacay eatay nmeloay.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    Lively Member mykg4orce's Avatar
    Join Date
    Oct 2000
    Location
    CANADA
    Posts
    92

    ok here it is

    the way this thing works is that i input from a text file like this:

    To be or not to be, -that is the question : -Whether 'tis nobler in the mind to suffer the slings and arrows of outrageous fortune... and so on

    what i have to do is find issolate every word and move the first letter of that word to the end and add "ay" to the end of the same word. So it looks like this:

    Hello Sir.

    elloHay irSay. Pig Latin

    how do i do this, please help

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Here is a start..this will seperate the words.

    [code]
    Option Explicit

    Public Function Split2(ByVal sString As String, ByVal sSeparator As String) As Variant
    Dim sParts() As String
    Dim lParts As Long
    Dim lPos As Long

    lPos = InStr(sString, sSeparator)
    While lPos
    ReDim Preserve sParts(lParts)
    sParts(lParts) = Left(sString, lPos - 1)
    sString = Mid(sString, lPos + Len(sSeparator))
    lPos = InStr(sString, sSeparator)
    lParts = lParts + 1
    Wend
    If Len(sString) Then
    ReDim Preserve sParts(lParts)
    sParts(lParts) = sString
    End If
    Split2 = IIf(lParts, sParts, Array())
    End Function

    Private Sub Command1_Click()


    Dim sMyFile As String
    Dim intNum As Integer

    'open for binary and read it into a string
    sMyFile = "C:\My Documents\MyFile.txt"
    intNum = FreeFile

    Open sMyFile For Binary As intNum
    myString = Space(LOF(intNum))
    Get #intNum, , myString
    Close intNum

    Dim vLines As Variant
    Dim lLine As Long
    Dim sLet As String

    vLines = Split2(myString, " ")
    For lLine = 0 To UBound(vLines)
    List1.AddItem vLines(lLine)
    Next
    End Sub

    [code]


    [Edited by HeSaidJoe on 11-14-2000 at 08:46 PM]
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width