1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2012 - DIGITEO - Antoine ELIAS
3 // Copyright (C) 2012 - DIGITEO - Vincent COUVERT
5 // This file must be used under the terms of the CeCILL.
6 // This source file is licensed as described in the file COPYING, which
7 // you should have received as part of this distribution. The terms
8 // are also available at
9 // http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
11 function %_sodload(%__filename__, varargin)
13 function v = getScilabFileVersion(%__filename__)
14 verStr = h5readattr(%__filename__, "/", "SCILAB_scilab_version")
15 [a,b,c,d] = regexp(verStr, "/scilab-.*(\d)\.(\d)\.(\d)/");
16 if size(d, "*") == 3 then
17 v = evstr(d(1)) * 100 + evstr(d(2)) * 10 + evstr(d(3));
19 error("unable to find file version: %s", %__filename__);
23 function [varValues] = %__convertVariable__(varValues, varNames)
24 for i = 1:size(varValues)
25 if typeof(varValues(i)) == "ScilabMatrixHandle" then
26 //convert tlist to handle
27 varValues(i) = createMatrixHandle(varValues(i));
28 elseif typeof(varValues(i)) == "ScilabMacro" then
29 //convert tlist to macro
30 varValues(i) = createMacro(varValues(i), varNames(i));
31 elseif isList(varValues(i)) then
33 varValues(i) = parseList(varValues(i));
38 function result = isList(var)
42 if or(type(var) == [15, 16, 17]) then
49 function varValue = parseList(varValue)
50 if typeof(varValue)=="list" then
51 for i = definedfields(varValue)
52 if typeof(varValue(i)) == "ScilabMatrixHandle" then
53 varValue(i) = createMatrixHandle(varValue(i));
54 elseif typeof(varValue(i)) == "ScilabMacro" then
55 //convert tlist to macro
56 varValue(i) = createMacro(varValue(i), "function");
57 elseif isList(varValue(i)) then
58 varValue(i) = parseList(varValue(i));
60 varValue(i) = varValue(i);
64 fieldNb = size(getfield(1, varValue), "*");
65 for kField = 2:fieldNb // Do not inspect first field (field names)
66 fieldValue = getfield(kField, varValue);
67 if typeof(fieldValue) == "ScilabMatrixHandle" then
68 fieldValue = createMatrixHandle(fieldValue);
69 elseif typeof(fieldValue) == "ScilabMacro" then
70 //convert tlist to macro
71 fieldValue = createMacro(fieldValue, "function");
72 elseif isList(fieldValue) then
73 fieldValue = parseList(fieldValue);
75 setfield(kField, fieldValue, varValue);
80 function h = createMatrixHandle(matrixHandle)
82 if typeof(matrixHandle) <> "ScilabMatrixHandle" then
86 for i = prod(matrixHandle.dims):-1:1
88 newItem = createSingleHandle(matrixHandle.values(i));
94 if or(fieldnames(matrixHandle.values(i))=="user_data") then // TODO Remove after graphic branch merge
95 if isList(matrixHandle.values(i).user_data) then
96 set(h($), "user_data", parseList(matrixHandle.values(i).user_data));
97 elseif typeof(matrixHandle.values(i).user_data) == "ScilabMatrixHandle" then
98 set(h($), "user_data", createMatrixHandle(matrixHandle.values(i).user_data));
104 function h = createSingleHandle(item)
107 h = createFigure(item);
109 h = createAxes(item);
111 h = createPolyline(item);
113 h = createPlot3d(item);
115 h = createFac3d(item);
117 h = createCompound(item);
119 h = createRectangle(item);
123 h = createChamp(item);
125 h = createSegs(item);
127 h = createGrayplot(item);
129 h = createMatplot(item);
133 h = createLegend(item);
135 h = createText(item);
137 h = createAxis(item);
139 h = createuimenu(item);
141 h = createuicontextmenu(item);
143 h = createuicontrol(item);
145 h = createDatatip(item);
147 h = createLight(item);
149 error("handle of type " + item.type + " unhandled");
157 function h = createFigure(figureProperties)
158 fields = fieldnames(figureProperties);
161 if or(fields=="resize") then
162 if figureProperties.menubar<>"figure" ..
163 | figureProperties.toolbar<>"figure" ..
164 | figureProperties.dockable<>"on" ..
165 | figureProperties.default_axes<>"on" then
166 // File created by Scilab 5.5.0 or more
167 h = figure("menubar", figureProperties.menubar, ...
168 "toolbar", figureProperties.toolbar, ...
169 "dockable", figureProperties.dockable, ...
170 "default_axes", figureProperties.default_axes, ...
173 fields(fields=="menubar") = [];
174 fields(fields=="toolbar") = [];
175 fields(fields=="dockable") = [];
176 fields(fields=="default_axes") = [];
177 fields(fields=="visible") = [];
183 if isempty(winsid()) then
184 h = figure("visible", "off");
192 // Following propeties will be set after all other ones
193 isVisible = figureProperties.visible;
194 fields(fields=="visible") = [];
195 resizefcn = figureProperties.resizefcn;
196 fields(fields=="resizefcn") = [];
197 event_handler = figureProperties.event_handler;
198 fields(fields=="event_handler") = [];
201 fields(fields=="figure_id") = [];
203 h.figure_position=figureProperties.figure_position;
204 fields(fields=="figure_position") = [];
205 // set auto_resize first otherwise viewport modification may not have any effect.
206 h.auto_resize = figureProperties.auto_resize;
207 fields(fields=="auto_resize") = [];
208 h.figure_size = figureProperties.figure_size;
209 fields(fields=="figure_size") = [];
210 // set axes_size last because it's more important than figure_size
211 h.axes_size = figureProperties.axes_size;
212 fields(fields=="axes_size") = [];
214 for i = 1:size(fields, "*")
215 if fields(i) == "children" then
216 c = figureProperties(fields(i));
218 createSingleHandle(c.values(s));
220 xsetech(wrect=[0 0 .1 .1])
221 createSingleHandle(c.values(i));
224 set(h, fields(i), figureProperties(fields(i)));
228 h.resizefcn = resizefcn;
229 h.event_handler = event_handler;
230 h.visible = isVisible;
236 function h = createLabel(labelProperties, h)
237 fields = fieldnames(labelProperties);
239 for i = 1:size(fields, "*")
240 set(h, fields(i), labelProperties(fields(i)));
247 function h = createTicks(ticksProperties)
248 h = tlist(["ticks","locations","labels"], [], []);
249 fields = fieldnames(ticksProperties);
250 for i = 1:size(fields, "*")
251 h(fields(i)) = ticksProperties(fields(i));
258 function h = createAxes(axesProperties)
259 // Hack to determine whether %h_load has been called by the %h_copy macro
260 // in which case a new Axes object is created
262 [lnums, fnames] = where();
263 ind = grep(fnames, "%h_copy");
264 if ~isempty(ind) then
269 fields = fieldnames(axesProperties);
272 // Get log_flags to be sure to set them after data_bounds
273 log_flags = axesProperties.log_flags;
274 fields(fields=="log_flags") = [];
276 // Get mark_mode to be sure to set it after mark_style
277 mark_mode = axesProperties.mark_mode;
278 fields(fields=="mark_mode") = [];
280 // Get auto_ticks to be sure to set it after ticks labels
281 auto_ticks = axesProperties.auto_ticks;
282 fields(fields=="auto_ticks") = [];
283 auto_margins = axesProperties.auto_margins;
284 fields(fields=="auto_margins") = [];
286 for i = 1:size(fields, "*")
287 if or(fields(i) == ["title","x_label","y_label","z_label"]) then
288 createLabel(axesProperties(fields(i)), h(fields(i)));
289 elseif or(fields(i) == ["x_ticks", "y_ticks", "z_ticks"]) then
290 set(h, fields(i), createTicks(axesProperties(fields(i))));
291 elseif fields(i) == "children" then
292 createMatrixHandle(axesProperties(fields(i)));
293 elseif fields(i) == "clip_state" then
294 if axesProperties.clip_state=="on" then
295 set(h,"clip_box",axesProperties.clip_box);
297 set(h,"clip_state", axesProperties.clip_state);
298 elseif fields(i) == "clip_box" then
299 // managed with 'clip_state'
300 elseif fields(i) == "data_bounds" then
301 set(h, "data_bounds", axesProperties.data_bounds);
302 set(h, "log_flags", log_flags);
303 elseif fields(i) == "mark_style" then
304 set(h, "mark_style", axesProperties.mark_style);
305 set(h, "mark_mode", mark_mode);
307 set(h, fields(i), axesProperties(fields(i)));;
311 set(h, "auto_ticks", auto_ticks);
312 set(h, "auto_margins", auto_margins);
316 if ~isempty(%LEG) then
317 // Get handles from paths
318 links=getlinksfrompath(h, %LEG.paths)
319 if ~isempty(links) then
320 L = captions(links, %LEG.text)
321 L.visible = %LEG.visible
322 L.font_style = %LEG.font_style
323 L.font_size = %LEG.font_size
324 L.font_color = %LEG.font_color
325 L.fractional_font = %LEG.fractional_font
327 L.legend_location = %LEG.legend_location
328 L.position = %LEG.position
329 L.line_mode = %LEG.line_mode
330 L.thickness = %LEG.thickness
331 L.foreground = %LEG.foreground
332 L.fill_mode = %LEG.fill_mode
333 L.background = %LEG.background
334 if %LEG.clip_state=="on" then
335 L.clip_box = %LEG.clip_box
337 L.clip_state = %LEG.clip_state
338 L.user_data = %LEG.user_data
340 warning(msprintf(_("%s: Legend does not fit with the current context. Skipped\n"), "load"));
350 function h = createPolyline(polylineProperties)
351 fields = fieldnames(polylineProperties);
354 xpoly(polylineProperties.data(:,1), polylineProperties.data(:,2))
358 if polylineProperties.clip_state=="on" then
359 set(h, "clip_box", polylineProperties.clip_box)
361 set(h, "clip_state", polylineProperties.clip_state);
362 fields(fields=="clip_box") = [];
363 fields(fields=="clip_state") = [];
365 if polylineProperties.interp_color_mode=="on" & ~isempty(polylineProperties.interp_color_vector) then
366 set(h, "interp_color_vector", polylineProperties.interp_color_vector);
367 set(h, "interp_color_mode", polylineProperties.interp_color_mode);
369 if ~isempty(polylineProperties.interp_color_vector) then
370 h.interp_color_vector = polylineProperties.interp_color_vector;
372 h.interp_color_mode = polylineProperties.interp_color_mode;
374 fields(fields=="interp_color_vector") = [];
375 fields(fields=="interp_color_mode") = [];
377 // Get mark_mode to be sure to set it after mark_style
378 mark_mode = polylineProperties.mark_mode;
379 fields(fields=="mark_mode") = [];
384 for i = 1:size(fields, "*")
385 if fields(i) == "mark_style" then
386 set(h, "mark_style", polylineProperties.mark_style);
387 set(h, "mark_mode", mark_mode);
388 elseif fields(i) == "children" then
389 createMatrixHandle(polylineProperties(fields(i)));
390 elseif fields(i) == "datatips" then
391 createMatrixHandle(polylineProperties(fields(i)));
393 h(fields(i)) = polylineProperties(fields(i));
397 clearglobal %POLYLINE
404 function h = createPlot3d(plot3dProperties)
405 h = createSurface(plot3dProperties);
411 function h = createFac3d(fac3dProperties)
412 h = createSurface(fac3dProperties);
418 function h = createSurface(surfaceProperties)
419 fields = fieldnames(surfaceProperties);
421 // plot3d modify the axes properties
426 rotation_angles = a.rotation_angles;
427 axes_visible = a.axes_visible;
430 x_label_visible = a.x_label.visible;
431 y_label_visible = a.y_label.visible;
432 z_label_visible = a.z_label.visible;
433 x_label_text = a.x_label.text;
434 y_label_text = a.y_label.text;
435 z_label_text = a.z_label.text;
436 axes_isoview = a.isoview;
438 if (or(surfaceProperties.color_flag==[2 5]) & ~or(fields=="cdata_mapping")) | ..
439 ((surfaceProperties.color_flag>=2) & or(fields=="cdata_mapping")) then
440 plot3d1(surfaceProperties.data.x, surfaceProperties.data.y, list(surfaceProperties.data.z, surfaceProperties.data.color))
442 plot3d(surfaceProperties.data.x,surfaceProperties.data.y,surfaceProperties.data.z)
444 fields(fields=="data") = [];
446 // Restore this properties after plot3d.
447 a.rotation_angles = rotation_angles;
448 a.axes_visible = axes_visible;
451 a.x_label.visible = x_label_visible;
452 a.y_label.visible = y_label_visible;
453 a.z_label.visible = z_label_visible;
454 a.x_label.text = x_label_text;
455 a.y_label.text = y_label_text;
456 a.z_label.text = z_label_text;
457 a.isoview = axes_isoview;
459 // Get mark_mode to be sure to set it after mark_style
460 mark_mode = surfaceProperties.mark_mode;
461 fields(fields=="mark_mode") = [];
465 if or(fields=="cdata_mapping") then // Fac3d specific
466 if surfaceProperties.color_flag >= 2 then
467 set(h, "cdata_mapping", surfaceProperties.cdata_mapping);
469 fields(fields=="cdata_mapping") = [];
472 if surfaceProperties.clip_state == "on" then
473 set(h,"clip_box", surfaceProperties.clip_box);
475 set(h,"clip_state",surfaceProperties.clip_state);
476 fields(fields=="clip_box") = [];
477 fields(fields=="clip_state") = [];
479 for i = 1:size(fields, "*")
480 if fields(i) == "mark_style" then
481 set(h, "mark_style", surfaceProperties.mark_style);
482 set(h, "mark_mode", mark_mode);
484 h(fields(i)) = surfaceProperties(fields(i));
492 function h = createCompound(compoundProperties)
493 fields = fieldnames(compoundProperties);
496 h = glue(createMatrixHandle(compoundProperties.children));
497 fields(fields=="children") = [];
499 for i = 1:size(fields, "*")
500 set(h, fields(i), compoundProperties(fields(i)));
507 function h = createRectangle(rectangleProperties)
508 fields = fieldnames(rectangleProperties);
511 xrect(0,1,1,1); // create the rectangle with dummy values
514 if rectangleProperties.clip_state == "on" then
515 set(h,"clip_box", rectangleProperties.clip_box);
517 set(h,"clip_state",rectangleProperties.clip_state);
518 fields(fields=="clip_box") = [];
519 fields(fields=="clip_state") = [];
521 // Get mark_mode to be sure to set it after mark_style
522 mark_mode = rectangleProperties.mark_mode;
523 fields(fields=="mark_mode") = [];
525 for i = 1:size(fields, "*")
526 if fields(i) == "mark_style" then
527 set(h, "mark_style", rectangleProperties.mark_style);
528 set(h, "mark_mode", mark_mode);
530 h(fields(i)) = rectangleProperties(fields(i));
538 function h = createArc(arcProperties)
539 fields = fieldnames(arcProperties);
542 xarc(0,1,1,1,0,360); // create the arc with dummy values
545 if arcProperties.clip_state == "on" then
546 set(h,"clip_box", arcProperties.clip_box);
548 set(h,"clip_state",arcProperties.clip_state);
549 fields(fields=="clip_box") = [];
550 fields(fields=="clip_state") = [];
552 for i = 1:size(fields, "*")
553 set(h, fields(i), arcProperties(fields(i)));
560 function h = createChamp(champProperties)
561 fields = fieldnames(champProperties);
564 champ(champProperties.data.x, champProperties.data.y, champProperties.data.fx, champProperties.data.fy);
565 fields(fields=="data") = [];
569 if champProperties.clip_state == "on" then
570 set(h,"clip_box", champProperties.clip_box);
572 set(h,"clip_state",champProperties.clip_state);
573 fields(fields=="clip_box") = [];
574 fields(fields=="clip_state") = [];
576 for i = 1:size(fields, "*")
577 set(h, fields(i), champProperties(fields(i)));
584 function h = createSegs(segsProperties)
585 fields = fieldnames(segsProperties);
588 xsegs(segsProperties.data(:,1), segsProperties.data(:,2))
592 if segsProperties.clip_state == "on" then
593 set(h,"clip_box", segsProperties.clip_box);
595 set(h,"clip_state",segsProperties.clip_state);
596 fields(fields=="clip_box") = [];
597 fields(fields=="clip_state") = [];
599 // Get mark_mode to be sure to set it after mark_style
600 mark_mode = segsProperties.mark_mode;
601 fields(fields=="mark_mode") = [];
603 for i = 1:size(fields, "*")
604 if fields(i) == "mark_style" then
605 set(h, "mark_style", segsProperties.mark_style);
606 set(h, "mark_mode", mark_mode);
608 h(fields(i)) = segsProperties(fields(i));
616 function h = createGrayplot(grayplotProperties)
617 fields = fieldnames(grayplotProperties);
620 grayplot(grayplotProperties.data.x, grayplotProperties.data.y, grayplotProperties.data.z);
621 fields(fields=="data") = [];
625 if grayplotProperties.clip_state=="on" then
626 set(h, "clip_box", grayplotProperties.clip_box)
628 set(h, "clip_state", grayplotProperties.clip_state);
629 fields(fields=="clip_box") = [];
630 fields(fields=="clip_state") = [];
632 for i = 1:size(fields, "*")
633 set(h, fields(i), grayplotProperties(fields(i)));
640 function h = createMatplot(matplotProperties)
641 fields = fieldnames(matplotProperties);
644 Matplot(matplotProperties.data);
645 fields(fields=="data") = [];
649 if matplotProperties.clip_state=="on" then
650 set(h, "clip_box", matplotProperties.clip_box)
652 set(h, "clip_state", matplotProperties.clip_state);
653 fields(fields=="clip_box") = [];
654 fields(fields=="clip_state") = [];
656 for i = 1:size(fields, "*")
657 set(h, fields(i), matplotProperties(fields(i)));
664 function h = createFec(fecProperties)
665 fields = fieldnames(fecProperties);
668 fec(fecProperties.data(:,1), fecProperties.data(:,2), fecProperties.triangles, fecProperties.data(:,3));
669 fields(fields=="data") = [];
670 fields(fields=="triangles") = [];
674 if fecProperties.clip_state=="on" then
675 set(h, "clip_box", fecProperties.clip_box)
677 set(h, "clip_state", fecProperties.clip_state);
678 fields(fields=="clip_box") = [];
679 fields(fields=="clip_state") = [];
681 for i = 1:size(fields, "*")
682 set(h, fields(i), fecProperties(fields(i)));
689 function h = createLegend(legendProperties)
691 %LEG = legendProperties;
698 function h = createText(textProperties)
699 fields = fieldnames(textProperties);
702 if textProperties.text_box_mode == "off" then
703 xstring(textProperties.data(1), textProperties.data(2), textProperties.text)
705 xstringb(textProperties.data(1), textProperties.data(2), textProperties.text, textProperties.text_box(1), textProperties.text_box(2))
710 if textProperties.clip_state=="on" then
711 set(h, "clip_box", textProperties.clip_box)
713 set(h, "clip_state", textProperties.clip_state);
714 fields(fields=="clip_box") = [];
715 fields(fields=="clip_state") = [];
717 for i = 1:size(fields, "*")
718 set(h, fields(i), textProperties(fields(i)));
725 function h = createDatatip(datatipProperties)
727 fields = fieldnames(datatipProperties);
730 tip_data = datatipProperties("data");
731 h = datatipCreate(%POLYLINE, tip_data);
733 for i = 1:size(fields, "*")
734 if fields(i) == "data" then
738 set(h, fields(i), datatipProperties(fields(i)));
745 function h = createAxis(axisProperties)
746 fields = fieldnames(axisProperties);
749 if axisProperties.tics_direction == "bottom" then
751 elseif axisProperties.tics_direction == "top" then
753 elseif axisProperties.tics_direction == "left" then
755 elseif axisProperties.tics_direction == "right" then
757 elseif size(axisProperties.xtics_coord, "*") > 1 then
762 fields(fields=="tics_direction") = [];
764 drawaxis(x=axisProperties.xtics_coord,y=axisProperties.ytics_coord,dir=axisdir);
765 fields(fields=="xtics_coord") = [];
766 fields(fields=="ytics_coord") = [];
770 if axisProperties.clip_state=="on" then
771 set(h, "clip_box", axisProperties.clip_box)
773 set(h, "clip_state", axisProperties.clip_state);
774 fields(fields=="clip_box") = [];
775 fields(fields=="clip_state") = [];
777 for i = 1:size(fields, "*")
778 set(h, fields(i), axisProperties(fields(i)));
785 function h = createuimenu(uimenuProperties)
786 fields = fieldnames(uimenuProperties);
791 for i = 1:size(fields, "*")
792 if fields(i) == "children" then
793 children = createMatrixHandle(uimenuProperties(fields(i)));
794 for k=1:size(children, "*")
795 set(children(k), "parent", h);
798 set(h, fields(i), uimenuProperties(fields(i)));
806 function h = createuicontextmenu(uicontextmenuProperties)
807 fields = fieldnames(uicontextmenuProperties);
812 for i = 1:size(fields, "*")
813 if fields(i) == "children" then
814 children = createMatrixHandle(uicontextmenuProperties(fields(i)));
815 for k=1:size(children, "*")
816 set(children(k), "parent", h);
819 set(h, fields(i), uicontextmenuProperties(fields(i)));
827 function h = createuicontrol(uicontrolProperties)
828 fields = fieldnames(uicontrolProperties);
831 if or(fields=="scrollable") then
832 // Properties added in Scilab 5.5.0
833 // - scrollable must be set at creation (for frames)
834 // - contraints & margins must be set before parent
835 h = uicontrol("style", uicontrolProperties.style, ...
836 "scrollable", uicontrolProperties.scrollable, ...
837 "constraints", uicontrolProperties.constraints, ...
838 "margins", uicontrolProperties.margins);
839 fields(fields=="scrollable") = [];
840 fields(fields=="constraints") = [];
841 fields(fields=="margins") = [];
842 h.layout_options = uicontrolProperties.layout_options;
843 fields(fields=="layout_options") = [];
844 h.layout = uicontrolProperties.layout;
845 fields(fields=="layout") = [];
847 h = uicontrol("style", uicontrolProperties.style);
849 fields(fields=="style") = [];
851 for i = 1:size(fields, "*")
852 if fields(i) == "children" then
853 children = createMatrixHandle(uicontrolProperties(fields(i)));
854 for k=1:size(children, "*")
855 set(children(k), "parent", h);
858 set(h, fields(i), uicontrolProperties(fields(i)));
866 function h = createLight(lightProperties)
867 fields = fieldnames(lightProperties);
871 fields(fields=="children") = [];
873 for i = 1:size(fields, "*")
874 set(h, fields(i), lightProperties(fields(i)));
878 // Utility function for legends, copy/paste from %h_load
879 function links=getlinksfrompath(ax,paths)
880 // ax is a handle on an axes entity
881 // paths a list or row vector which gives the set of paths relative to
887 p(1)=p(1)-1// the caption does not exists yet
888 for kp=1:size(p,"*"),
889 if or(e.type==["Axes","Compound"])&p(kp)<=size(e.children,"*") then
906 function macro = createMacro(macroStr, macroName)
908 macroSt = macroStr(3);
909 if macroStr(2) == %t then
914 header = strsubst(macroSt(1), "function ", "");
915 body = macroSt(2:$-1);
919 deff(header, body, flag);
920 execstr("macro = " + macroName);
923 [%__lhs__, %__rhs__] = argn();
924 %__resumeList__ = list();
925 %__resumeVarlist__ = [];
927 error(999, msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"), "load", 1));
930 if %__rhs__ >= 1 then
931 if typeof(%__filename__) <> "string" | size(%__filename__, "*") <> 1 then
932 error(999, msprintf(gettext("%s: Wrong type for input argument #%d: String expected.\n"), "load", 1));
936 if isfile(%__filename__) & is_hdf5_file(%__filename__) then
937 %__loadFunction__ = import_from_hdf5;
938 //fileVersion = getScilabFileVersion(%__filename__); // Not needed for the moment
940 %__loadFunction__ = %_load;
943 //multiple output variables to prevent listinfile prints
944 [%__variableList__, %__varB__, %__varC__, %__varD__] = listvarinfile(%__filename__);
946 if size(varargin) <> 0 then
947 for i = 1:size(varargin)
948 %__variableName__ = varargin(i);
949 if typeof(%__variableName__) <> "string" | size(%__variableName__, "*") <> 1 then
950 error(999, msprintf(gettext("%s: Wrong type for input argument #%d: String expected.\n"), "load", i));
953 if or(%__variableList__ == %__variableName__) then
954 %__loadFunction__(%__filename__, %__variableName__);
955 %__resumeList__($+1) = evstr(%__variableName__);
956 %__resumeVarlist__($+1) = %__variableName__;
957 clear(%__variableName__);
959 error(999, msprintf(gettext("%s: variable ''%s'' does not exist in ''%s''.\n"), "load", %__variableName__, %__filename__));
963 for i = 1:size(%__variableList__, "*")
964 %__variableName__ = %__variableList__(i);
965 %__loadFunction__(%__filename__, %__variableName__);
966 %__resumeList__($+1) = evstr(%__variableName__);
967 %__resumeVarlist__($+1) = %__variableName__;
968 clear(%__variableName__);
972 if isfile(%__filename__) & is_hdf5_file(%__filename__) then
973 %__resumeList__ = %__convertVariable__(%__resumeList__, %__resumeVarlist__);
976 execstr("[" + strcat(%__resumeVarlist__, ",") + "] = resume(%__resumeList__(:))");