16 byval symbol
as zstring ptr, _
17 byval dtype
as integer, _
18 byval subtype
as FBSYMBOL
ptr, _
19 byval value
as FBVALUE
ptr, _
20 byval attrib
as integer _
23 dim as FBSYMBOL
ptr sym =
any
45 byval value
as double, _
46 byval dtype
as integer _
49 static as zstring * FB_MAXINTNAMELEN+1 id, id_alias
50 static as FBARRAYDIM dTB(0)
51 dim as FBSYMBOL
ptr s =
any
72 s =
symbAddVar( @id, @id_alias, dtype, NULL, 0, 0, dTB(), _
73 FB_SYMBATTRIB_SHARED
or FB_SYMBATTRIB_LITCONST, _
74 FB_SYMBOPT_MOVETOGLOB
or FB_SYMBOPT_PRESERVECASE
or FB_SYMBOPT_NODUPCHECK )
76 s->var_.littext = ZstrAllocate(
len( svalue ) )
77 *s->var_.littext = svalue
84 byval value
as integer, _
85 byval dtype
as integer _
86 )
as FBSYMBOL
ptr static
88 static as zstring * FB_MAXINTNAMELEN+1 id, id_alias
90 dim as FBARRAYDIM dTB(0)
95 svalue =
"0x" +
Hex(value)
111 s =
symbAddVar( @id, @id_alias, dtype, NULL, 0, 0, dTB(), _
112 FB_SYMBATTRIB_SHARED
or FB_SYMBATTRIB_LITCONST, _
113 FB_SYMBOPT_MOVETOGLOB
or FB_SYMBOPT_PRESERVECASE )
115 s->var_.littext = ZstrAllocate(
len( svalue ) )
116 *s->var_.littext = svalue
124 byval value
as longint, _
125 byval dtype
as integer _
126 )
as FBSYMBOL
ptr static
128 static as zstring * FB_MAXINTNAMELEN+1 id, id_alias
129 dim as FBSYMBOL
ptr s
130 dim as FBARRAYDIM dTB(0)
135 svalue =
"0x" +
Hex(value)
151 s =
symbAddVar( @id, @id_alias, dtype, NULL, 0, 0, dTB(), _
152 FB_SYMBATTRIB_SHARED
or FB_SYMBATTRIB_LITCONST, _
153 FB_SYMBOPT_MOVETOGLOB
or FB_SYMBOPT_PRESERVECASE )
155 s->var_.littext = ZstrAllocate(
len( svalue ) )
156 *s->var_.littext = svalue
164 byval sname
as zstring ptr, _
165 byval lgt
as integer _
168 static as zstring * FB_MAXINTNAMELEN+1 id, id_alias
169 static as FBARRAYDIM dTB(0)
170 dim as FBSYMBOL
ptr s =
any
171 dim as integer strlen =
any
177 strlen =
len( *sname )
182 if( strlen <= FB_MAXNAMELEN-6 )
then
199 s =
symbAddVar( @id, @id_alias, FB_DATATYPE_CHAR, NULL, lgt + 1, 0, dTB(), _
200 FB_SYMBATTRIB_SHARED
or FB_SYMBATTRIB_LITCONST, _
201 FB_SYMBOPT_MOVETOGLOB
or FB_SYMBOPT_PRESERVECASE
or FB_SYMBOPT_NODUPCHECK )
203 s->var_.littext = ZstrAllocate( strlen )
204 *s->var_.littext = *sname
211 byval sname
as wstring ptr, _
212 byval lgt
as integer _
215 static as zstring * FB_MAXINTNAMELEN+1 id, id_alias
216 static as FBARRAYDIM dTB(0)
217 dim as FBSYMBOL
ptr s =
any
218 dim as integer strlen =
any
219 dim as integer wcharlen =
any
225 strlen =
len( *sname )
230 wcharlen = typeGetSize( FB_DATATYPE_WCHAR )
233 if( strlen * ((1+3) * wcharlen) <= FB_MAXNAMELEN-6 )
then
249 s =
symbAddVar( @id, @id_alias, FB_DATATYPE_WCHAR, NULL, (lgt+1) *
len(
wstring ), 0, dTB(), _
250 FB_SYMBATTRIB_SHARED
or FB_SYMBATTRIB_LITCONST, _
251 FB_SYMBOPT_MOVETOGLOB
or FB_SYMBOPT_PRESERVECASE
or FB_SYMBOPT_NODUPCHECK )
253 s->var_.littextw = WstrAllocate( strlen )
254 *s->var_.littextw = *sname
269 select case( symbGetType( s ) )
270 case FB_DATATYPE_STRING, FB_DATATYPE_FIXSTR, FB_DATATYPE_CHAR
271 function = *symbGetConstStr( s )->var_.littext
273 case FB_DATATYPE_DOUBLE
274 function =
str( symbGetConstFloat( s ) )
276 case FB_DATATYPE_SINGLE
277 function =
str(
csng( symbGetConstFloat( s ) ) )
280 if( typeIsSigned( s->typ ) )
then
281 function =
str( symbGetConstInt( s ) )
283 function =
str( cunsg( symbGetConstInt( s ) ) )
291 function =
symbAddConst( NULL, symbGetType( sym ), symbGetSubtype( sym ), _
292 symbGetConstVal( sym ), symbGetAttrib( sym ) )