quetion

sploving sploving1 at 163.com
Tue May 26 06:41:27 CEST 2009


hi all,

I want to wrap a C variable for scialb. and my wrapper is as follows:

extern char cvar;

int _wrap_cvar_set (char *fname){
  char arg1 ;
  int m1 ;
  int n1 ;
  int l1 ;
  
  {
    GetRhsVar(1,STRING_DATATYPEE ,&m1,&n1,&l1);
    arg1=(char)(*stk(l1));
  }
  cvar = arg1;
  
  return 0;
}


int _wrap_cvar_get (char *fname){
  char result;
  int m ;
  int n ;
  int l ;
  
  result = (char)cvar;
  {
    m=1,n=1;
    CreateVar(Rhs+1,STRING_DATATYPE ,&m,&n,&l);   
    *stk(l)=result;
    LhsVar(1)=Rhs+1;
  }
  return 0;
}

It could not work. Then I use the "MATRIX_OF_STRING_DATATYPE" , it does
not work either. At last I use the "MATRIX_OF_DOUBLE_DATATYPE", it
works. But it could not set a char to cvar, as follows:

-->cvar_set(3)
 
-->cvar_get()
 ans  =
 
    3.  
 
-->cvar_set("b")
              !--error 246 

What is the matter? Thanks for any reply.


Baozeng










More information about the dev mailing list