Navigation:  Reference > Functions >

CompileSource()

Print this Topic Previous pageReturn to chapter overviewNext page

 

COMPILE_SRC(1,2,3)

 

PURPOSE

This function compile multiple lines and add the compiled code to that already loaded when the program was run.

 

PARTS

 

1 f/c/eRequired - What to do:

 

       compInt - The lines to be compiled are passed as a single alpha (string) field.

       compFile - The lines to be compiled are contained within a file.

 

2 f/c/eRequired - This depends on what you specified for part 1:

 

       compInt - This is a single string that contains all the lines to be compiled.  Each line is separated by a cr/lf character pair.  This is exactly the way the output is received from the STRINGS() function when you use the stGetText option.

       compFile - This is the name of the file to be compiled.  This must include a full path if it's not in the same subdirectory as the original program.

 

3 f/c/eIf you have specified compInt in part 1, this is a name to be associated with the lines that are compiled.  Similar to a file name.  It has no effect other than to use the name during runtime in the TRACE command or if an error occurs and you have the Debug flag set in the compiler.

 

RETURN TYPE - L

Returns True if the lines were compiled correctly, False if not.

 

COMMENTS

This function will compile the lines and put them into the buffers for the current program.  The resulting code can be called just as though it were part of the original program.  If you refer to line labels that are not part of the code compiled, it will search through the existing program to see if they already exist.  The same applies to field names.

 

NOTE:  Any label referred to in the new code will override any existing label of the same name.  This means you can change what happens during an event call, or a standard GOSUB by reusing the same label name but executing a completely different set of lines, those compiled through this command.  You can still execute the previous lines also through the use of the INHERITED command.

 

 

 


Page url: http://www.cassoftware.com/tas/manual/compilesource().htm