User Tools

Site Tools


en:include

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:include [2016/08/13 12:45]
admin
en:include [2020/02/28 10:46]
Line 1: Line 1:
-===== Include (Statement) ===== 
  
-==== Format ==== 
- 
-**include** [[stringconstants|"file_name"]] 
- 
-==== Description ==== 
- 
-Loads an external source file at compile (when the run button is pressed) time into the program.  The argument to the Include statement must be a string constant. 
- 
-==== Example ==== 
- 
-== saved as smilerandom.kbs == 
-<code> 
-include "smilesubroutine.kbs" 
-clg 
-while true 
-   call drawsmile(300*rand, 300*rand, 50*rand+5) 
-end while 
-end 
-</code> 
-== saved as smilesubroutine.kbs == 
-<code> 
-subroutine drawsmile(x,y,r) 
-   # draw a smile with the center at x,y and with a radius of r 
-   # position and size everything based on fractional multiples of the radius 
-   color black, yellow 
-   penwidth 1 
-   circle x, y, r 
-   color black 
-   circle x, y+.2*r, .5*r 
-   color yellow 
-   circle x, y, .5*r 
-   color black 
-   eye = int(.1*r) 
-   if eye=0 then eye = 1 
-   circle x-.35*r, y-.3*r, eye 
-   circle x+.35*r, y-.3*r, eye 
-end subroutine 
-</code> 
- 
- 
-==== See Also ==== 
-{{page>en:start#Other Statements and Functions&noheader}} 
- 
-==== History ==== 
-|0.9.9.69|New to Version| 
en/include.txt ยท Last modified: 2020/02/28 10:46 (external edit)