Re: [Scilab-users] Strange list error

2014-01-27 Thread Serge Steer

Le 27/01/2014 19:05, Stefan Du Rietz a écrit :

Hello Paul,
after trying like a maniac ;-) I finally managed to reproduce it!

The error shows up only when you run the command from the command 
window after a pause in the attached function testlisterror.sci.


-->testlisterror("pnonfast","nonfast")
-1->args(1) = null()
args(1) = null()
 !--error 44
Wrong argument #2.

Without the pause it works OK.

Regards
Stefan
Under pause, you cannot modify a variable which is defined in the 
calling context
so in such a context args is not a list as you expect but an empty array 
which is implicitely created


To make it work
you must do
-1-> args; //makes a local copy of args
-1->args(1) = null()

Serge
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Strange list error

2014-01-27 Thread Stefan Du Rietz

PS
-->testlisterror("pnonfast","nonfast")

works OK also after resume twice.

/Stefan

On 2014-01-27 19:05, Stefan Du Rietz wrote:


Hello Paul,
after trying like a maniac ;-) I finally managed to reproduce it!

The error shows up only when you run the command from the command
window after a pause in the attached function testlisterror.sci.

-->testlisterror("pnonfast","nonfast")
-1->args(1) = null()
args(1) = null()
  !--error 44
Wrong argument #2.

Without the pause it works OK.

Regards
Stefan


On 2014-01-27 08:47, Paul Bignier wrote:



Hello Stefan,

What do you mean by "suddenly stopped working"? Did you switch Scilab
versions?

Could you provide us the failing test case?
When I type
 args = list(); args(1)=null()
it runs smooth.

Regards,
Paul


On 01/25/2014 09:07 PM, Stefan Du Rietz wrote:

I found out what the error was: I had a line

  if exists("bolus") then

that became true when I had this variable in the workspace, which I
never had before.

I changed it to

  if exists("bolus", "l") then

and it worked again.

But I still wonder: why the error 44?

Stefan

On 2014-01-25 18:32, Stefan Du Rietz wrote:


Hi all,
one of my functions suddenly stopped working. During my effort to
find
the error by running the commands from the command window, I
experienced this:

-1->args(1) = null();
args(1) = null();
  !--error 44
Wrong argument #2.

and when I checked:
-1->typeof(args)
  ans  =
  list

Can anybody explain that?

Regards
Stefan
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users






___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Strange list error

2014-01-27 Thread Stefan Du Rietz

Hello Paul,
after trying like a maniac ;-) I finally managed to reproduce it!

The error shows up only when you run the command from the command 
window after a pause in the attached function testlisterror.sci.


-->testlisterror("pnonfast","nonfast")
-1->args(1) = null()
args(1) = null()
 !--error 44
Wrong argument #2.

Without the pause it works OK.

Regards
Stefan


On 2014-01-27 08:47, Paul Bignier wrote:



Hello Stefan,

What do you mean by "suddenly stopped working"? Did you switch Scilab
versions?

Could you provide us the failing test case?
When I type
 args = list(); args(1)=null()
it runs smooth.

Regards,
Paul


On 01/25/2014 09:07 PM, Stefan Du Rietz wrote:

I found out what the error was: I had a line

  if exists("bolus") then

that became true when I had this variable in the workspace, which I
never had before.

I changed it to

  if exists("bolus", "l") then

and it worked again.

But I still wonder: why the error 44?

Stefan

On 2014-01-25 18:32, Stefan Du Rietz wrote:


Hi all,
one of my functions suddenly stopped working. During my effort to find
the error by running the commands from the command window, I
experienced this:

-1->args(1) = null();
args(1) = null();
  !--error 44
Wrong argument #2.

and when I checked:
-1->typeof(args)
  ans  =
  list

Can anybody explain that?

Regards
Stefan
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users






testlisterror.sci
Description: application/scilab
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users