Random access file variable length
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Random access file variable length

  1. #1
    Join Date
    Aug 2014
    Posts
    8

    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
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,845

    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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center