write_inf_pal - return text of palettes for builder script of the toolbox
txt = write_inf_pal(u,listf,pal_title)
- u : integer. a file descriptor
- listf : vector of strings. list of the files of the palettes
- pal_title : vector of strings. list of the title of the palettes
- txt : vector of strings. the text of the information to load modnum palettes
//write_inf_pal
//Entrée : u file descriptor
// listf : liste de fichiers de palette avec chemin(ex : \macros\scicos_blocks\Pll.cosf)
// pal_title : liste de titres de la librairie (ex:mod_num_pll)
//Sortie txt : information utile de charegement
// ex :mod_num_pal=['mod_num_pll',MODNUM+'\macros\scicos_blocks\Pll.cosf];
// scicos_pal=[scicos_pal;mod_num_pal];
function txt=write_inf_pal(u,listf,pal_title)
if size(listf,'*')==size(pal_title,'*') then
if MSDOS then
listf=pathconvert(listf,%f,%t,'w');
end
fprintf(u,"\n%s\n",'//Add mod_num palette');
tt_loader=['mod_num_pal=[';]
for i=1:size(listf,"*")
tt_loader=[tt_loader;''''+pal_title(i)+''',MODNUM+'''+listf(i)+''';'];
end
tt_loader(i+1)=tt_loader(i+1)+'];';
tt_loader=[tt_loader;'scicos_pal=[scicos_pal;mod_num_pal];';''];
fprintf(u,"%s\n",tt_loader);
txt=tt_loader;
else
printf("listf and pal_title must have the same size");
abort
end
endfunction
IRCOM Group
Alan Layec