File indexing completed on 2024-05-19 15:23:12

0001 <!DOCTYPE html>
0002 <html><head>
0003 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
0004 <title>brightscript.brs</title>
0005 <meta name="generator" content="KF5::SyntaxHighlighting - Definition (BrightScript) - Theme (Breeze Light)"/>
0006 </head><body style="background-color:#ffffff;color:#1f1c1b"><pre>
0007 
0008 <span style="color:#006e28;">#i am macro</span>
0009 
0010 <span style="color:#ff5500;">library </span><span style="color:#bf0303;">&quot;a&quot;</span>
0011 
0012 <span style="font-weight:bold;">function</span> <span style="color:#644a9b;">myfunc</span> <span style="color:#ca60ca;">(</span> <span style="color:#0057ae;">foo</span> <span style="font-weight:bold;">as</span> <span style="color:#0057ae;">Integer</span> <span style="color:#ca60ca;">,</span> <span style="color:#0057ae;">bar</span> <span style="font-weight:bold;">as</span> <span style="color:#0057ae;">Float</span> <span style="color:#ca60ca;">=</span> <span style="color:#b08000;">3.5</span> <span style="color:#ca60ca;">)</span> <span style="font-weight:bold;">as</span> <span style="color:#0057ae;">Void</span>
0013 <span style="font-weight:bold;">end function</span>
0014 
0015 <span style="font-weight:bold;">sub</span> <span style="color:#644a9b;">mysub</span> <span style="color:#ca60ca;">(</span> <span style="color:#0057ae;">foo</span> <span style="font-weight:bold;">as</span> <span style="color:#0057ae;">Integer</span> <span style="color:#ca60ca;">,</span> <span style="color:#0057ae;">bar</span> <span style="font-weight:bold;">as</span> <span style="color:#0057ae;">Float</span> <span style="color:#ca60ca;">=</span> <span style="color:#b08000;">3.5</span> <span style="color:#ca60ca;">)</span> <span style="font-weight:bold;">as</span> <span style="color:#0057ae;">Void</span>
0016 <span style="font-weight:bold;">end sub</span>
0017 
0018 <span style="color:#898887;">' my comment</span>
0019 
0020 <span style="font-weight:bold;">Function</span> <span style="color:#644a9b;">MyCamelCaseFunction</span><span style="color:#ca60ca;">()</span>
0021     <span style="color:#0057ae;">lvalue</span> <span style="color:#ca60ca;">=</span> <span style="color:#0057ae;">rvalue</span>
0022 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#b08000;">5</span>
0023 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#b08000;">5!</span>
0024 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#b08000;">5#</span>
0025 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#b08000;">5%</span>
0026 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#b08000;">5&amp;</span>
0027 
0028 <span style="color:#0057ae;">a$</span><span style="color:#ca60ca;">=</span><span style="color:#b08000;">5</span>
0029 <span style="color:#0057ae;">a!</span><span style="color:#ca60ca;">=</span><span style="color:#b08000;">5</span>
0030 <span style="color:#0057ae;">a#</span><span style="color:#ca60ca;">=</span><span style="color:#b08000;">5</span>
0031 <span style="color:#0057ae;">a%</span><span style="color:#ca60ca;">=</span><span style="color:#b08000;">5</span>
0032 <span style="color:#0057ae;">a&amp;</span><span style="color:#ca60ca;">=</span><span style="color:#b08000;">5</span>
0033 
0034 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#0057ae;">a$</span>
0035 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#0057ae;">a!</span>
0036 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#0057ae;">a#</span>
0037 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#0057ae;">a%</span>
0038 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#0057ae;">a&amp;</span>
0039 
0040 <span style="color:#644a9b;">foo</span><span style="color:#ca60ca;">()</span>
0041 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">.</span><span style="color:#644a9b;">foo</span><span style="color:#ca60ca;">()</span>
0042 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#0057ae;">a</span><span style="color:#ca60ca;">.</span><span style="color:#644a9b;">foo</span><span style="color:#ca60ca;">()</span>
0043 
0044 <span style="color:#bf0303;text-decoration:underline;">eval</span>=5
0045 <span style="color:#644a9b;font-weight:bold;">eval</span><span style="color:#ca60ca;">()</span>
0046 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">.</span><span style="color:#644a9b;">eval</span><span style="color:#ca60ca;">()</span>
0047 
0048 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#bf0303;text-decoration:underline;">eval</span>
0049 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#644a9b;font-weight:bold;">eval</span><span style="color:#ca60ca;">()</span>
0050 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#0057ae;">a</span><span style="color:#ca60ca;">.</span><span style="color:#644a9b;">eval</span><span style="color:#ca60ca;">()</span>
0051 
0052 <span style="color:#0057ae;">sleep</span><span style="color:#ca60ca;">=</span><span style="color:#b08000;">5</span>
0053 <span style="color:#644a9b;font-weight:bold;">sleep</span><span style="color:#ca60ca;">()</span>
0054 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">.</span><span style="color:#644a9b;">sleep</span><span style="color:#ca60ca;">()</span>
0055 
0056 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#0057ae;">sleep</span>
0057 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#644a9b;font-weight:bold;">sleep</span><span style="color:#ca60ca;">()</span>
0058 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#0057ae;">a</span><span style="color:#ca60ca;">.</span><span style="color:#644a9b;">sleep</span><span style="color:#ca60ca;">()</span>
0059 
0060 <span style="font-weight:bold;">if</span> <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#0057ae;">b</span> <span style="color:#0057ae;">c</span><span style="color:#ca60ca;">=</span><span style="color:#0057ae;">d</span>
0061 <span style="font-weight:bold;">if</span> <span style="color:#0057ae;">a</span> <span style="color:#644a9b;">foo</span><span style="color:#ca60ca;">()</span>
0062 <span style="font-weight:bold;">if</span> <span style="color:#0057ae;">a</span> <span style="font-weight:bold;">then</span> <span style="color:#644a9b;">foo</span><span style="color:#ca60ca;">()</span>
0063 
0064 <span style="font-weight:bold;">if</span> <span style="color:#0057ae;">a</span>
0065 <span style="font-weight:bold;">end if</span>
0066 
0067 <span style="font-weight:bold;">if</span> <span style="color:#0057ae;">a</span> <span style="font-weight:bold;">then</span>
0068 <span style="font-weight:bold;">end if</span>
0069 
0070 <span style="font-weight:bold;">if</span> <span style="color:#0057ae;">a</span>
0071 <span style="font-weight:bold;">else</span> <span style="font-weight:bold;">if</span>
0072 <span style="font-weight:bold;">else</span>
0073 <span style="font-weight:bold;">end if</span>
0074 
0075 <span style="font-weight:bold;">if</span> <span style="color:#0057ae;">a</span>
0076 <span style="font-weight:bold;">elseif</span>
0077 <span style="font-weight:bold;">endif</span>
0078 
0079 <span style="font-weight:bold;">for</span> <span style="font-weight:bold;">each</span> <span style="color:#0057ae;">a</span> <span style="font-weight:bold;">in</span> <span style="color:#0057ae;">b</span>
0080 <span style="font-weight:bold;">end for</span>
0081 
0082 <span style="font-weight:bold;">for</span> <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">=</span><span style="color:#b08000;">1</span> <span style="font-weight:bold;">to</span> <span style="color:#b08000;">10</span> <span style="font-weight:bold;">step</span> <span style="color:#b08000;">2</span>
0083 <span style="font-weight:bold;">endFor</span>
0084 
0085 <span style="font-weight:bold;">for</span> <span style="font-weight:bold;">each</span> <span style="color:#0057ae;">a</span> <span style="font-weight:bold;">in</span> <span style="color:#0057ae;">b</span>
0086 <span style="font-weight:bold;">next</span>
0087 
0088 <span style="font-weight:bold;">while</span> <span style="color:#0057ae;">a</span>
0089 <span style="font-weight:bold;">end while</span>
0090 
0091 <span style="font-weight:bold;">while</span> <span style="color:#0057ae;">a</span>
0092 <span style="font-weight:bold;">endWhile</span>
0093 
0094 <span style="color:#0057ae;">a</span> <span style="color:#ca60ca;">[</span> <span style="color:#bf0303;">&quot;a&quot;</span> <span style="color:#ca60ca;">,</span> <span style="color:#b08000;">1</span><span style="color:#ca60ca;">,</span> <span style="color:#644a9b;">foo</span><span style="color:#ca60ca;">()</span> <span style="color:#ca60ca;">]</span> <span style="color:#ca60ca;">=</span> <span style="color:#b08000;">1</span>
0095 <span style="color:#0057ae;">a</span><span style="color:#ca60ca;">.</span><span style="color:#644a9b;">foo</span><span style="color:#ca60ca;">()</span><span style="color:#ca60ca;">[</span><span style="color:#b08000;">1</span><span style="color:#ca60ca;">]</span><span style="color:#ca60ca;">=</span><span style="color:#b08000;">1</span>
0096 
0097 <span style="color:#0057ae;">a</span> <span style="color:#ca60ca;">=</span> <span style="color:#ca60ca;">{</span>
0098     <span style="color:#0057ae;">a</span> <span style="color:#ca60ca;">:</span> <span style="color:#b08000;">1</span>
0099     <span style="color:#0057ae;">b</span> <span style="color:#ca60ca;">:</span> <span style="color:#bf0303;">&quot;2&quot;</span>
0100     <span style="color:#0057ae;">c</span> <span style="color:#ca60ca;">:</span> <span style="font-weight:bold;">function</span><span style="color:#ca60ca;">()</span> <span style="color:#3daee9;">:</span> <span style="font-weight:bold;">end function</span>
0101 <span style="color:#ca60ca;">}</span>
0102 
0103 <span style="color:#0057ae;">b</span><span style="color:#ca60ca;">.</span><span style="color:#644a9b;">foo</span><span style="color:#ca60ca;">(</span><span style="color:#bf0303;">&quot;string&quot;</span><span style="color:#ca60ca;">,</span><span style="color:#b08000;">1</span><span style="color:#ca60ca;">,</span><span style="color:#ca60ca;">{</span><span style="color:#0057ae;">a</span><span style="color:#ca60ca;">:</span><span style="color:#0057ae;">b</span><span style="color:#ca60ca;">}</span><span style="color:#ca60ca;">,</span><span style="color:#b08000;">1.5</span><span style="color:#ca60ca;">,</span><span style="color:#ca60ca;">[</span><span style="color:#b08000;">1</span><span style="color:#ca60ca;">,</span><span style="color:#b08000;">2</span><span style="color:#ca60ca;">,</span><span style="color:#b08000;">3</span><span style="color:#ca60ca;">]</span><span style="color:#ca60ca;">)</span>
0104 <span style="color:#0057ae;">a</span> <span style="color:#ca60ca;">=</span> <span style="color:#0057ae;">b</span><span style="color:#ca60ca;">.</span><span style="color:#644a9b;">foo</span><span style="color:#ca60ca;">(</span><span style="color:#bf0303;">&quot;string&quot;</span><span style="color:#ca60ca;">,</span><span style="color:#b08000;">1</span><span style="color:#ca60ca;">,</span><span style="color:#ca60ca;">{</span><span style="color:#0057ae;">a</span><span style="color:#ca60ca;">:</span><span style="color:#0057ae;">b</span><span style="color:#ca60ca;">}</span><span style="color:#ca60ca;">,</span><span style="color:#b08000;">1.5</span><span style="color:#ca60ca;">,</span><span style="color:#ca60ca;">[</span><span style="color:#b08000;">1</span><span style="color:#ca60ca;">,</span><span style="color:#b08000;">2</span><span style="color:#ca60ca;">,</span><span style="color:#b08000;">3</span><span style="color:#ca60ca;">]</span><span style="color:#ca60ca;">)</span>
0105 
0106 <span style="color:#0057ae;">unnamed_function</span> <span style="color:#ca60ca;">=</span> <span style="font-weight:bold;">function</span> <span style="color:#ca60ca;">(</span> <span style="color:#0057ae;">a</span> <span style="font-weight:bold;">as</span> <span style="color:#0057ae;">Integer</span> <span style="color:#ca60ca;">)</span> <span style="font-weight:bold;">as</span> <span style="color:#0057ae;">Float</span>
0107 
0108 <span style="color:#0057ae;">a</span> <span style="color:#ca60ca;">=</span> <span style="color:#ca60ca;">+-</span><span style="color:#0057ae;">b</span>
0109 <span style="color:#0057ae;">a</span> <span style="color:#ca60ca;">=</span> <span style="color:#b08000;">&amp;h42abcdef</span>
0110 <span style="color:#0057ae;">c</span> <span style="color:#ca60ca;">=</span> <span style="color:#0057ae;">var</span><span style="color:#ca60ca;">@</span><span style="color:#0057ae;">attr</span>
0111 <span style="font-weight:bold;">end function</span>
0112 
0113 <span style="color:#0057ae;">unnamed_sub</span> <span style="color:#ca60ca;">=</span> <span style="font-weight:bold;">sub</span> <span style="color:#ca60ca;">(</span> <span style="color:#0057ae;">a</span> <span style="font-weight:bold;">as</span> <span style="color:#0057ae;">Integer</span> <span style="color:#ca60ca;">)</span> <span style="font-weight:bold;">as</span> <span style="color:#0057ae;">Void</span>
0114 <span style="font-weight:bold;">end sub</span>
0115 <span style="font-weight:bold;">endFunction</span>
0116 
0117 <span style="font-weight:bold;">sub</span> <span style="color:#644a9b;">exceptions</span><span style="color:#ca60ca;">()</span>
0118     <span style="color:#0057ae;">try</span><span style="color:#ca60ca;">=</span><span style="color:#b08000;">1</span>
0119     <span style="color:#644a9b;">try</span><span style="color:#ca60ca;">()</span>
0120     <span style="color:#0057ae;">try</span><span style="color:#ca60ca;">.</span><span style="color:#0057ae;">foo</span>
0121     <span style="color:#0057ae;">try</span> <span style="color:#0057ae;">foo</span>
0122 
0123     <span style="color:#0057ae;">catch</span><span style="color:#ca60ca;">=</span><span style="color:#b08000;">1</span>
0124     <span style="color:#644a9b;">catch</span><span style="color:#ca60ca;">()</span>
0125     <span style="color:#0057ae;">catch</span><span style="color:#ca60ca;">.</span><span style="color:#0057ae;">foo</span>
0126     <span style="color:#0057ae;">catch</span> <span style="color:#0057ae;">foo</span>
0127 
0128     <span style="font-weight:bold;">try</span>
0129     <span style="font-weight:bold;">catch</span> <span style="color:#0057ae;">foo</span>
0130     <span style="font-weight:bold;">end</span> <span style="font-weight:bold;">try</span>
0131 
0132     <span style="font-weight:bold;">try</span> <span style="color:#898887;">' comment</span>
0133     <span style="font-weight:bold;">endtry</span>
0134 
0135     <span style="font-weight:bold;">throw</span> <span style="color:#ca60ca;">{</span><span style="color:#0057ae;">a</span><span style="color:#ca60ca;">:</span> <span style="color:#bf0303;">&quot;abc&quot;</span><span style="color:#ca60ca;">}</span>
0136 <span style="font-weight:bold;">end sub</span>
0137 
0138 <span style="font-weight:bold;">sub</span> <span style="color:#644a9b;">inline_lambda</span><span style="color:#ca60ca;">()</span>
0139     <span style="color:#644a9b;">a</span><span style="color:#ca60ca;">(</span><span style="color:#0057ae;">a</span><span style="color:#ca60ca;">,</span> <span style="color:#bf0303;">&quot;string&quot;</span><span style="color:#ca60ca;">)(</span><span style="color:#0057ae;">a</span><span style="color:#ca60ca;">,</span> <span style="color:#bf0303;">&quot;string&quot;</span><span style="color:#ca60ca;">)</span>
0140 
0141     <span style="color:#0057ae;">a</span> <span style="color:#ca60ca;">=</span> <span style="font-weight:bold;">sub</span><span style="color:#ca60ca;">()</span>
0142     <span style="font-weight:bold;">end sub</span><span style="color:#ca60ca;">(</span><span style="color:#0057ae;">a</span><span style="color:#ca60ca;">,</span> <span style="color:#bf0303;">&quot;string&quot;</span><span style="color:#ca60ca;">,</span> <span style="color:#ca60ca;">[</span><span style="color:#0057ae;">a</span><span style="color:#ca60ca;">,</span> <span style="color:#644a9b;">foo</span><span style="color:#ca60ca;">(</span><span style="color:#bf0303;">&quot;string&quot;</span><span style="color:#ca60ca;">)</span><span style="color:#ca60ca;">]</span><span style="color:#ca60ca;">)</span>
0143 
0144     <span style="color:#0057ae;">b</span> <span style="color:#ca60ca;">=</span> <span style="font-weight:bold;">function</span><span style="color:#ca60ca;">()</span>
0145     <span style="font-weight:bold;">end function</span><span style="color:#ca60ca;">(</span><span style="color:#0057ae;">a</span><span style="color:#ca60ca;">,</span> <span style="color:#bf0303;">&quot;string&quot;</span><span style="color:#ca60ca;">)</span>
0146 
0147     <span style="color:#0057ae;">c</span> <span style="color:#ca60ca;">=</span> <span style="font-weight:bold;">sub</span><span style="color:#ca60ca;">()</span>
0148     <span style="font-weight:bold;">end sub</span>
0149 <span style="font-weight:bold;">end sub</span>
0150 </pre></body></html>