Re: [Q] How to get rid of error message: -4518 temprorary string space
Posted in 1994
Pete Stiglich (Pafc@news.oar.net) wrote: : Klaus Lichtenwalder (klaus@gaston.m.isar.de) wrote: : : Hi, : : we have a very nasty problem and can't see why it should be our fault. : : We keep getting the error : : error message: -4518 The 4GL program : : cannot allocate more space for temporary string storage : : in our reports, when there are too many print statements for too many : : lines. : : So, is there a misconception on our side, is it a well known fact/bug : : and how can we avoid this problem!! : I think it is fairly common. Informix sent me the following for this: : FUNCTION tss_hog() : define n smallint,str_var CHAR(50) : whenever error continue : for n = 1 to 1000 : let str_var = tss_hog1() : end for : whenever error stop : end function : function tss_hog1() : whenever error continue : return "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" : whenever error stop : end function : Call tss_hog in different parts of your code. It will help to pinppoint : the problem, albeit much PATIENCE is needed. Good luck : Pete I've used the tss_hog() function before and it works well. If you have RDS, it is much easier to use in the Interactive Debugger environment, since you can call tss_hog() from the command window or automatically at breakpoints without modifying code. Just to clarify: the tss_hog() function identifies sections of 4GL code which do not clear temporary string storage (tss). If tss is empty, tss_hog() will execute without error. If tss is not empty, tss_hog() will always die with the -4518 error. Statements that do not empty tss ought to be rewritten. I've had problems with statements like LET char_var[i] = "" This was intended to truncate the character variable at the i-th position and it does, but for some reason it does not empty tss. Replacing the empty quotes with a single space solves the problem. BTW I believe the original author of this gem was Loren West at FourGen Software. He published a lengthy article about tss and the -4518 error some years ago in a FourGen technical newsletter. The article included this tss_hog() function and hints on using it. -Jeff