FreeBASIC  0.91.0
str_asc.c
Go to the documentation of this file.
1 /* asc function */
2 
3 #include "fb.h"
4 
5 FBCALL unsigned int fb_ASC( FBSTRING *str, ssize_t pos )
6 {
7  unsigned int a;
8  ssize_t len;
9 
10  if( str == NULL )
11  return 0;
12 
13  len = FB_STRSIZE( str );
14  if( (str->data == NULL) || (len == 0) || (pos <= 0) || (pos > len) )
15  a = 0;
16  else
17  a = (unsigned char)str->data[pos-1];
18 
19  /* del if temp */
20  fb_hStrDelTemp( str );
21 
22  return a;
23 }