C runtime problem

image

We need a bit more information than that.
Which Octave version?
Which commands did you run to trigger this?
Any .mex or .oct files involved?

Octave 6.4.0.

Opened a .m file in the editor, and told it to save and run the file. I was presented with this dialog:

image

I selected to Change Directory.

The message in question appeared when the print command at line 70 of my script was executed.

test.m (1.8 KB)

The following messages were shown in the output window:

error: set: invalid handle (= 1)
error: called from
    print at line 472 column 8
    test at line 70 column 1
>> test

Running the script again and all worked as expected with no errors

D.

Integer handles are usually handles to figures.
If the handle is invalid, that probably means that you tried to access it but the figure was closed.
That shouldn’t cause a crash though.

Do you have scripts or functions in your working directory that might shadow core functions?

Only test.m.

Running it all again from opening the GUI, I still got the runtime error message, but didn’t get the invalid handle error this time.

David

Even one shadowed function is too many. Just to guarantee this is not part of the problem I would rename your code to something like tst.m so there is no shadowing.

I did rename it to Servos.m Problem still occurs

D.