FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
str_chr.c
Go to the documentation of this file.
1
/* chr$ routine */
2
3
#include "
fb.h
"
4
5
FBSTRING
*
fb_CHR
(
int
args, ... )
6
{
7
FBSTRING
*dst;
8
va_list ap;
9
unsigned
int
num;
10
int
i;
11
12
if
( args <= 0 )
13
return
&
__fb_ctx
.
null_desc
;
14
15
va_start( ap, args );
16
17
/* alloc temp string */
18
dst =
fb_hStrAllocTemp
(
NULL
, args );
19
if
( dst !=
NULL
)
20
{
21
/* convert */
22
for
( i = 0; i < args; i++ )
23
{
24
num = va_arg( ap,
unsigned
int
);
25
dst->
data
[i] = (
unsigned
char)num;
26
}
27
dst->
data
[args] =
'\0'
;
28
}
29
else
30
dst = &
__fb_ctx
.
null_desc
;
31
32
va_end( ap );
33
34
return
dst;
35
}
rtlib
str_chr.c
Generated on Thu Jan 23 2014 19:40:12 for FreeBASIC by
1.8.4