Info from text Box 
Author Message
 Info from text Box

I am creating a game with VB 4 and what it does is when you click on a
category you get a random question.  Then you type in the correct
response in a text box (a, b, c, d, or e).  I have all of my questions
in a txt file(There are 30 of them) and they each take up 8 lines, 1 for
the question, 5 for the multiple answers 1 for the right answer and a
blank space. My question is how do you divide up the text file so that
each question can be displayed seperatly. Any suggestions would be
greatly appresiated.
                                            -Ronnie Howell



Mon, 03 Jun 2002 03:00:00 GMT  
 Info from text Box
I don't know all the available commands in VB4 but maybe something
like this?

Dim strText as string
Dim strQuest as string
Dim strAnswer1 as string
etc...

strText = ' get text from file

strQuest = Left(strText, (InStr(1, strText, vbCrLf))

strText = Right(strText, (Len(strText) - Len(strQuest)) '

LTrim(strtext)

strAnswer1 = Left(strText, (InStr(1, strText, vbCrLf))

strText = Right(strText, (Len(strText) - Len(strAnswer1))

LTrim(strtext)

etc...

Long winded I know - but I am a novice!



Mon, 03 Jun 2002 03:00:00 GMT  
 Info from text Box
I am creating a game with VB 4 and what it does is when you click on a
category you get a random question.  Then you type in the correct response in
a text box (a, b, c, d, or e).  I have all of my questions in a txt
file(There are 30 of them) and they ea
ch take up 8 lines, 1 for the question,
5 for the multiple answers 1 for the right answer and a blank space. My
question is how do you divide up the text file so that each question can be
displayed seperatly. Any suggestions would be greatly appresiated.
                                            -Ronnie Howell



Mon, 03 Jun 2002 03:00:00 GMT  
 Info from text Box
I don't know all the available commands in VB4 but maybe something like this?

Dim strText as string
Dim strQuest as string
Dim strAnswer1 as string
etc...

strText = ' get text from file

strQuest = Left(strText, (InStr(1, strText, vbCrLf))

strText = Right(strText, (Len(strText) - Len(strQuest)) '

LTrim(strtext)

strAnswer1 = Left(strText, (InStr(1, strText, vbCrLf))

strText = Right(strText, (Len(strText) - Len(strAnswer1))

LTrim(strtext)

etc...

Long winded I know - but I am a novice!



Mon, 03 Jun 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Need to truncate textfile info being loaded into Rich Text Boxoading Text Box infppo to RichTeboVB

2. Populate text box with info from datacombo

3. Require Info on rich text Box control.

4. Populating text boxes with date info

5. Text box text on new page text box

6. using VB text boxes data but not text boxes in word 2000

7. Auto popluate text box with data from another text box

8. Columns in List box, when inserting text from text box (VBA)

9. update text box with a timer whilst editing same text box

10. Colour Text Box/Class Wrapper for Rich Text Box

11. Passing Data from VB App Text Box to a Web Page Text Box

12. Tabbing from text box to text box using the enter key

 

 
Powered by phpBB® Forum Software