When I create a Stored Procedure, where should I place my statements to
clear the variables while also maintaining the returned value?
For example:
========================================================================
====================
-- ************************************************
-- *** ReturnHHMMSSString.PRC *********************
-- ************************************************
-- *** 2008.05.23, JSW ****************************
-- ************************************************
-- *** Originally derived/extended fm Razzak's ***
-- *** Stopwatch/Form Timer example(s). ***
-- *** Borrowed from PACE:spReturnETString.RMD. ***
-- *** NOTE: Will return fractions of seconds ***
-- *** if TIME FORMAT is so defined ... ***
-- ************************************************
{PUT spReturnHHMMSSString.PRC AS spReturnHHMMSSString vElapsedTM REAL
RETURN TEXT (12)}
SET VAR vET_HH_Text TEXT
SET VAR vET_MM_Text TEXT
SET VAR vET_SS_Text TEXT
...
-- *** MM:SS Time String ***
SET VAR vETString=(.vET_HH_Text + ':' + .vET_MM_Text + ':' +
.vET_SS_Text)
RETURN .vETString
CLEAR VAR vETString, vET_HH_Text, vET_MM_Text, vET_SS_Text
RETURN
========================================================================
====================
In this code, my value is returned just fine, but the CLEAR VAR
statement doesn't appear to execute. Does the statement, RETURN
.vETString, not only assign the value of vETString to STP_RETURN but,
also, return control to the caller, therefore "bypassing" the CLEAR VAR
statement?
If this is true, what is the "best practice" for managing this
situation?
Thanks,
Steve in Memphis
(PS - I snipped the code f/clarity, but I'd be happy to share it if
anyone likes. It returns an elapsed-time string, ex: '01:22:32.071' for
the difference between 2 TIME||DATETIME values. I assume a TIME FORMAT
'HH:MM:SS.SSS', but the routine could be modified to handle a different
setting. Original credit to and thanks fm me are Razzak's/RBTI's for
the Stopwatch/Form Timer examples created a while back.)
J. Stephen Wills
Program Manager, Research Informatics
Office of the Vice Chancellor for Research
University of Tennessee Health Science Center
62 S. Dunlap, Suite 400
Memphis, TN 38163
Office : 901-448-2389
FAX : 901-448-7133
--- RBASE-L
=======================3D=======================3
D=
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]
(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
=======================3D=======================3
D=
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
=======================3D=======================3
D=
TO UNSUBSCRIBE:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
=======================3D=======================3
D=
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
=======================3D=======================3
D=