FreeBASIC  0.91.0
array_clear.c
Go to the documentation of this file.
1 /* ERASE for static arrays: clear the elements */
2 /* (for FBSTRING arrays, fb_ArrayStrErase() should be used instead) */
3 
4 #include "fb.h"
5 
6 FBCALL int fb_ArrayClear( FBARRAY *array, int isvarlen /* legacy */ )
7 {
8  if( array->ptr ) {
9  if( isvarlen )
10  fb_ArrayDestructStr( array );
11  else
12  memset( array->ptr, 0, array->size );
13  }
14 
15  return fb_ErrorSetNum( FB_RTERROR_OK );
16 }