gb_func::gb__get_file - Get Text File into a .gbf String

Syntax

Loading gb__gbf_data$ from the .gbf file:

call "gb_func::gb__get_file","my.gbf",gb__gbf_data$,"",gb__err$"

Loading any other file after initializing gb__gbf_data$

call "gb_func::gb__get_file",filename$,gb__file$,gb__gbf_data$,gb__err$"

Note (1): Only line feeds ($0a$) are recognized as line terminators. Any carriage returns ($0d$) in the file are discarded and will not appear in gb__file$.

Note (2): Variable substitution is done according to the following rules: Anything in the text file formatted like {_variable name_} will be converted to the value of the variable "variable name" from the [Program] block in gb__gbf_data$. This is completely open-ended; users are free to define their own [Program] variables. For example, if the following appears in the [Program] block of gb__gbf_data$:

Copyright = Copyright (C) 1998 My Company Name Here

Assuming the following appears as a line in the program:

REM ' {_Copyright_}

The final generated program line will look like this:

REM ' Copyright (C) 1998 My Company Name Here

To turn off variable substitution, pass gb__gbf_data$ as "".

Note (3): gb__err$ will be null for success; non-null indicates some error occurred, typically on opening the file.