Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Just need a little bit of help!

xaraxara Posts: 2Member
Hello, I'm makeing a program that will write a story for you, based on the user imput. I think think what i am makeing is called a Madlib. I have 16 questions, and the answer that the user puts will be used in the story. I can't seem to get the story to appear though. I started by trying to make each sentance a string, and haveing the story appear on a differnt form, but that did not seem to work, the form would appear blank when i clicked the "Write story" command button. So now I am trying to use an OLE box to make the story appear in. But I can't figure out how to make the story appear after i get the user imput in this, i have never used an OLE box either. I tried the
*.visible = true, but i don't know for sure if i did it right. If anyone has any suggestions on what to do, (i'd rather try something other than have each sentace be a seperate sting), Please tell me!! Thanks

~Xara~

Comments

  • DaveRDaveR Posts: 98Member
    : Hello, I'm makeing a program that will write a story for you, based on the user imput. I think think what i am makeing is called a Madlib. I have 16 questions, and the answer that the user puts will be used in the story. I can't seem to get the story to appear though. I started by trying to make each sentance a string, and haveing the story appear on a differnt form, but that did not seem to work, the form would appear blank when i clicked the "Write story" command button. So now I am trying to use an OLE box to make the story appear in. But I can't figure out how to make the story appear after i get the user imput in this, i have never used an OLE box either. I tried the
    : *.visible = true, but i don't know for sure if i did it right. If anyone has any suggestions on what to do, (i'd rather try something other than have each sentace be a seperate sting), Please tell me!! Thanks
    :
    : ~Xara~
    :
    there is only one way i know of doing this (sorry you have to have lots of strings)

    strStory = strStory & strSentence(intCount) & txtMadLib(intCount).text

    not this assumes you are using a parrell array when doing this and that you strSentece is declared as a array to do this you do
    strSentence(1 to whatever); note i like to use one based arrays but vb defaults to 0.

    you will also have to create a loop that is why i am using intCount this is the shortest way i know of doing this.

    ps you might have alot of setting up string wise to be able to do this in the form load. but in the long run you might just want to create a file and go through a loop to store all the strings if you need more help just ask.

  • hobbyhobby Posts: 84Member
    : Hello, I'm makeing a program that will write a story for you, based on the user imput. I think think what i am makeing is called a Madlib. I have 16 questions, and the answer that the user puts will be used in the story. I can't seem to get the story to appear though. I started by trying to make each sentance a string, and haveing the story appear on a differnt form, but that did not seem to work, the form would appear blank when i clicked the "Write story" command button. So now I am trying to use an OLE box to make the story appear in. But I can't figure out how to make the story appear after i get the user imput in this, i have never used an OLE box either. I tried the
    : *.visible = true, but i don't know for sure if i did it right. If anyone has any suggestions on what to do, (i'd rather try something other than have each sentace be a seperate sting), Please tell me!! Thanks
    :
    : ~Xara~
    :

    Write out your story as it is to a text file, but everywhere you want the user input to appear add a special tag such as %PLAYERNAME% or %HIPPOCOLOR%. Then you can have a person input their own words and save them into variables (either as public module variables or properties or as an array of string values). Then all you have to do is input the textfile one line at a time and do a Search and Replace in your code for the special tags and replace them with your variables. When you edit a line, you can then either concatenate it to a string or write it out to a textbox or even print it out to the form.

    If you do write it out to the form, make sure the AutoRedraw property is set to true. And that you do not clear the form between line writes.


  • KDivad LeahcimKDivad Leahcim Posts: 3,948Member
    : : Hello, I'm makeing a program that will write a story for you, based on the user imput. I think think what i am makeing is called a Madlib. I have 16 questions, and the answer that the user puts will be used in the story. I can't seem to get the story to appear though. I started by trying to make each sentance a string, and haveing the story appear on a differnt form, but that did not seem to work, the form would appear blank when i clicked the "Write story" command button. So now I am trying to use an OLE box to make the story appear in. But I can't figure out how to make the story appear after i get the user imput in this, i have never used an OLE box either. I tried the
    : : *.visible = true, but i don't know for sure if i did it right. If anyone has any suggestions on what to do, (i'd rather try something other than have each sentace be a seperate sting), Please tell me!! Thanks
    : :
    : : ~Xara~
    : :
    :
    : Write out your story as it is to a text file, but everywhere you want the user input to appear add a special tag such as %PLAYERNAME% or %HIPPOCOLOR%. Then you can have a person input their own words and save them into variables (either as public module variables or properties or as an array of string values). Then all you have to do is input the textfile one line at a time and do a Search and Replace in your code for the special tags and replace them with your variables. When you edit a line, you can then either concatenate it to a string or write it out to a textbox or even print it out to the form.
    :
    : If you do write it out to the form, make sure the AutoRedraw property is set to true. And that you do not clear the form between line writes.
    :
    :
    :

    One note: Don't get the file one line at a time, retrieve it in one read and then do the search/replace. Far fewer file reads and you won't have to rejoin the lines.
Sign In or Register to comment.