Results 1 to 6 of 6

Thread: UserDefined data types

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Posts
    143
    anyone?

  2. #2
    Addicted Member
    Join Date
    Jul 2000
    Location
    California
    Posts
    154
    I'll try to answer you in a couple of minutes.
    VB-World addict!

    All spelling errors are undocumented words!
    http://www.bells.f2s.com

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Posts
    143
    okay thank you,,

  4. #4
    Member
    Join Date
    Dec 2000
    Posts
    37
    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

  5. #5
    Addicted Member
    Join Date
    Jul 2000
    Location
    California
    Posts
    154
    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.
    VB-World addict!

    All spelling errors are undocumented words!
    http://www.bells.f2s.com

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Posts
    143
    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
  •  



Click Here to Expand Forum to Full Width