Muruganvv
October 18th, 2001, 01:12 AM
Hi,
What is the different between Random Access File operations & Binary Access File operations in VB.
In my application there are many different types of UDT.
for example
'-------------------------------------
'Structure for object position
public Type ObjPos
Left as Integer
Top as Integer
Height as Integer
Width as Integer
End Type
'Structure for object font
public Type ObjFont
FontName as string
FontStyle as Integer
FontSize as Integer
FontColor as Long ' ColorConstants
End Type
'Structure for common obj properties
public Type CommonObjProperties
uobjPos as ObjPos
uFont as ObjFont
strCommonItem as string
nTableID as Integer
bBorder as Boolean
iAlignment as Integer
nBackgroundColor as Long
End Type
''' and many more big structures also there
'-------------------------------------
I have to write each of this structure to a file many times.
Because the record length is different for the three UDT, how I can give the 'len' in the file open command in random mode. If I give the length of the largest record.... the file size will becomes very large. If I did not give the len, it will not reading the file after writing.
My doubt is here, can I use the binary mode for opening the file. In binary mode the len part is not needed in the file open command.
Is there any document available, which describes the "File Open in binary mode".
Thanks in advance.
Murugan
Murugan V V
What is the different between Random Access File operations & Binary Access File operations in VB.
In my application there are many different types of UDT.
for example
'-------------------------------------
'Structure for object position
public Type ObjPos
Left as Integer
Top as Integer
Height as Integer
Width as Integer
End Type
'Structure for object font
public Type ObjFont
FontName as string
FontStyle as Integer
FontSize as Integer
FontColor as Long ' ColorConstants
End Type
'Structure for common obj properties
public Type CommonObjProperties
uobjPos as ObjPos
uFont as ObjFont
strCommonItem as string
nTableID as Integer
bBorder as Boolean
iAlignment as Integer
nBackgroundColor as Long
End Type
''' and many more big structures also there
'-------------------------------------
I have to write each of this structure to a file many times.
Because the record length is different for the three UDT, how I can give the 'len' in the file open command in random mode. If I give the length of the largest record.... the file size will becomes very large. If I did not give the len, it will not reading the file after writing.
My doubt is here, can I use the binary mode for opening the file. In binary mode the len part is not needed in the file open command.
Is there any document available, which describes the "File Open in binary mode".
Thanks in advance.
Murugan
Murugan V V