× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I admit I am probably using too many global variables. I work in an environment where the norm seems to be copy and paste code rather than reuse it. If I were to pass parameters instead, the procedures would remain internal to that module so I'd then probably get my backside kicked for taking too long setting up prototypes and the rest for subprocedures that will never be reused. Most of my subprocedures just seem to be there make the code readable and avoid coding monoliths.

I'd really like to see an example of a program that doesn't use global variables.

-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Schmidt, Mihael
Envoyé : mardi 16 novembre 2010 12:43
À : RPG programming on the IBM i / System i
Objet : RE: Initialisation of global variables between calls

Why use global variables at all? If you need to keep data
between calls you can use the static keyword in most cases.

Mihael

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Birgitta Hauser
Sent: Tuesday, November 16, 2010 12:16 PM
To: 'RPG programming on the IBM i / System i'
Subject: AW: Initialisation of global variables between calls

Why not simply adding an internal procedure where all global
variables get initialized (or reset)?
This procedure can be called by the main procedure (like any
other procedure).


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.