* website/samples/*.*.html
% pointed compatibility .js link to the project's cloud server
79 lines
1.6 KiB
HTML
79 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/xregexp/2.0.0/xregexp-min.js"></script>
|
|
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/xregexp/2.0.0/backcompat.js"></script>
|
|
<script type="text/javascript" src="/js/shCore.js"></script>
|
|
<script type="text/javascript" src="/js/shBrushHarbour.js"></script>
|
|
<link href="/css/shCore.css" rel="stylesheet" type="text/css" />
|
|
<link href="/css/shThemeDefault.css" rel="stylesheet" type="text/css" />
|
|
<script type="text/javascript">SyntaxHighlighter.all()</script>
|
|
</head>
|
|
<body>
|
|
|
|
<script type="syntaxhighlighter" class="brush: harbour; light: true"><![CDATA[
|
|
|
|
// Managing variables by reference
|
|
|
|
PROCEDURE Main()
|
|
|
|
STATIC s_x := 10
|
|
|
|
LOCAL x := 0
|
|
|
|
? "Managing LOCAL variables by reference"
|
|
? "In main before ref1 x=", x
|
|
ref1( @x )
|
|
? " In main after ref1 x=", x
|
|
|
|
|
|
? "Managing STATIC variables by reference"
|
|
? "In main before ref1 s=", s_x
|
|
ref1( @s_x )
|
|
? " In main after ref1 s=", s_x
|
|
|
|
RETURN
|
|
|
|
PROCEDURE ref1( x )
|
|
|
|
x++
|
|
? " In ref1 before ref2 =", x
|
|
Ref2( @x )
|
|
? " In ref1 after ref2 =", x
|
|
|
|
RETURN
|
|
|
|
PROCEDURE ref2( x )
|
|
|
|
x++
|
|
? " In ref2 before ref3 =", x
|
|
Ref3( @x )
|
|
? " In ref2 after ref3 =", x
|
|
|
|
RETURN
|
|
|
|
PROCEDURE ref3( x )
|
|
|
|
STATIC s_a
|
|
|
|
x++
|
|
? " In ref3 before ref4 =", x
|
|
s_a := { x, x }
|
|
Ref4( @s_a )
|
|
? " In ref3 after ref4 =", x
|
|
|
|
RETURN
|
|
|
|
PROCEDURE ref4( a )
|
|
|
|
a[ 1 ]++
|
|
? " In ref4 =", a[ 1 ]
|
|
|
|
RETURN
|
|
|
|
]]></script>
|
|
|
|
</body>
|
|
</html>
|