I'm new in creating custom functions. So my question is:
Can I translate the source code of a C-program to a filemaker custom function and - if yes- how can I do this?
Anybody tried this?
You should be asking questions in the Discussions space. Perhaps tsplatypus or TSGal can help you move the post there?
if the code is short, you may wish to post it here. remember that the functions have limited connection to outside-FileMaker actions. Plug-in development, OTOH, may be more what you wish to study (start on this page):
FileMaker Pro and other Computer Software Technology | FileMaker
(specifically the "FileMaker Plug-in Support" section - follow all the links!)
Thank you for your post!
You can always move a post via the "Move" action in the top right of a Thread you create. I will go ahead and move this one to Discussions (as beverly suggested) so that you might receive more views and further feedback.
As Beverly already said, it depends. Certainly, the logic from a C function (or any other programming language, for that matter) can be translated to FileMaker. FileMaker is Turing-complete, so it's theoretically capable of any computation any other language is capable of.
There's more to code than the logic, though. If your C function is using a library that does something FileMaker doesn't, that makes it harder (not necessarily impossible). I/O operations are a big sticking point here. Some features of the C language don't exist in FileMaker, and have to be achieved some other way, e.g., pointers, structs, macros, memory management, bit-wise data manipulation, etc. Some functions take advantage of the particular features of C to work well, but a different approach to achieve the same result might work better for FileMaker.
Logic maybe, but C is so pointer and memory-management heavy, there wouldn't be a statement for statement translation. Plus, FMP doesn't support structs and other data structures, libraries, and such.
If you have lots of C code, you might be better off creating a micro service and calling that code from FMP's INSERT FROM URL or a CURL command. A micro service just listens on a port on your computer and can accept HTTP command verbs from any program that can create them: a browser, FMP -- you can even call it from the command line. (I write my services in Java, but I would bet there are C capabilities out there.)
Finally, the micro service doesn't "depend" on FMP so multiple users can access your function library without these compatibility concerns.
In Java, you might be able to use its Native interface to execute C code and then call that Java code from FMP, but that approach is fraught with security risks.
Java Native Interface - Wikipedia
Or, just convert the logic to FMP.
many thanx for all your answers and proposals. although i don't know yet how i will manage my problem, you gave me good inspirations to continue with my solution.
I think the others have covered most of the C to FileMaker programming questions and issue. Here are few sources for useful custom functions that may be helpful:
Brian Dunning: FileMaker Pro Custom Functions
FileMaker Standards.org: fmpstandards/Functions at master · petrowsky/fmpstandards · GitHub
The people that have put these together and made them available to the developer community have done a great job and been incredibly generous in doing so.
Plug-ins are created using C. Creating custom plug-ins
this site, too:
this link to FM12 is valuable! the link in the first reply may have updated information.
Retrieving data ...