sharing_20private_20variables
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
sharing_20private_20variables [2020/08/09 10:34] – Modified array example richardrussell | sharing_20private_20variables [2024/01/05 00:21] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 35: | Line 35: | ||
\\ This method relies on creating a **structure** to hold the private data, as follows:\\ \\ | \\ This method relies on creating a **structure** to hold the private data, as follows:\\ \\ | ||
<code bb4w> | <code bb4w> | ||
- | | + | |
- | PRIVATE ps{} | + | PRIVATE ps{} |
- | PROCprivate(ps{}) | + | PROCprivate(ps{}) |
- | REM. Code for PROCone goes here. | + | REM. Code for PROCone goes here. |
- | REM. Private variables are ps.alpha, ps.beta%, ps.gamma$ | + | REM. Private variables are ps.alpha, ps.beta%, ps.gamma$ |
- | ENDPROC | + | ENDPROC |
- | | + | |
- | PRIVATE ps{} | + | PRIVATE ps{} |
- | PROCprivate(ps{}) | + | PROCprivate(ps{}) |
- | REM. Code for FNtwo goes here. | + | REM. Code for FNtwo goes here. |
- | REM. Private variables are ps.alpha, ps.beta%, ps.gamma$ | + | REM. Private variables are ps.alpha, ps.beta%, ps.gamma$ |
- | = returnvalue | + | = returnvalue |
- | | + | |
- | PRIVATE p{} | + | PRIVATE p{} |
- | DIM p{alpha, beta%, gamma$} | + | DIM p{alpha, beta%, gamma$} |
- | !(^t{}+0) = !(^p{}+0) | + | |
- | !(^t{}+4) = !(^p{}+4) | + | |
- | ENDPROC | + | ENDPROC |
</ | </ | ||
The **PROCprivate** procedure sets the supplied structure parameter to point to the private structure declared therein, allowing any routine which calls this procedure to access the private data.\\ \\ You can use the same technique to share PRIVATE arrays:\\ \\ | The **PROCprivate** procedure sets the supplied structure parameter to point to the private structure declared therein, allowing any routine which calls this procedure to access the private data.\\ \\ You can use the same technique to share PRIVATE arrays:\\ \\ |
sharing_20private_20variables.1596969255.txt.gz · Last modified: 2024/01/05 00:16 (external edit)