Results 1 to 3 of 3

Thread: Saving strings to Binary...

  1. #1
    Guest
    I have a string variable that is set from a textbox text string and I need to save it to a binary file. There are also a bunch of other misc values I have to save to this same file too (Boolean, Single, and String values)

    Dim IntroChecked As Boolean
    Dim IntroDir As String
    Open Filename For Binary Access Write As #1
    Put #1, , IntroChecked
    Put #1, , IntroDir
    Close #1

    This doesnt seem to work correctly. The string isn't saved correctly for some odd reason but the IntroChecked value is saved correctly.

    I'm thinking that maybe I have to set the IntroDir variable as something other than a string for binary saving. I have no idea.

    Please Help.

    -Simon Bingier

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Check out your other thread
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guest

    Wink

    Hi,
    try this code:

    'declares section of form
    Private Type Intro
    IntroChecked As Boolean
    IntroDir As String
    End Type
    '
    Dim x as Intro
    x.IntroChecked=True
    x.IntroDir="C:\Windows"
    Open Filename For Binary Access Write As #1
    Put #1, , X
    Close #1

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