Commit 889dbebc authored by jayd1860's avatar jayd1860
Browse files

v1.18.9

-- Fix error in Logger when log file cannot be opened, avoid error by checking file handle and logging messages only to console in that case
-- To improve use new function str2cell_fast where the delimiter argument is 1. This is an optimized version of str2cell.
parent 9ecea333
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ classdef FuncCallClass < handle
            if s(1)~='('
                return;              
            end
            args = str2cell(s(2:end),',');
            args = str2cell_fast(s(2:end),',');
            fhelp = FuncHelpClass(obj.name);
            for ii=1:length(args)
                obj.argIn.vars(ii).name = args{ii};
+4 −4
Original line number Diff line number Diff line
@@ -328,7 +328,7 @@ classdef FuncHelpClass < matlab.mixin.Copyable
        
        % -------------------------------------------------------------
        function FindSubSectionLines(obj, section)
            strs = str2cell(eval(sprintf('obj.sections.%s.str', section)), [], 'keepblanks');
            strs = str2cell_fast(eval(sprintf('obj.sections.%s.str', section)), [], 'keepblanks');
            kk=0;
            subsect = [];
            for iLine=1:length(strs)
@@ -364,7 +364,7 @@ classdef FuncHelpClass < matlab.mixin.Copyable
        function [name, k] = GetSubSectionName(obj, section, iLine)
            name = '';
            k = [];
            strs = str2cell(eval(sprintf('obj.sections.%s.str', section)), [], 'keepblanks');
            strs = str2cell_fast(eval(sprintf('obj.sections.%s.str', section)), [], 'keepblanks');
            
            % Rule 1: Valid section is must end with a ':',' - ', or '--'
            k1 = find(strs{iLine}==':');
@@ -405,7 +405,7 @@ classdef FuncHelpClass < matlab.mixin.Copyable
        
        % -------------------------------------------------------------
        function AssignSubSectionText(obj, section)
            strs = str2cell(eval(sprintf('obj.sections.%s.str', section)), [], 'keepblanks');
            strs = str2cell_fast(eval(sprintf('obj.sections.%s.str', section)), [], 'keepblanks');
            subsect = eval(sprintf('obj.sections.%s.subsections', section));
            for ii=1:length(subsect)
                lines = subsect(ii).lines(1):subsect(ii).lines(2);
@@ -538,7 +538,7 @@ classdef FuncHelpClass < matlab.mixin.Copyable
            if ~strcmp(ext,'.m')
                func = [func, '.m'];
            end
            obj.helpstr = str2cell(help_local(func), [], 'keepblanks');
            obj.helpstr = str2cell_fast(help_local(func), [], 'keepblanks');
        end
        
    end
+9 −0
Original line number Diff line number Diff line
@@ -252,6 +252,9 @@ classdef Logger < handle

        % ---------------------------------------------------------------
        function InitChapters(self)
            if self.fhandle < 0
                return;
            end
            self.chapter.offset = ftell(self.fhandle);
            fprintf(self.fhandle, '\nLogger: Chapter %d\n', self.chapter.number);
        end
@@ -259,6 +262,9 @@ classdef Logger < handle
        
        % ---------------------------------------------------------------
        function ResetChapter(self)
            if self.fhandle < 0
                return;
            end
            self.chapter.number = self.chapter.number+1;
            fseek(self.fhandle, self.chapter.offset, 'bof');            
            fprintf(self.fhandle, '\nLogger: Chapter %d\n', self.chapter.number);
@@ -267,6 +273,9 @@ classdef Logger < handle
        
        % ---------------------------------------------------------------
        function CheckFileSize(self)
            if self.fhandle < 0
                return;
            end
            if ftell(self.fhandle) > self.chapter.maxsize
                self.ResetChapter()
            end
+1 −1
Original line number Diff line number Diff line
@@ -2,5 +2,5 @@ function vrnnum = getVernum()

vrnnum{1} = '1';   % Major version #
vrnnum{2} = '18';  % Major sub-version #
vrnnum{3} = '8';   % Minor version #
vrnnum{3} = '9';   % Minor version #
vrnnum{4} = '0';   % Minor sub-version # or patch #: 'p1', 'p2', etc
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ end

if isstruct(st) || isobject(st)
    s = evalc('disp(st)');
    c = str2cell(s,10);
    c = str2cell_fast(s, char(10));
    for ii=1:length(c)
        if option==1
            logger.Write(sprintf('%s%s\n', spaces, strtrim_improve(c{ii})));
Loading