Files
harbour-core/harbour/website/samples/byref.prg.html
Viktor Szakats 300160d8b0 2012-09-22 12:05 UTC+0200 Viktor Szakats (harbour syenar.net)
+ website
    + Added Harbour website (except art, docs and stat subdirs)
    ; TODO: configure automatic mechanism to extract site from
            here and regularly updload to sf.net web area
    ; TODO: Clean HTML code, remove unused picture/files, avoid JS
            Any takers?
    ; NOTE: Please make modifications to website code only in
            SVN, then upload the content to web server manually.
            IOW never update on web server directly.
2012-09-22 10:17:39 +00:00

82 lines
5.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>byref.prg</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16386" name=GENERATOR>
<STYLE type=text/css>
<!--
body { color: #000000; background-color: #FFFFFF; }
.any1-activedot { color: #800080; }
.any1-comment { color: #008080; }
.any1-constant { color: #800080; }
.any1-escapeampersand { color: #00FF00; font-weight: bold; }
.any1-function { color: #808000; }
.any1-identifier { color: #000000; }
.any1-number { color: #FF0000; }
.any1-preprocessor { }
.any1-reservedword { color: #800000; }
.any1-space { }
.any1-string { color: #0000FF; }
.any1-symbol { }
.any1-variable { color: #808000; }
-->
</STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<PRE><CODE><SPAN style="FONT: 10pt Courier New"><SPAN class=any1-comment>// Managing variables by reference
</SPAN><SPAN class=any1-reservedword>function</SPAN><SPAN class=any1-space> </SPAN><SPAN class=any1-variable>Main</SPAN><SPAN class=any1-symbol>()
</SPAN><SPAN class=any1-reservedword>STATIC</SPAN><SPAN class=any1-space> s:=</SPAN><SPAN class=any1-number>10
</SPAN><SPAN class=any1-space> </SPAN><SPAN class=any1-reservedword>local</SPAN><SPAN class=any1-space> x := </SPAN><SPAN class=any1-number>0
</SPAN><SPAN class=any1-space> </SPAN><SPAN class=any1-function>QOut</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>"Managing LOCAL variables by reference"</SPAN><SPAN class=any1-space> )
</SPAN><SPAN class=any1-function>Qout</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>'In main before ref1 x='</SPAN><SPAN class=any1-symbol>, x )
</SPAN><SPAN class=any1-variable>ref1</SPAN><SPAN class=any1-symbol>( @x )
</SPAN><SPAN class=any1-function>Qout</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>' In main after ref1 x='</SPAN><SPAN class=any1-symbol>, x )
</SPAN><SPAN class=any1-function>QOut</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>"Managing STATIC variables by reference"</SPAN><SPAN class=any1-space> )
</SPAN><SPAN class=any1-function>Qout</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>'In main before ref1 s='</SPAN><SPAN class=any1-symbol>, s )
</SPAN><SPAN class=any1-variable>ref1</SPAN><SPAN class=any1-symbol>( @s )
</SPAN><SPAN class=any1-function>Qout</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>' In main after ref1 s='</SPAN><SPAN class=any1-symbol>, s )
</SPAN><SPAN class=any1-reservedword>return</SPAN><SPAN class=any1-space> nil
</SPAN><SPAN class=any1-reservedword>function</SPAN><SPAN class=any1-space> </SPAN><SPAN class=any1-variable>ref1</SPAN><SPAN class=any1-symbol>( x )
x++
</SPAN><SPAN class=any1-function>Qout</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>' In ref1 before ref2 ='</SPAN><SPAN class=any1-symbol>, x )
</SPAN><SPAN class=any1-variable>Ref2</SPAN><SPAN class=any1-symbol>( @x )
</SPAN><SPAN class=any1-function>Qout</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>' In ref1 after ref2 ='</SPAN><SPAN class=any1-symbol>, x )
</SPAN><SPAN class=any1-reservedword>return</SPAN><SPAN class=any1-space> nil
</SPAN><SPAN class=any1-reservedword>function</SPAN><SPAN class=any1-space> </SPAN><SPAN class=any1-variable>ref2</SPAN><SPAN class=any1-symbol>( x )
x++
</SPAN><SPAN class=any1-function>Qout</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>' In ref2 before ref3 ='</SPAN><SPAN class=any1-symbol>, x )
</SPAN><SPAN class=any1-variable>Ref3</SPAN><SPAN class=any1-symbol>( @x )
</SPAN><SPAN class=any1-function>Qout</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>' In ref2 after ref3 ='</SPAN><SPAN class=any1-symbol>, x )
</SPAN><SPAN class=any1-reservedword>return</SPAN><SPAN class=any1-space> nil
</SPAN><SPAN class=any1-reservedword>function</SPAN><SPAN class=any1-space> </SPAN><SPAN class=any1-variable>ref3</SPAN><SPAN class=any1-symbol>( x )
</SPAN><SPAN class=any1-reservedword>STATIC</SPAN><SPAN class=any1-space> a
x++
</SPAN><SPAN class=any1-function>Qout</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>' In ref3 before ref4 ='</SPAN><SPAN class=any1-symbol>, x )
a ={ x, x }
</SPAN><SPAN class=any1-variable>Ref4</SPAN><SPAN class=any1-symbol>( @a )
</SPAN><SPAN class=any1-function>Qout</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>' In ref3 after ref4 ='</SPAN><SPAN class=any1-symbol>, x )
</SPAN><SPAN class=any1-reservedword>return</SPAN><SPAN class=any1-space> nil
</SPAN><SPAN class=any1-reservedword>function</SPAN><SPAN class=any1-space> </SPAN><SPAN class=any1-variable>ref4</SPAN><SPAN class=any1-symbol>( a )
a[ </SPAN><SPAN class=any1-number>1</SPAN><SPAN class=any1-space> ]++
</SPAN><SPAN class=any1-function>Qout</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>' In ref4 ='</SPAN><SPAN class=any1-symbol>, a[ </SPAN><SPAN class=any1-number>1</SPAN><SPAN class=any1-space> ] )
</SPAN><SPAN class=any1-reservedword>return</SPAN><SPAN class=any1-space> nil
</SPAN></SPAN>
</CODE></PRE></BODY></HTML>