[Gambas-user] Strange error with arrays

Charlie Reinl na2492 at ...9...
Mon Feb 21 21:05:29 CET 2005


>Just run into a problem :-) 
> 
>In a module, there are several arrays of different datatypes: integer,  
>string, float: 
> 
>PRIVATE myarr[20] AS INTEGER 
>PRIVATE myarg[20] AS BOOLEAN 
>PRIVATE myarx[20, 20] AS STRING 
> 
>and so on, then 
> 
>PUBLIC SUB aProcedure(something as integer) 
> 
> blablabla 
> 
> ... myarr[x] ... 
> ... IF myarg[y] THEN ... 
> ... myarx[x, y] = "hello" 
> 
>END 
> 
> 
>Now, when the program comes to this procedure, it stops with a message  
>"Program delivered 1" and a message in the direct window saying "Don't  
>know how to copy arrays. Sorry :-( " 
> 
>So, what's wrong here? 
> 
>Rolf 
> 
Salut Rolf, 
 
The "Don't know how to copy arrays" exists in gbx_value.c 
at VALUE_class_write as  
 
PUBLIC void VALUE_class_write(CLASS *class, VALUE *value, char *addr, 
CTYPE ctype) 
{ 
  if (ctype.id == T_OBJECT) 
  { 
    VALUE_write(value, addr, (ctype.value >= 0) ? 
(TYPE)class->load->class_ref[ctype.value] : T_OBJECT); 
  } 
  else if (ctype.id == T_ARRAY) 
  { 
    ERROR_panic("Don't know how to copy arrays"); 
  } 
  else 
    VALUE_write(value, addr, (TYPE)ctype.id); 
} 
 
Would be nice to see your code. 
 
Amicalment 
Charlie 
* Gesendet mit / Sent by: FEN-Webmail * http://www.fen-net.de *




More information about the User mailing list