In addition to using subroutines, when developing with UniVerse and SB+ I often have one application handle many, if not all of the screen and report processing. This helps keep things in one place. For this I use the ON GOSUB construct of the BASIC language. It's worth noting depending on its application or relevance.
>I've been teaching UniBasic for over 10 years and here are some of the >methods I teach: > >* Subroutines should only have one job. >* Subroutines should be short. (less than 10 lines) >* Subroutines should have one entrance and one exit. >* Use meaningful variable names and subroutine names. >* Be consistent in your naming conventions. >* Don't hard code Numbers, Strings, or Attributes. >* Use CASE over IF...THEN when there are more than two options. >* Use LOOP...WHILE/UNTIL...REPEAT over FOR...NEXT with IF Conditions. >* Use REMOVE to traverse a dynamic array. >* Use a Simple Variable on Conditional Statements. >* Use UniData Internal Variables whenever possible; i.e. @AM, @VM, @DATE. > >Thank you, >David A. Green >DAG Consulting >(480) 813-1725 >www.dagconsulting.com > > >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of Fawaz Ashraff >Sent: Tuesday, September 27, 2005 8:23 AM >To: u2-users@listserver.u2ug.org >Subject: [U2] Good Programming Practice Question......... > >Hi All, > >We are planning to train some of our new programmers >to use good programming practices when using U2 Basic. >I can remember in Unidata days us having some tech >support documents that talked about this. Example such >as when is the best time to use CASE instead IF & ELSE >or not to use GOTO statments. > >I am sure some of you may have some input in this >topic. If you have some documents, notes or thoughts >on this, can you please share with us? > >When I get all the technical tips, I can compile this >to a document and share with our new programmers as >well as U2 listserver community. > >Thanks > >Mohamed ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/