PDA

Click to See Complete Forum and Search --> : Saving strings to Binary...


Sep 6th, 2000, 05:44 PM
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

kedaman
Sep 7th, 2000, 07:51 AM
Check out your other thread

Sep 11th, 2000, 03:50 AM
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