Item

ArrayGetL

Return the logical value of an array element

Syntax

Signature
int ArrayGetL( const ITEM *array, size_t index );

Arguments

array Array to access.

index Element position, counted from 1.

Return value

1 if the stored logical value is true, otherwise 0.

Description

Reads a logical value. A false value, a missing element and an element with a different type all return 0.

Example

arraygetl.c
#include "xdev-wtui.h"

#include <stdio.h>

int main( void )
{
   ITEM *array = Array( 2 );

   if( !array )
      return 1;

   ArraySetL( array, 1, T );
   printf( "%s\n", ArrayGetL( array, 1 ) ? "yes" : "no" );
   ItemRelease( array );

   return 0;
}