Business Shell (BUSH) Guide
Author: Ken Burtch

Home Page | Introduction | Tutorials | Reference | Packages | Hacking

Packages
4.1 Using Packages
4.2 text_io (Console I/O)
4.3 text_io (File I/O)
4.4 sound
4.5 source_info
4.6 System
4.7 numerics
4.8 strings
4.9 command_line
4.10 lock_files
4.11 cgi
4.12 calendar
4.13 units
4.14 arrays
4.15 files
4.16 db (Database)
4.17 stats
4.18 pen
4.19 mysql
4.20 os
4.21 directory_operations
| This part of the guide contains detailed descriptions of the BUSH built-in packages. ### 4.5 Source_Info Package The BUSH source_info package provides information about the current script. It can be used to create error messages that identify the file and the line number where a problem was encountered. GCC Ada equivalent: GNAT.Source_Info s := source_info.enclosing_entity
Return the name of the script as identified in a procedure block (if any) Example: put_line( source_info.enclosing_entity ); Ada Equivalent: GNAT.Source_Info.Enclosing_Entity Parameters:
s | return value | string | required | the script name
s := source_info.file
Return the name name of the script file, no path information. It is the basename for the script. Example: put_line( source_info.file ); Ada Equivalent: GNAT.Source_Info.File Parameters:
s | return value | string | required | the script file name
p := source_info.line
Return the line number of the line being currently being executed. Example: put_line( source_info.line ); Ada Equivalent: GNAT.Source_Info.Line Parameters:
p | return value | positive | required | the current line number
n := source_info.script_size
Return the size of the compiled script Example: put_line( source_info.script_size ); Restrictions: not allowed with pragma Ada_95 Ada Equivalent: none (AdaScript extension) Parameters:
n | return value | natural | required | the number of bytes
s := source_info.source_location
Return the filename and current line number separated by a colon Example: put_line( source_info.source_location ); Ada Equivalent: GNAT.Source_Info.Source_Location Parameters:
s | return value | string | required | the source location
n := source_info.symbol_table_size
Return the number of symbols (variables, etc.) defined Example: put_line( source_info.symbol_table_size ); Restrictions: not allowed with pragma Ada_95 Ada Equivalent: none (AdaScript extension) Parameters:
n | return value | natural | required | the number of symbols
End of Document