1 %> @ingroup globals codegen
3 %> @brief Adds
string to
auto-generated code buffer (without executing)
6 %> @param s Piece of code
7 %> @param title Unused at the moment
9 global handles_irootlab IRCODE;
13 ircode_add([
'% ', sprintf(
'First code sent @ %s.\n', datestr(now))]);
16 if isempty(IRCODE.filename)
17 IRCODE.filename = fullfile(pwd(),
find_filename('irr_macro', '', 'm'));
18 ircode_add(['% Log filename: ', IRCODE.filename, 10]);
25 h = fopen(IRCODE.filename,
'w');
26 fwrite(h, sprintf(
'%s', IRCODE.s{:}));
28 fprintf(
'ERROR trying to save file %s: %s\nLog was not saved.\n', IRCODE.filename, ME15.message);
36 if ~isempty(handles_irootlab)
37 set(handles_irootlab.editCode, 'String', IRCODE.s);
38 set(handles_irootlab.text_codefilename, 'String', ['File ' IRCODE.filename]);
function ircode_add(in s, in title)
function ircode_eval(in s, in title)
function find_filename(in prefix, in suffix, in extension, in flag_return_ext)