// export an image file if it doesn't exist
files = gif_tlbx + "/" + names(i) + [".png" ".jpg" ".gif"];
- if ~or(isfile(files)) then
+ files = files(isfile(files));
+ if files == [] then
+ filename = gif_tlbx + "/" + names(i) + ".gif";
if ~generateBlockImage(block, gif_tlbx, names(i), "gif", %t) then
- error(msprintf(gettext("%s: Unable to export %s to %s.\n"),"tbx_build_blocks",names(i), files(i)));
+ error(msprintf(gettext("%s: Unable to export %s to %s.\n"),"tbx_build_blocks",names(i), filename));
end
end
// export a schema file if it doesn't exist
files = svg_tlbx + "/" + names(i) + [".svg" ".png" ".jpg" ".gif"];
- if ~or(isfile(files)) then
+ files = files(isfile(files));
+ if files == [] then
+ filename = svg_tlbx + "/" + names(i) + ".svg";
if ~generateBlockImage(block, svg_tlbx, names(i), "svg", %f) then
- error(msprintf(gettext("%s: Unable to export %s to %s.\n"),"tbx_build_blocks",names(i), files(i)));
+ error(msprintf(gettext("%s: Unable to export %s to %s .\n"),"tbx_build_blocks",names(i), filename));
end
end
end
endfunction
-