Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QB45 Error msgs Out of --Data,-String,-Stack space
#11
Thanks Toonski,
Are these Libraries those furnished in Basic Manual, --third party items, or do I need to write my own? Anyplace to get a little more info on libraries? If I break the program down into modules do they each have their own heap or work space, or do they all still have to fit in the basic 640K?
bdecker
Reply
#12
Mostly 3rd party. You can download QLBs from libraries like Cosmox or UGL. You can download both those, plus some other libraries at piptol.qbasicnews.com. Those two are general-purpose libraries, with EMS/XMS routines, graphics routines, sound, keyboard and more. They're worth a peek.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#13
My understanding of near and far arrays is as follows:

* NEAR arrays are also known as STATIC arrays.
* When you use a DIM to create an array, it becomes STATIC, and the memory is permanently set aside in the 64k (not 640k) normal data segment.
* STATIC arrays cannot be redimensioned.
* An ERASE statement can be used to reset the STATIC array to zeros or nulls.

* FAR arrays are also known as DYNAMIC arrays.
* The easiest and most normal way to create a DYNAMIC array is by using REDIM instead of DIM to create it. This memory is creted dynamically at run time beyond the 64k data segment.
* DYNAMIC arrays can be redimensioned using REDIM.
* The memory assigned to a DYNAMIC array can be freed by issuing an ERASE statement to it.

There are also $STATIC and $DYNAMIC metacommands to establish defaults for array assignments. THESE ARE NOT RECOMMENDED.

Using dynamic arrays can help a program which is having memory problems, but not necessarily in every case, based on what other things the program is doing in the 64k data segment.
*****
Reply
#14
I always refer to those as static and dynamic arrays. "Near memory" is the ~ 1mb of memory an address and segment can access in real mode and "Far memory" is ems, xms, and protected mode memory.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#15
I'll go with Moneo here.

AFAIK, Near= same seg. Far=Different seg.
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#16
OK guys- All comments much appreciated. I think I'm onboard near and far and now recall the part about near access without seg needed and far needing explicit seg. Have been using Redim and $Dynamic, which seems to be only nomenclature for Dynamic covered in the QB4.5 Manual. Not sure why ($) shouldn't be used, and really don't see any info or examples other than $dynamic.
Just came across another feature I had forgotten--Chaining, guess this would actually put certain processes into really separate programs each with their own workspace. Right?? I have to retrieve and accumulate awhole barrel full of ancestral names from a randomly organized Persons file, select the ones needed for a given pedegree, then arrange (in a dynamic array) in proper heirachial order to print out one line at a time in this sequence to form the chart. For 12 generations there is really a lot of saved strings plus a Vertical Lines array which generates special brackets to span and interconnect the parents of each individual. :roll:
Bdecker
Reply
#17
well, load qb with the /ah option before you try anything else, that should give you a little more conventional memory.

but dont use chain, that's an ugly, terrible statement you should have to use, and shouldnt use if you ever intend to compile this program.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#18
BDecker. Tell me me a liitle bit more about your application. First of all, where and how is all the geneology data stored? For each person (family member), how many pointers are there? Is there a pointer to his father and another pointer to his mother? These I would call upward pointers. Are you also using downward pointers, that is, from parent to sibling? These could cause problems.

Assuming that the data is on a file, ad that the pointers and keys on the file are set up correctly, I don't see any need to use large arrays to process the data. You should be able to traverse the data file using a recursive process to extract the small amount of data that you need for display.
*****
Reply
#19
I believe I did compile with the /ah switch, awhile ago, but don't have a positive check on that.
The persons file includes a pointer to each of the parents plus other data related to the person. There are no downward pointers.
In the persons file, each person has an ID number assigned when originally entered. Enteries are in random order as the data was obtained, anybody in the list could have any ID number. Each persons entry does have the associated ID's for Father and Mother.
The program allows using any name with its ID as the individual whose pedigree is to be constructed, I.E. My number is 6, mother maybe 3, father 2. etc. Program retrieves the data of the initial designated individual placing it and related info, in an array location with calculated subscript such that it is in the center of the array, not the first item. Father and mother are retrieved in sequence and located with father above and mother below the designated individual in the array. Each of parents are then in
turn processedfor their parents, etc, so array assignments expand outward from the center and end with the oldest ancestor, who is then in the first location of the array. Thus the whole array is assembled before printing, which then starts at top of chart with oldest person in first line and sequentially down the whole array.
Another array is required to hold vertical lines associated in front of each name so as to form brackets relating each generation of parents. Printout then appears in pyrimid form, with initial designee in middle far left border of page and parents expand rightward an echelon at a time with oldest person at top right border.
Geez I doubt if this makes much sense without seeing the code and the print out. Files not that big if you are interested to take a look:
ASCII Program Listing 18.7 KB
PersFile 102.7 KB A comma delimited file, have a separate readout program. for Alfa and Numerical Listings
Numerical Listing from Pers File 35KB
.jpg copy of Pedigree Printout- upto 1.8 megs depending on no of
generations displayed. Unable to generate pedigree chart other than to print it out and copy, unless you know a better way!
[/i]
Reply
#20
BDecker 'ol buddy, what you are describing is more of a project or a system than just a program.
Let me ask some questions which i'll intersperse into your text with CAPS.
----------------------------
The persons file includes a pointer to each of the parents plus other data related to the person. There are no downward pointers.
In the persons file, each person has an ID number assigned when originally entered. Enteries are in random order as the data was obtained, anybody in the list could have any ID number. Each persons entry does have the associated ID's for Father and Mother.
THE ID NUMBER AND THE ABOVE "POINTER" IS THE SAME, RIGHT?
YOU MAKE SURE THAT THESE ID'S ARE UNIQUE, RIGHT?
THE PERSONS FILE IS A FLATFILE (ASCII) WITH COMMA DELIMITERS BETWEEN FIELDS, RIGHT?

The program allows using any name with its ID as the individual whose pedigree is to be constructed, I.E. My number is 6, mother maybe 3, father 2. etc. Program retrieves the data of the initial designated individual placing it and related info, in an array location with calculated subscript such that it is in the center of the array, not the first item.
I DON'T UNDERSTAND WHY YOU PLACE IT IN THE CENTER OF THE ARRAY, BUT CONTINUE.

Father and mother are retrieved in sequence and located with father above and mother below the designated individual in the array. Each of parents are then in
turn processedfor their parents, etc, so array assignments expand outward from the center and end with the oldest ancestor, who is then in the first location of the array.
LET'S SEE, FOR A GIVEN PERSON, YOU HAVE TO READ THROUGH THE PERSONS-FILE SEQUENTIALLY UNTIL YOU FIND HIM BY ID. THEN YOU HAVE TO GO THROUGH THE FILE AGAIN TO FIND THE MOTHER, AND THEN AGAIN FOR THE FATHER. IF THE GIVEN PERSON HAS 4 OR 5 GENERATIONS OF FAMILY MEMBERS, YOU'REE GOING TO SPEND A LOT OF TIME READING THAT FILE. IS THAT THE WAY IT WORKS?

Thus the whole array is assembled before printing, which then starts at top of chart with oldest person in first line and sequentially down the whole array.
Another array is required to hold vertical lines associated in front of each name so as to form brackets relating each generation of parents. Printout then appears in pyrimid form, with initial designee in middle far left border of page and parents expand rightward an echelon at a time with oldest person at top right border.
Geez I doubt if this makes much sense without seeing the code and the print out. Files not that big if you are interested to take a look:
ASCII Program Listing 18.7 KB
PersFile 102.7 KB A comma delimited file, have a separate readout program. for Alfa and Numerical Listings
Numerical Listing from Pers File 35KB
.jpg copy of Pedigree Printout- upto 1.8 megs depending on no of
generations displayed. Unable to generate pedigree chart other than to print it out and copy, unless you know a better way!
-------------
Some suggestions:
1) The easist way to access the Persons-File would be by setting it up as a Random File, so you can get to a particular person record directly.
2) If you can't or don't want to use a Random file, then I have the following 2 suggestions:
2a) Figure out if your entire Persons-File will fit in memory, and do the whole operation in memory.
2b) If not, make an initial pass reading the Persons-File and just suck in the ID-Numbers into memory. Do all the lookup stuff in memory, and then when you've got the list of ID's that you want to printout, read the Persons-File again (one time sequentially) to bring in the other data fields that you want to print. This last part should fit comfortably into one array.
Good luck!
*****
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)