Re: WORDWRAP and error 4518
Posted in 1996
Vadim Park wrote: > > Hi all, > > if I use WORDWRAP operation in my report then programm falls with error #4518. > I have read a discription of the error and absolutley sure I do not: > a) call nested function > b) declare variables with length greater than 150 > c) use combination of built-in and user-defined function in the same > concatenation expression > d) use "case expression" notation > > Usualy my program stops at statements having USING operation a sort of > print "something",column 5,numeric_variable using "&&&" or > let var=var clipped, var1 using "&&&" > > When I comments all WORDWRAP options program works fine. > I've tried do not use WORDWRAP with null or blank values and ended up with > greater number of processed records. > > I don't want to write my own function instead of WORDRAP so far. > Is that a bug in WORDRAP? > > I run I-4GL v.4.10.UC3 and OnLine v.5.02.UC2 > Thanks in advance > ------------------------------------------------------------------ > Vadim G. Park | Email: pivot@taxpol.krasnoyarsk.su > Federal Service of Tax Police | Voice: (3912) 27-02-83 > Krasnoyarsk, Russia | Fax : (3912) 27-07-69 > ------------------------------------------------------------------Vadim, there is a excellent description of this problem in the INFORMIX FAQ.Using Wordwrap in Reports is one of the causes of this problem in pre 4.12 4GL/RDS releases.I attach you the part of FAQ refering to this problem. Yours, Tolis Varnas +---------------------------------------------------------------------+ | Tolis Varnas email: tvarnas@compulink.gr | | Deligiorgi 26 tvarnas@orbit.de | | 546 42 Thessaloniki Voice: (30) 31 820270 | | Greece Fax: (30) 31 865463 | +---------------------------------------------------------------------+ >From INFORMIX FAQ: 4.1 Informix-4GL 4.1.1 I keep getting -4518 errors! How can I fix this problem? The -4518 error is usually caused by running out of a resource known as temporary string space. Solutions include: Upgrade to 4GL-RDS 4.12 or greater. Compile to a "real" executable with 4GL/C, rather than RDS. (You're less likely to hit it using 4GL/C) Read Loren West's excellent description of how TSS is used (see Appendix A) Read Informix TechInfo sheet #3925 (Loren's Article). Other -4518 related entries are 4064, 4517, and 2801. Try to make do with the following information (most of which only address the symptoms, not the causes): This error can be caused by any of the following coding structures: LET l_str = "Hello ",myfunc("World")) CASE statements without an OTHERWISE # Pre-4.1 CASE statements that look like this: # Pre-4.11 (maybe 4.10) CASE dummy_var WHEN 0 ..... WHEN 1 ..... WHEN 2 ..... END CASE instead of this: CASE WHEN dummy_var = 0 ..... WHEN dummy_var = 1 ..... WHEN dummy_var = 2 ..... END CASE Reports with excessive string usage (ie. USING, or other literals). One thing you can do to reduce the contents of string storage is to assign redundant strings associated with USING to variables and then refer to the variable: let l_str1 = '$$$$$$$$.$$' PRINT l_number USING l_str1 RETURNing large strings from functions. Use of SPACE, SPACES, COLUMN, UPSHIFT, DOWNSHIFT, or WORDWRAP Assignment of NULL to a string subscript: DEFINE x, y CHAR(10) LET y = NULL LET x[3,5] = y A return statement in a report function. Passing an argument to a function which has no parameters defined: CALL something(my_variable) ... FUNCTION something() From: heiker@quietsch.ping.de (Christian Heiker) There is an Informix-Lib *(undocumented function)* called "acdealloc()" which job it is to clear the stack. >From a 4gl-program you can call this function with "CALL acdealloc()". With RDS you have to call a c-program which calls this function. Here are the steps do do it with RDS: - edit file "fgiusr.c" (copy $INFORMIXDIR/etc/fgiusr.c) int (hallo); #include : : : cfunc_t usrfuncs[]= { "hallo", hallo, 0, 0,0,0 }; - create a new c-file, for example xy.c hallo() { acdealloc(); return 0; } - create a new runner (fglgo) cfglgo fgiusr.c xy.c -o newrun - Call the c-function in the RDS-program CALL hallo() - Start the program with the new runner You should pay attention that you make the call in an upper hierachy, for example after a FINISH REPORT. There is no guarantee that other important data may be deletet from the stack (because nobody nows what is at which time on the stack). BEWARE: There seems to be a bug in 4GL/ID (4.1 at least) which causes TSS problems to occur after the interrupt key has been pressed, which isn't very helpful if you're trying to find TSS problems in your program!!!