Solved

Study guide

Posted on 1998-12-12
5
152 Views
Last Modified: 2010-05-03
I have a list of latin roots and the deffinitions i wish to make a small program that will show the definition and have you enter the root. What i got so far is a text box a lable and a command button what i want to happen is when i click the command button it will put a random definition in the label and have you enter the correct root for that definition into the text block. I will need to do this for about 100-200 roots. I just need the basic code then i can extend it to how many roots i have.

Please give me the Visual Basic 3.0 codeing

Thanks
0
Comment
Question by:swdea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 2

Expert Comment

by:trillo
ID: 1449653
Need more info, How do you have the latin roots and their definitions? in a file?.. in a database?
0
 
LVL 3

Accepted Solution

by:
jbil earned 200 total points
ID: 1449654
'This example uses two listbox's with visible prop set to false 'the list's are loaded with values on form load
'you could optionly fill them any way you want

Private Sub Command1_Click()
Dim mynum As Integer
Randomize
mynum = Int((6 * Rnd) + 1)
List1.ListIndex = mynum
List2.ListIndex = mynum
Label1.Caption = List1.List(mynum)
Text1.Text = ""
Text1.SetFocus
End Sub

Private Sub Form_Load()
mystring = "definition"
For i = 1 To 6
    List1.AddItem mystring & CStr(i)
Next

mystring = "root"
For i = 1 To 6
    List2.AddItem mystring & CStr(i)
Next

End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = 13 Then
    If Text1.Text = List2.Text Then
     Label1.Caption = "Right"
    Else
     Label1.Caption = "wrong"
    End If
End If
End Sub

0
 

Author Comment

by:swdea
ID: 1449655
with your code it works but i dont see how to put multiple definitions and roots.

I would prefer that all the root and definitions are in the sorce. Thanks
0
 
LVL 3

Expert Comment

by:jbil
ID: 1449656
>I have a list of latin roots and the deffinitions
What is this list?
If you send a few lines of it I will show you how to extract values from it and add them to listboxes.

If I understand, you have to have roots and defs somewhere, in a file, database, array, collection, etc.
If you had files (roots.txt and defs.txt) you would open them and put values in listboxs


Or do you want to fill the boxes at design time?(painfully slow work)
 
btw the line in above code should be
mynum = Int((List1.ListCount * Rnd))

not
mynum = Int((6 * Rnd) + 1)

0
 

Author Comment

by:swdea
ID: 1449657
Thanks that is how i wanted to do it right at disighn time Thanks again.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month4 days, 5 hours left to enroll

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question