Category : Files from Magazines
Archive   : DBMS9003.ZIP
Filename : HEAD1.MAR

 
Output of file : HEAD1.MAR contained in archive : DBMS9003.ZIP
Listing 1

* * * * * * * * * * * * * * * * * * * * * * * * * *
* OVERRIDE.PRG *
* *
* Developed using dCLIP - The Clipper Zipper *
* *
* Placed in the Public Domain 1990 *
* (NSA - No Strings Attached) *
* * * * * * * * * * * * * * * * * * * * * * * * * *

CLEAR

*
CENTER(1,"Module to demonstrate parameter passing")
CENTER(2,"When default methods are over ridden")


@ 05,00 SAY " Parameter value before calling the procedure Psquare:"
@ 07,00 SAY "Parameter value after returning from procedure Psquare:"
@ 11,00 SAY " Parameter value before executing the function Fsquare:"
@ 13,00 SAY " Parameter value after returning from function Fsquare:"
@ 15,00 SAY " Value returned by function Fsquare:"
* Set initial value before calling
STORE 5 TO M_Parm
*
* Show initial value
@ 05,60 SAY M_Parm

* Call procedure by VALUE
DO Psquare WITH (M_Parm)

* Show new value
@ 07,60 SAY M_Parm

* Reinitialize value before executing function
STORE 5 TO M_Parm
*
* Show initial value
@ 11,60 SAY M_Parm

* Execute the function by reference
@ 15,60 SAY Fsquare(@M_Parm)
@ 13,60 SAY M_Parm

CENTER(20,"NOTE: Default method of parameter passing has been over ridden!")
WAIT

****************
PROCEDURE Psquare
PARAMETER s
s = s * s
RETURN

***************
FUNCTION Fsquare
PARAMETER s
s = s * s
RETURN (s)

***************
FUNCTION CENTER
PARAMETER line, text
PRIVATE length
*length = LEN(text)
@ line, 40-(LEN(text)/2) SAY text

RETURN (.F.)



  3 Responses to “Category : Files from Magazines
Archive   : DBMS9003.ZIP
Filename : HEAD1.MAR

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/