× 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.



Hi David -

On Wed, 14 Oct 2009 08:27:14 +0200, David FOXWELL
<David.FOXWELL@xxxxxxxxx> wrote:

I would also prefer 2 procedures. But in Ken's example, the code that is set is a variable that is local to the procedure. Surely that is an advantage compared to using a global variable. If I use Set then Get, where would Get find the variable? Could I wrap InzTransactionCode with SetTransactionCode and GetTransactionCode?

I'll state again for the record that in this situation I personally
would just use a global variable.

However given that you want to protect this variable, Kurt's
suggestion of having wrapper procedures around the SetGet procedure is
a good one.

Only the Set procedure needs to be EXPORTed. The Get procedure does
not need to be EXPORTed because it will only be called by other
procedures in the same module. The SetGet procedure does not need to
be EXPORTed because it will only be called by the Set procedure and
the Get procedure.

If using the wrappers, personally I would not use a return value with
the SetGet procedure. I would create the procedure with two required
parameters. The first parameter would be the transaction code. The
second parameter would be a logical indicator where *ON means it is
Set mode and *OFF means it is Get mode. For this procedure the
transaction code would not be CONST (_could_ not be CONST in fact).
The logical indicator would be CONST.

The Set wrapper procedure would have the transaction code as CONST. It
would just have to move the value to an local variable to call the
SetGet procedure in Set mode.

The Get wrapper procedure would still do a RETURN of the transaction
code.

Ken
Opinions expressed are my own and do not necessarily represent the views
of my employer or anyone in their right mind.

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.