Qbasicnews.com

Full Version: Here's the challenge (1st post edited)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
You could always move the files to XMS/EMS. It will ensure faster access and you need not be limited to 255 files at a time.
An idea just came to me. This idea might have occured to others but if not I'll post it up here.

My idea is to load each script and, instead of storing them in memory, store them in random access files. Why you ask? Because moving through a sequential file would be slower and more work than moving through a random access file. Storing them in memory is one technique but limited by available memory and handling EMS/XMS is cumbersome. By using a random access file you can jump around the file without any trouble.

Naturally as you are loading the script into it's file you would also want to examine it briefly. Call this a preprocessor if you want. Basically this stage would be to record the name and position of labels, subroutines, etc. This would be a much faster technique than to search the file for it.

And while we are at it let us address the issue of more than 255 files. The best method, as mentioned before, is to keep track of them in an array. For a speed up you would probably want it to open multiple files at once. As it processes the scripts, have it close each one. Then once it hits the last one in the batch (say the 10th or so) have it open another batch of them.
One Problem:

Fixed length strings.

But yes, if it could be done, it would be the balls. :*)
Ahem...I was using Random access files. But as Rel mentioned fixed length strings cause all the trouble.

About XMS/EMS being cumbersome/messy, have you seen Future.Lib's XMS routines? There are routines which allow you to read/write strings to XMS.
Yep. But that can be alleviated by simply examining the script file to see how long the biggest string is and using that value for creating/opening the file. This would probably take a special pass on the script file itself.

About libraries... you can't use them. According to the rules at the top, you have to use pure qb. You can use call absolute however.
Yep but XMS will be much faster than accessing files physically resident on the HDD :wink:.
Hey you all,

First of all, while we can discuss of possobilities as to how to enable more than 255 files to be opened at the same time in a script engine, Is it really that necassery? I mean, thing will get very slow, and the point is, you won't in any chance use even 200 at the same time.... Or do you?

I have call absolute based XMS memory routine, but it for some reason won't run on my winXP. Just window closes the dosbox and that's all.


And yeah, no external library's!!! But use call absolute as much as you desire
Hi again,

One solution (slow, but easy to code) is to store non-fixed lenght, var's in a tempfile.
I wasn't aware you could put non-fixed length strings in a random access file. Or are you thinking of another method?
yeah you can't put nofixed lenght into random access file, what I meant was just ordinary Input files
Pages: 1 2 3 4 5