Forum Navigation
You need to log in to create posts and topics.

Re: Assembly help

Posted by: sperling <sperling@...>

>Hello! I am trying to convert a header file from C into FB. One of the
>functions uses a static string constant. Since FB doesnt do string constants
>and the function crashes when it all looks right, I am not sure if that is a
>problem.
>
>Ryan

Ryan:

Static storage is a like a global that is available to one specific
function (the one that declares it) and no other. This allows one to
modularize functions without worrying about conflicting global names.

Static storage class means that these variables have fixed addresses in
memory and hang around as long as the program runs, just like globals.
However, because they are local, then they are only visible to the function
that declares them.

In contrast, local variables are temporary and have memory allocated to
them as the functions are called and released when the functions are done.
This memory is temporally allocated on the stack.

While it is true that FB doesn't provide this feature, it should be a
simple matter to solve. Simply declare a global and and only use it for
that specific function. In other words, just make the global variable name
unique.

tedd

_____________________________________________________________________
tedd f. sperling <mailto:sperling@sperling.com>
http://www.sojourn.com/sperling/