Re: INITIALIZE vs LET
Posted in 2000
"Art S. Kagel" wrote: > > "Mark D. Stock" wrote: > > > > Andrew Hamm wrote: > > > > > > Mark D. Stock wrote in message <91bm22$d5p$1@news.xmission.com>... > > > > > > > >> > the initialization for the two new columns. I found it when I began > > > >> > receiving runtime errors (-1210) and also noted the presence of several > > > >> > dates of 12/31/1899 (?). > > > > > > > >Unfortunately the INITIALIZE command would not have solved this for you. > > > > > > Yes it would. a date of 12/31/1899 is a representation of all zero bytes in > > > the 4 byte integer used to store dates. Day 1 in the Informix calendar is > > > 01/01/1900 and this is represented by a long integer value of 1. Hence the > > > bizarre date when the bytes contain zero. I believe that NULL in all numeric > > > types (and dates) is represented by NEGATIVE_MAX_INT - not the proper C > > > define for that value, but I hope you know what I mean. > > > > Actually IIRC a NULL date is 31/12/1899, or in your parlance, 0. > > No, 12/31/1899 is NOT the NULL date but the Zero date. If you insert > "12/31/1899" into a date it does NOT return NULL on SELECT. I've never tried that. What I recall is inserting NULL, only to return 31/12/1899. But perhaps the version I am thinking of has come a long way since then. > > > A defect of 4GL start-up is that all data memory is cleared to zero bytes, > > > but that means integers and smallints start as 0, chars start as null (I > > > like that) and decimals also start as null. I think floats start as null or > > > is it zero in this circumstance? Dates start as mentioned above - 31/12/1899 > > > which is really ugly. The ugly part here is, the logical initial value of > > > the variables is different depending on the type - inconsistently zero or > > > null. > > > > I presume you mean RDS as opposed to 4GL. RDS very kindly initialises > > variables for you, 4GL does not. I think an initialised variable of any > > value is far better than a random memory value. > > Actually you are picking nits. C4GL DOES initialize GLOBALS and Module > scope variables because it is "C" based the linker will initialize GLOBAL > memory to zeros. Global memory is also where module or file scope variables > are stored so they are initialized also. It is only function scope variables > including MAIN program vars that are garbage because they are defined on the > program stack and contain whatever was on the stack. I wasn't meaning to. The version of C4GL we used (yes yes, probably version 4 or less) didn't initialise any variables for you. That was one advantage, among many others, of sticking with RDS. > > > Dammit, I hope I haven't provoked a fresh, endless dialog on the subject. > > > > Well...., fresh for these times, but not endless. Oh, and my name isn't > > Dammit. ;-) > > > > > <someone said> > > > >It could be that these messages have only just appeared on the list for > > > >some strange reason, or it could just be that no one uses 4GL anymore. > > > >;-) > > > > > > I wish... > > > > You mean you wish people wouldn't use 4GL any more? Why? Once you've > > used the best, the rest are the rest. :-) > > AA AA AA AAMen I can't fix that stutter....., but I know a man who can.... :-) Cheers, -- Mark. +----------------------------------------------------------+-----------+ | Mark D. Stock mailto:mdstock@mydas.freeserve.co.uk |//////// /| | http://www.informix.com http://www.informixhandbook.com |///// / //| | http://www.iiug.org +-----------------------------------+//// / ///| | |This email will self-destruct in |/// / ////| | |10 sec. If you received this email |// / /////| | |in error, sorry about the mess. |/ ////////| +----------------------+-----------------------------------+-----------+