RE: Informix 4GL SMALLINT variables
Posted in 2000
In the long run, just learn the habit of programming as if variables are never automatically initialized. I did a test compile on a program which had a bunch of Boolean variables defined as SMALLINT. On a whim, I changed them all to INTEGER -- and the size of the compiled program decreased noticeably. I suspect it takes extra code to handle SMALLINT, which negates any reason for them (OK, maybe a large array of them) > -----Original Message----- > From: Surfer! [SMTP:nevis-view@nospam.demon.co.uk] > Sent: Tuesday, March 28, 2000 3:01 PM > To: informix-list@iiug.org > Subject: Re: Informix 4GL SMALLINT variables > > > Years ago we were using an old flavour of UNIX whose C compiler *did* > initialise variables. When we got a more up-to-date UNIX where > variables were *not* initialised the sh*t hit the fan. > > Assume for 4GL compilation that variables are *not* initialised. > > RDS does initialise them. > > And this applies not only to SMALLINT but INTEGER, MONEY etc. > > By the by I only use INTEGER in program variables apart from the 'LIKE > tabname.colname' ones. We had problems caused by SELECT COUNT(*) INTO > smallint breaking because the count was too large for SMALLINT to > handle. Of course in a table SMALLINT is fine. > > In article <954253648.8699.0.nnrp-02.c1ed1f69@news.demon.co.uk>, Tony > Flaherty <aef@mfs.misys.co.uk> writes > >The clowns right....again :o) > > > >Rather annoying in that using RDS and the interactive debugger does not > find > >problems caused by forgetting to initialise variables. > > > >-- > >--------------------------------------- > >Tony Flaherty aef@mfs.misys.co.uk > >Analyst Programmer > >Misys Financial Systems > >All statements and opinions are my own, > >Misys don't pay me enough to have opinions > >on their behalf > > > >. > >Obnoxio The Clown wrote in message <8bpv2j$bpr$1@news.xmission.com>... > >> > >>From: Rekaish Bhardwaj <RekaishB@compans.com> > >>> > >>>Hi, can anyone confirm that SMALLINT variables, > >>>if uninitialised, take on the value of 0 (zero). > >>>And whether this is the case on all platforms and flavours of UNIX. > >> > >>In RDS yes, C-compiled no. Last time I looked, anyway. > >>______________________________________________________ > >>Get Your Private, Free Email at http://www.hotmail.com > >> > > > > > > -- > Surfer!