octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #58998] Probably mistake in a "print.m"


From: Valdas
Subject: [Octave-bug-tracker] [bug #58998] Probably mistake in a "print.m"
Date: Sun, 23 Aug 2020 10:44:53 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0

URL:
  <https://savannah.gnu.org/bugs/?58998>

                 Summary: Probably mistake in a "print.m"
                 Project: GNU Octave
            Submitted by: zmogas
            Submitted on: Sun 23 Aug 2020 02:44:52 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Unexpected Error or Warning
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

 I searching what causes this strange error in my code when I execute
"print":

error: props(8): out of bound 7
error: called from
    print at line 758 column 9

 In a file "print.m" I found possible cause:
  - starting from line #460 there is a block of code:

    ## Set the __printing__ property first
    props(1).h = opts.figure;
    props(1).name = "__printing__";
    props(1).value = {"off"};
    set (opts.figure, "__printing__", "on");
    nfig += 1;

  - after that block follows a second block of code:

    ## print() requires children of axes to have units = "normalized", or
"data"
    hobj = findall (opts.figure, "-not", "type", "figure", ...
                    "-not", "type", "axes", "-property", "units", ...
                    "-not", "units", "normalized", "-not", "units", "data");
    hobj(strncmp (get (hobj, "type"), "ui", 2)) = [];
    for n = 1:numel(hobj)
      props(n).h = hobj(n);
      props(n).name = "units";
      props(n).value = {get(hobj(n), "units")};
      set (hobj(n), "units", "data");
      nfig += 1;
    endfor

 I think that a second block of code contains mistake because after that
code:
  - changes made by first block of code is lost,
  - "nfig" is greater than element count in "props".
 If I modify the code in a second block, then my code runs without error:

. . .
      props(end+1).h = hobj(n);
      props(end).name = "units";
      props(end).value = {get(hobj(n), "units")};
. . .





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58998>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]