Results 1 to 2 of 2

Thread: String formatting in VB6-- Look Please

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2006
    Posts
    41

    String formatting in VB6-- Look Please

    I have some code that can reads text from a FAQ webpage and stores the sentences in an array. I need to group the Q/A pairs somehow. They will then all be written to a *.aiml output file in the format below

    <aiml>
    <category>
    <pattern>WHAT ARE YOU</pattern>
    <template>
    I am the latest result in artificial intelligence,
    which can reproduce the capabilities of the human brain
    with greater speed and accuracy.
    </template>
    </category>
    .
    .
    .
    <aiml>
    see -- http://www.alicebot.org/aiml.html

    Any suggestions are appreciated? Thanks

  2. #2
    Hyperactive Member
    Join Date
    Oct 2000
    Location
    Sydney Australia
    Posts
    476

    Re: String formatting in VB6-- Look Please

    A simple array is probably not the go. You have several other options though. A two dimension array where Array(i, 0) is the question and Array(i, 1) is one solution.

    A better solution is to declare a class that contains properties for both question and answer and add an instance of this class for each Q/A pair to the array.

    Still better is to add these instances to a collection. This will give you the ability to you the For Each statement if you set it up right, and the ability to add an ID key and retrieve Q/A pairs based on that ID.

    Sounds like you have some more research to do. I can give you some more pointers on how to structure this if you would like.

    FW

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