Re: blob in embedded c code
Michal Hajek <[email protected]>
| Newsgroups | gmane.comp.lang.4gl.aubit.general |
|---|---|
| Message-ID | <CAJ7z5afYbZ1ZdSUWV=Yu53m+FP88Qavj9q16+V0L2gH2nEe0WQ@mail.gmail.com> |
Apparently yes :-( Thanks, Michal On Wed, Jan 11, 2012 at 12:58 PM, Mike Aubury <[email protected]> wrote: > Ouch... > > Thats is *bad* 4gl - bad bad nasty evil 4gl... > Try that same program with Informix 4gl rds and you'll helpfully get : > > FORMS statement error number -1326 > An array variable has been referenced outside of its specified > dimensions. > > > Informix 4GL Arrays are ALWAYS from *1* > The chances are you are overwriting another completely different variable > when you set a value at index '0', but the C compiler version of informix > will happily let you... > (As will C) > > Rewrite your 4gl ASAP - it *is* wrong.. > > > > On 11 January 2012 11:51, Michal Hajek <[email protected]> wrote: >> >> On Wed, Jan 11, 2012 at 11:37 AM, Mike Aubury <[email protected]> >> wrote: >> > Arrays start from 1 in Aubit4GL and informix 4gl.. >> > Internally - it should subtract 1 in the C code generated - because in C >> > - >> > arrays start at 0 - but you should never see that in 4gl.. >> > If you have Aubit4GL doing something different - let me know - it will >> > be a >> > bug.. >> >> Hm... i4gl: >> >> define x integer, >> ar array[7] of integer >> main >> for x=0 to 7 >> let ar[x]=100+x >> display ar[x] >> end for >> end main >> >> -> >> >> 100 >> 101 >> 102 >> 103 >> 104 >> 105 >> 106 >> 107 >> >> (In a fact, it displays everything ok in case when x is to 100 too >> :-))) but that is another problem) >> >> Aubit compiles the code, but asserts array out of its bounds when run. >> It is just incompability, not aubit bug, of course. (I use arrays with >> weekday() often, so I run into problems very quickly :-) >> >> > >> > >> > For Prompts - they are done in Screen mode when A4GL_UI=TUI - you can >> > set >> > (as you say) A4GL_UI=CONSOLE - and it will use the console mode (no >> > windows/screens). This should use "fgets(..,stdin)" internally for the >> > prompts , printf's for displays etc.. >> >> What should I set, if I want multiple prompts (without clearing screen >> during this input phase) and then I need "display at" work in 4gl? >> Should it work with CONSOLE? >> >> > >> > For clearing the program at exit - this is 'ncurses' restoring the >> > original >> > session, and will depend on your terminal type. >> > >> > You can try setting : >> > >> > export NO_ALT_SCR=Y >> > >> > and see if that helps. This trys to turn off ncurses alternate screen >> > mode - >> > but again - it will depend on the terminal type. >> > >> >> It did not help :-( >> >> Thanks, >> >> Michal >> >> >> ------------------------------------------------------------------------------ >> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex >> infrastructure or vast IT resources to deliver seamless, secure access to >> virtual desktops. With this all-in-one solution, easily deploy virtual >> desktops for less than the cost of PCs and save 60% on VDI infrastructure >> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox >> _______________________________________________ >> Aubit4gl-discuss mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss > > ------------------------------------------------------------------------------ Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox