Sorry about that. var.truck references, in the particular SUB, another user defined variable, the main data variable in fact, which receives the results of the routine, I should have either remarked it out or posted the whole kit and kaboodle, but my approach is to shoe horn the new display stuff into the old working version's algorithms and it's a big fat mess right now. I'm tackling it one step at a time and seeing how far it goes before it crashes. I don't want to really fatigue anyone with my problems, but the UBOUND thing has got me stumped... I was kinda hoping that it was a QB64 quirk and someone would say "Oh, you just have to do 'X'"....;)
I'm looking at your code now.
line 72 errors out. var.truck is not referring to anything. A typo perhaps. I remarked the line out for now.
One thing I noticed is at the top of your code you DIM SHARED your arrays. You should REDIM SHARED those arrays instead.
edit: Do you have some dummy text I can use to run with the program? farm.txt and truck.txt
Anyway, for anyone who is interested in this particular train wreck, I'll attach the whole awful thing. It's been a long term work in progress by a guy with meager skills.
The old working version (written under 4.5) "GRAIN321.bas" along with "farm.txt" and "truck.txt". As our truck loads come in from the field, they are weighed and a sample is taken for moisture testing. The program accepts the gross weight and moisture test and then determines net weight and shrinkage of the bushels from the drying process, and stores the results by truckload in a file for each farm, crop and harvest year. I'm seeking to consolidate all farms and crops in a single year file to clean up the file clutter that this scheme creates. After 20 some years of harvests I have significant clutter.
"Grain4.bas" is to be, one day hopefully, the new and improved version, incorporating mouse support, less cryptic looking graphic display and the ability to print hardcopy without the need to create html files as the workaround of the fact that Windows doesn't want to print my output.