CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2014
    Posts
    26

    Random access file variable length

    I'm creating a random access file. When counting the different variables to get the length of the file, how much should I enter for a date variable?

    For example

    type guest
    name as string * 20
    address as string * 30
    arrivaldate as date
    end type
    dim g as guest

    The name and address is simple but how much should I reserve for the date variable?

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Random access file variable length

    You are using a Type so you can simply get the length of the type

    Code:
    Open Filename for Random as #1 len=Len(g)
    a date data type is 8 bytes if I'm not mistaken
    Always use [code][/code] tags when posting code.

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

Featured