4GL Programming tidbit
Posted in 1997
Hi Family (I think I need to get out more.. ;-) Here is a 4GL problem I ran into and solved. It may prove useful. In a previous version of my application, I specified a scroll cursor with hold. For every time the user pressed a navigation key, I would fetch relative +1 or -1... y'know, the classical stuff. Anyway, I changed my mind about navigating by FETCH and decided to use that same cursor to fill an array of primary-key values using a FOREACH loop. I incurred error -229/-102. -229 Could not open or create a temporary file. -102 ISAM error: illegal argument to ISAM function. Huh? On a guess, I took out the "SCROLL" and "WITH HOLD" clauses. The FOREACH now works. Conclusion: the FOREACH loop internal mechanism does not like working on a scroll cursor. (IMO It's unlikely that it is barfing on the WITH HOLD.) I am not prepared to argue that this a product deficiency; after all, a foreach loop has no need for a scroll cursor. But it might be nice if the reference manual warned me about this. And it might be nice if I had the ability to reuse the scroll cursor in a WHILE loop after using it in the FOREACH loop. Opinions? Mild flames? -- -- Jake (Usually finishes what he) . . _..-'( )`-.._ ./'. '||\\\\. }\\_/{ .//||` .`\\. ./'.|'.'||||\\\\|.. )o o( ..|//||||`.`|.`\\. ./'..|'.|| |||||\\`````` \\,@,/ ''''''/||||| ||.`|..`\\. ./'.||'.|||| ||||||||||||. ||| .|||||||||||| ||||.`||.`\\. /'|||'.|||||| ||||||||||||{ | }|||||||||||| ||||||.`|||`\\ '.|||'.||||||| ||||||||||||{ | }|||||||||||| |||||||.`|||.` '.||| ||||||||| |/' ``\\||`` | ''||/'' `\\| ||||||||| |||.` |/' \\./' `\\./ \\!|\\ /|!/ \\./' `\\./ `\\| V V V }' `\\ /' `{ V V V \\ \\ \\ V / / / +-----------------------------------------------------------+ | Impeccable Logic: A thought process which successfully | | resists chicken bites | +-----------------------------------------------------------+