From: Tech@SoftByteLabs.com
Subject: Re: MBF vs TYPE...END TYPE problems
On Tue, 31 Mar 1998 15:33:30 -0500, John Fritz
wrote:
>I still compile QuickBasic (4.0) using /MBF to continue to use my old
>data files. I would like to set up a random access file where each
>record has about 6,000 elements, so that I can GET a record and quickly
>get the 6,000 elements in that record in an array, but I get an:
OUT OF STRING SPACE error
>when I run the compiled program, because I have to dimension a set of
>string variables, say, I=6,000:DIM G$(I) for my FIELD definition setup.
>I have PLENTY of FREE MEMORY.
>Can someone tell me how to set aside more string space (more than 64 K)
>in the program?
> The other solution is for me to convert my data files and use:
TYPE...END TYPE,
>but I don't see how to set up a record with 6,000 elements, since I seem
>to be forced to EXPLICITLY define each element (for me, 6,000 of them)
>in the TYPE...END TYPE setup.
> Am I missing something here?
> Someone in the comp.lang.basic.misc newsgroup suggested I use BINARY
>files, but I have timed the two and using RANDOM access files with 3,000
>elements (which I can do) and getting one record and reading the 3,000
>elements into an array is about 12 times faster that 3,000 gets from a
>BINARY file. Speed is VERY important to me.
>Thanks for any help.
>John Fritz
What is the total size of a single record?
Using the TYPE/END TYPE will not solve this because you still have to
dim an array of that type. But you can always create half of the
array at the module level, then create the other half in a SUB and
make it SHARED to be accessible to the other subs as well. This works
good because both array doesn't share the same data segment, thus
allowing you to have more large arrays. If all you need are 2 arrays
to get a single record, then it'll be fast using 2 gets.
Basically, make an array as COMMON and then make one SHARED
in a sub. This it'll work.
*** QwkNews (tm) v2.1
* [TN71] Toast House Import
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)
|