triforcely / Octave.NET

📈 More than cross-platform Octave process wrapper 🔬
MIT License
32 stars 7 forks source link

if script include a function, will throw out error #17

Open zj2050 opened 1 year ago

zj2050 commented 1 year ago

Hi,all: I have defined a function in script, like: disp("Running...") function result = myrand(n, t, p, d) a = 200 * t + p; big_rand = a * n; result = big_rand / 10**d; return;endfunction mrand = myrand(5379, 0, 91, 4)

the script can correct execute in octave, but when call: octave.Execute(script) will show error : "error: 'myrand' undefined near line 1, column 9\r\n"

how defined a function in script? thanks

zj2050 commented 1 year ago

@triforcely please give any suggestion? thanks

zj2050 commented 1 year ago

script = string.Format("disp(\"Running...\")\n "+ "function result = myrand(n, t, p, d) a = 200 t + p; big_rand = a n; result = big_rand / 10**d; return;endfunction \n"+ "mrand = myrand(5379, 0, 91, 4) "));

this code phrase from octave

triforcely commented 1 year ago

Hey @zj2050 . This seems to be a bug. I've reproduced it and internal response parsing logic causes Octave.NET to freeze when handling functions. I'll work on a fix, thanks for the report.

zj2050 commented 1 year ago

Hey @zj2050 . This seems to be a bug. I've reproduced it and internal response parsing logic causes Octave.NET to freeze when handling functions. I'll work on a fix, thanks for the report.

Hi @triforcely thanks for great work, then fixed please @

Jacks321 commented 1 year ago

Hi! I'm having the same problem too, I've been trying for days. Thanks in advance for the correction @triforcely !

triforcely commented 1 year ago

I started looking into this issue and it doesn't seem to be very easy to fix. I don't have too much time to fix it at the moment, so feel free to look into it yourself, I'll be happy to merge your changes.

zj2050 commented 1 year ago

@triforcely @CptWesley

o

It's a very bad news