|
-
Dec 12th, 2000, 12:22 AM
#1
Thread Starter
Addicted Member
-
Dec 12th, 2000, 01:18 AM
#2
Addicted Member
I'll try to answer you in a couple of minutes.
-
Dec 12th, 2000, 01:32 AM
#3
Thread Starter
Addicted Member
-
Dec 12th, 2000, 01:48 AM
#4
Member
if I understand you correctly, what you want is to open a binary file containing these records and read it to it's bitter end, then use the records to populate a listbox.
Assuming you alreafy have a binary file with the records:
Code:
dim counter as integer
dim record as Housesize_const_rm
counter=0
open "washington.irving" for binary as #1
do until eof(1)
get #1, counter*len(record)+1, record
list1.additem str(record.housesize_rm), counter
list1.itemdata(counter) =record.housecost_rm
loop
I hope this works and it is what you wanted.
Yours,
Yosef Meller
-
Dec 12th, 2000, 01:50 AM
#5
Addicted Member
This should give you some help.
You need one module.
One form.
On the form you need a listbox, Two Command Buttons and a text box.
Code:
'Module code
Public Type Housesize_cost_rm
Housesize_rm As Integer
Housecost_rm As Currency
End Type
'Form Code
Private Sub Command1_Click()
Dim House As Housesize_cost_rm
Dim x As Long
Dim y As Long
Dim p As Long
x = Int(Rnd * 20000) + 100000
y = Int(Rnd * 3000) + 2000
House.Housecost_rm = x
House.Housesize_rm = y
List1.AddItem House.Housesize_rm
List1.ItemData(0) = House.Housecost_rm
End Sub
Private Sub Command2_Click()
Text1.Text = List1.ItemData(0)
End Sub
If you have any problems just ask.
-
Dec 12th, 2000, 01:53 AM
#6
Thread Starter
Addicted Member
Using Lab 7, the yacht program, populate the list box that contains the yacht sizes with the random file ransize. This file is located on the cslabs server under Cubre in the folder called Random. It is called ransize. Each record in the file contains two fields, an integer yacht size and the hourly cost as currency data type. The size of the yachts are to be stored in the .list property of the list box and the cost is to be stored in the itemdata portion of the same list box. See pages 304-306 and 354-356 of your textbook.
That is what I need.
* random File *
Please help if you can.
I appreaciate it.
My book doesnt help me at all.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|