Program to big to fit in memory Clipper program

Hi,
   
   We have a program made in clipper with an os of Windows 98 Second Edition with a
   Motherboard of  P4PE2-X ASUS the following
   configurations.

   autoexec.bat
   c:\widnows\command\keyb.com us,,c:\windows\command\keyboard.sys
   set clipper =f75;s2

   config.sys
   
   device = c:\windows\command\himem.sys
   device = c:\windows\command\emm386.exe
   dos=umb,high
   files = 75
   buffers = 13
   fcbs=4,0
   stack=9,256
   lastdrive=e

   Every afternon we backup our data using pkzip version 2.04 g "dos mode". but the problem is
   sometimes it will display Program to big to fit in memory and Runtime environment error and no  
   zip file was created. What is the best configuration for config.sys that are running in windows 98
   second edition?  what  would be the cause for this?

   can anyone please help me...







 
theroosterAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JesterTooCommented:
Which version of CA-Clipper?  What linker was used to build the exe?

If you have Blinker (one of the bext linkers ever made for Clipper 5.2)  change your "RUN ..." command to use Blinkers SwpRunCmd() function.... If I remember correctly, you will need to invoke pkzip with some command-line switch to disable its use of extended memory.  I'll have to look through some of my old code to give you the exact switch.

There are other options but they depend on your version of Clipper and linker.

HTH,
Lynn
0
RanjeetRainCommented:
Try changing these lines in your config.sys


devicehigh = c:\windows\command\himem.sys
devicehigh = c:\windows\command\emm386.exe
dos=high, umb



Also try getting rid of these lines from Autoexec.bat (unless you critically require them)

REM c:\widnows\command\keyb.com us,,c:\windows\command\keyboard.sys
0
theroosterAuthor Commented:
JesterToo ,

 the code is pkzip -ex &backup zipfile.. that is the option in the code. we are using clipper 5.01.

 
 RanjeetRain,

 how about the buffer size and the files? is it okey buffers = 13 and files = 75.  and upon searching the internet i also saw using the noems option in the emm386.exe what is that for?

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

JesterTooCommented:
You didn't say which linker you're using but if it's Blinker then replace your "run pkzip -ex &backup zipfile" with the following:

  swpruncmd( "pkzip -ex -) " + cTarget + " " + cSource, 0, "", "" )   (use your own variables or literals)

This assumes variables cTarget and cSource contain the filespecs for the resulting zipfile and the files to be archived respectively.  The command line switch "-)" is to disable pkzip's usage of 32bit DPMI.  This is necessary if you create your Clipper app as an extended mode app (which I recommend you do.  Blink Inc states that apps using the swpruncmd function usually should be "real mode" but I've found that "extended mode" works perfectly unless you start nesting the swpruncmd calls more than 3 or 4 layers deep).

The swpruncmd will free nearly all of the low-memory used by a Clipper app and make it available for use by the spawned process.

Note also that I didn't the macro operator (&) to construct the command... you should avoid macro's whenever you can in order to obtain better application performance and to use less system resources.  Clipper 5.x syntax is a huge improvement over the previous versions and makes macros unnecessary unless compiling dynamic codeblocks.

Also, Clipper 5.2e is a huge improvement over 5.01 (the last version was 5.3, however... it's somewhat of a disappointment when compared against 5.2e but is still an improvement over 5.01).  There is a free, open source product known as xHarbour that I'd recommend you take a look at if your use of Clipper is anything more than casual.  This product produces Windows 32-bit executables or *nix executables in native code (there is still a small element of "p-code" interpretation but the exe's are mostly machine code).  The product is fairly complete and offers a huge set of features that you'd expect in a Windows 32-bit language.  See http://www.xharbour.org/ for the free version and http://www.xharbour.com/ for the commercial version.

HTH,
Lynn
 
HTH,
Lynn
0
RanjeetRainCommented:
FILES at 75 is a little over kill I'd say.

FILES = 50 is more than sufficient.

Buffers you should keep at 32 minimum, for a good performance. But since you are trying to optimize the memory uses, you may prefer to keep it a at a low number, as each buffer consumes half a KB memory.
0
theroosterAuthor Commented:
RanjeetRain,


 I tried changing

devicehigh = c:\windows\command\himem.sys
devicehigh = c:\windows\command\emm386.exe
dos=high, umb
files=50
buffers=13

and still it didn't work..







 
0
JesterTooCommented:
If you can't use "Blinker" then you could re-link the app using overlays.  If you construct them carefully you could reduce the memory footprint of the app considerably.  This might free up enough memory to run PkZip.

I'd seriously consider upgrading from Clipper 5.01 to something newer... 5.2e or 5.3.  Only 5.3 is still being sold commercially but there are web sites that specialize in re-selling discontinued software.  Also, you might find it on eBay sometimes.  

Lastly, a no-cost (monetarily, that is,,, there is some learning-curve involved in geting it installed and setup) option is to download the free open-source xHarbour and just recompile the app as a WIndows 32-bit text-mode app.  I've used xHarbour quite a bit and it is excellent... it has many improvements and yet remains to be about 99.999% compatible with Clipper's native syntax.  It actually fixes some bugs that were never fixed in any of the Clipper versions.  You will probably notice a considerable speed improvement over Clipper 5.01 compiled apps as well.

Regards,
Lynn
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
theroosterAuthor Commented:
JesterToo , the program was already made by another programmer.. what i need to know is
 how to conserve memory allocation to prevent problems.
0
JesterTooCommented:
Without the ability to modify/relink the application to allow it to consume less memory you don't have many options to fix the problem.  About the only one I can see is to reduce the buffers=13 to a lower number.  If you get too low the application(s) might run a bit slower (but they should still run).  Reducing file handles won't give you back very much memory... each one is only a few bytes in size... and they could compromise the ability of your app to execute (depends on how many dbf's, indexes, memo files, and text files you have open at any one time in your apps).

Is there any way you can obtain the source code to the app or have the original author modify it for you?  There used to be (maybe still is) a company that would de-compile a Clipper exe back to the source code for a fee.  This company at one time sold a program (Valkyrie) to end users for the same purpose.  I bought it years ago (still have it somewhere arond here) when I worked for a company that used Clipper extensively as a means to ensure we never lost the code to any of our 5000 Clipper apps... it worked great when we tested it and when we actually needed to use it 2 times.  However, with the advent of newer releases of Blinker the company stopped marketing a version that worked and went into offering the recovery service themselves (probably the market dried up for the program).  Since your app was written with Clipper 5.01 it may have been linked with another linker or with a version of Blinker early enough for it to work for you (I know it works with Clipper 5.2e and Blinker prior to version 4).

HTH,
Lynn
0
JesterTooCommented:
Given the constraints stated surrounding the asker's question I believe my comments covered all of his available options.  Therefore, I recommend PAQing this question regardless of the awarding of points.
0
RanjeetRainCommented:
I think Jester extended enough support and it can be said that the problem must have been resolved. I would recommend accepting one of Jester's comments as an answer.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.