Writing structures to  disk
Writing structures to  disk
Writing structures to  disk
Writing structures to  disk
Writing structures to  disk
Writing structures to  disk Writing structures to  disk Writing structures to  disk Writing structures to  disk Writing structures to  disk Writing structures to  disk Writing structures to  disk Writing structures to  disk
Writing structures to  disk Writing structures to  disk
Writing structures to  disk
Go Back  Xtreme Visual Basic Talk > > > Writing structures to disk


Reply
 
Thread Tools Display Modes
  #1  
Old 10-21-2010, 03:24 PM
RedBoard RedBoard is offline
Newcomer
 
Join Date: Oct 2010
Location: Fort Lauderdale, FL
Posts: 1
Default Writing structures to disk


My application uses structures that contain strings and arrays that I want to write to disk. I understand that I can create the fixed length data types in the structures by using "ReDim" and "String$", but my question is: Does VB reallocate the storage for the structure which includes these redimensioned members in-line (which would be necessary in order to write the contents to disk), or does it allocate heap and merely store a pointer in the structure?

If only a pointer is provided, is there a straightforward workaround to allow me to create fixed length data types in a structure that could be written to a disk file?

Or, Is there an I/O method that will handle the situation by recreating a contiguous buffer containing the structure before writing it to disk?

I'm new to VB, so don't be too hard on me if the answer is obvious.

Thank you, in advance, for your help.
Reply With Quote
  #2  
Old 10-21-2010, 04:09 PM
AtmaWeapon's Avatar
AtmaWeaponWriting structures to  disk AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

Can you verify if you are talking about VB .NET or VB6?

The $ type suffix is not idiomatic in .NET, nor is the concept of "fixed length data types". (There are fixed-length data types but you don't generally worry about them at that level.) In .NET, outside of the serialization framework (which I don't like), you don't really write entire objects to a file at once. However, I know in VB6 this was a common concept.

If you're using VB6, I'll get a moderator to move the topic to the appropriate forum. If you're using VB .NET, I'm not quite sure I understand the question. Some examples with code might help.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Writing structures to  disk
Writing structures to  disk
Writing structures to  disk Writing structures to  disk
Writing structures to  disk
Writing structures to  disk
Writing structures to  disk Writing structures to  disk Writing structures to  disk Writing structures to  disk Writing structures to  disk Writing structures to  disk Writing structures to  disk
Writing structures to  disk
Writing structures to  disk
 
Writing structures to  disk
Writing structures to  disk
 
-->