User Tools

Site Tools


es:include

Differences

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

Link to this comparison view

es:include [2016/01/01 22:43]
es:include [2020/02/28 10:46] (current)
Line 1: Line 1:
 +===== Include (Comando) =====
  
 +==== Formato ====
 +
 +**include** "//file_name//"
 +
 +==== Descripción ====
 +
 +Incluye un fichero fuente en tiempo de ejecución en el programa. El argumento al comando (file_name) debe ser una variable alfanumérica o una cadena o un literal. \\ 
 +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.
 +
 +==== Ejemplo ====
 +
 +== 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>
 +
 +
 +==== Ver También ====
 +{{page>en:start#Other Statements and Functions&noheader}}
 +
 +==== Historial ====
 +|0.9.9.69|Disponible desde Versión|