Re: Can it be done...?
Posted in 1998
--------------33DA67B89825FC7A94AFD0A8 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit brasso wrote: > I've only recently began programming in 4GL (Ver 6.05) and I'd like to > know: > > 1. Can you pass an array to a function? Globals gets very expensive. > If not, doesn't this make them a bit redundant? > No. Writing the code with a FOR loop in the calling function is probably your best bet. Remember also that you have modular-global variables you can define (defined above the first function in a module, and known throughout the module), which are expensive like globals but allows a bit better control. Redundant in what way? > 2. Can you set up a two-dimensional Screen array? Not per se (sr_value[10,10] isn't allowed syntax). But it is possible to have a screen:[a][a][a] [a][a][a] and have the 4gl code work so that up, down, left, and right arrows work as expected. The c.d.i archive have examples of this, or let me know and I'll send a code example. > > > 3. Is there any point in using tablenames on a form? I've been using > formonly.field_name and so far have not met any limitations because of > this. > specifying a tablename validates the datatype of the field at compile time. So: f001 = table.datecol, format="mm/dd/yyyy"; vs: f001 = formonly.datecol type date, format="mm/dd/yyyy"; so it can save some typing. I advocate tying the screen to the database tables, but I might be in the minority. -- //////////////// ======================================================= ////////// // Dennis J. Pimple Informix Software, Inc. ////// / /// Principal Consultant 6300 S Syracuse Way Ste 205 ///// // //// dennisp@informix.com Englewood CO 80111 //// // ///// /// // ////// recept: 303-850-0210 // // /////// direct: 303-740-5611 Opinions expressed are mine, / /////////// fax: 303-779-4025 and do not necessarily //////////////// http://www.informix.com reflect those of my employer --------------33DA67B89825FC7A94AFD0A8 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <HTML> <P>brasso wrote: <BLOCKQUOTE TYPE=CITE>I've only recently began programming in 4GL (Ver 6.05) and I'd like to <BR>know: <P>1. Can you pass an array to a function? Globals gets very expensive. <BR> If not, doesn't this make them a bit redundant? <BR> </BLOCKQUOTE> No. Writing the code with a FOR loop in the calling function is probably your best bet. Remember also that you have modular-global variables you can define (defined above the first function in a module, and known throughout the module), which are expensive like globals but allows a bit better control. Redundant in what way? <BLOCKQUOTE TYPE=CITE> <P>2. Can you set up a two-dimensional Screen array?</BLOCKQUOTE> Not per se (sr_value[10,10] isn't allowed syntax). But it is possible to have a screen:[a][a][a] <BR>[a][a][a] <BR>and have the 4gl code work so that up, down, left, and right arrows work as expected. The c.d.i archive have examples of this, or let me know and I'll send a code example. <BLOCKQUOTE TYPE=CITE> <P>3. Is there any point in using tablenames on a form? I've been using <BR>formonly.field_name and so far have not met any limitations because of <BR>this. <BR> </BLOCKQUOTE> specifying a tablename validates the datatype of the field at compile time. So: <P>f001 = table.datecol, format="mm/dd/yyyy"; <BR>vs: <BR>f001 = formonly.datecol type date, format="mm/dd/yyyy"; <P>so it can save some typing. I advocate tying the screen to the database tables, but I might be in the minority. <BR>-- <BR><TT>//////////////// =======================================================</TT> <BR><TT>////////// // Dennis J. Pimple Informix Software, Inc.</TT> <BR><TT>////// / /// Principal Consultant 6300 S Syracuse Way Ste 205</TT> <BR><TT>///// // //// dennisp@informix.com Englewood CO 80111</TT> <BR><TT>//// // /////</TT> <BR><TT>/// // ////// recept: 303-850-0210</TT> <BR><TT>// // /////// direct: 303-740-5611 Opinions expressed are mine,</TT> <BR><TT>/ /////////// fax: 303-779-4025 and do not necessarily</TT> <BR><TT>//////////////// <A HREF="http://www.informix.com">http://www.informix.com</A> reflect those of my employer</TT> <BR><TT> </TT></HTML> --------------33DA67B89825FC7A94AFD0A8--