01-12-2005, 03:28 AM
Guys,
Please excuse me if I sound stupid on this -- it's been a while
that I've been playing with PDS and I'm only now getting back
into this stuff.
I recently started looking for new 32 bit basic compilers,
and I found FB, and also PowerBasic Console Compiler.
My objective was to start writing some libraries that other
C programmers here could call from their applications. I don't
know C, and it looks too weird for me to deal with.
So I thought I could make some statically linkable libraries,
that would share global variables with their C applications.
I've never used pointers to memory, and it seems like a pain
in the butt, so I'd rather just have simple global variables
between my libraries and the main C programs. For example,
I want my library functions to create arrays that are read by
the C program e.g., A(X,Y,Z). So these array variables need
to be global between the library and the main C programs.
First I had gotten the PB/CC, and I came to read in their manual
that they don't support static libraries, and you can't have global
variables between a pb .DLL and the calling program -- you have to
pass paramaters to the .DLL. But I want my library to maintain
the arrays that are read by the main C program based on some
database I/O and TCP/IP connections that the library code would
be handling. The C programs would just be reading the arrays.
So, that brings me to FB -- will I have the same issue with FB
as I do with PB? Can I create libraries, preferably static libraries,
in FB, which will be able to share global variables with a C program
as long as they are declared in a certain way? I don't want
to deal with memory address pointers if I don't have to.
I want my library code to create/update variables in an array
like A(X,Y,Z), which the main C code can read. I thought all that
I would have had to do is make sure that the arrays are declared
the right way.
I can't do that with PB/CC as far as I can tell from their manual.
So, please tell me that I can do that with FB, or what you
suggest that's along these lines. And again, sorry if I sound like
an idiot, but it's been a while.
Dean
Please excuse me if I sound stupid on this -- it's been a while
that I've been playing with PDS and I'm only now getting back
into this stuff.
I recently started looking for new 32 bit basic compilers,
and I found FB, and also PowerBasic Console Compiler.
My objective was to start writing some libraries that other
C programmers here could call from their applications. I don't
know C, and it looks too weird for me to deal with.
So I thought I could make some statically linkable libraries,
that would share global variables with their C applications.
I've never used pointers to memory, and it seems like a pain
in the butt, so I'd rather just have simple global variables
between my libraries and the main C programs. For example,
I want my library functions to create arrays that are read by
the C program e.g., A(X,Y,Z). So these array variables need
to be global between the library and the main C programs.
First I had gotten the PB/CC, and I came to read in their manual
that they don't support static libraries, and you can't have global
variables between a pb .DLL and the calling program -- you have to
pass paramaters to the .DLL. But I want my library to maintain
the arrays that are read by the main C program based on some
database I/O and TCP/IP connections that the library code would
be handling. The C programs would just be reading the arrays.
So, that brings me to FB -- will I have the same issue with FB
as I do with PB? Can I create libraries, preferably static libraries,
in FB, which will be able to share global variables with a C program
as long as they are declared in a certain way? I don't want
to deal with memory address pointers if I don't have to.
I want my library code to create/update variables in an array
like A(X,Y,Z), which the main C code can read. I thought all that
I would have had to do is make sure that the arrays are declared
the right way.
I can't do that with PB/CC as far as I can tell from their manual.
So, please tell me that I can do that with FB, or what you
suggest that's along these lines. And again, sorry if I sound like
an idiot, but it's been a while.
Dean