Convert Object Pascal to C++
August 27, 2015 —
BarryK
I worked through this example app that uses a SQLite database:
http://docwiki.appmethod.com/appmethod/1.16/topics/en/Mobile_Tutorial:_Using_FireDAC_and_SQLite_%28iOS_and_Android%29
Some of the code is obscure, however, I do hope to eventually grasp what is going on.
I have made some mods to the example, one of which is to have a 'blob' datatype in one column of the database.
But then, I did not know how to convert text into blob format for storing in the database. Then found this:
http://www.fmxexpress.com/read-and-write-a-blob-field-using-firedac-with-firemonkey-on-android-and-ios/
FMX is an ancronym for Firemonkey, the UI framework used by Appmethod. http://www.fmxexpress.com is a very interesting site, lots of examples, but it shows the Delphi heritage and most code is in Object Pascal.
The blob-read-write code is also in Object Pascal, however I found a converter:
http://compilers.iecc.com/comparch/article/09-11-056
...downloading it now. It's a Windows executable.
Comments
No, that converter is too complicated.However, I found this:
http://www.thinkersoftware.com/d2c/index.htm
...Delphi 2 Cpp Builder, does a reasonable job, designed to convert code fragments.
I used it, but it is hardly worth the trouble. It converted such a small part of my code-snippet, that I might as well just have done it all manually.
Hardly worth using for free, certainly not for the 40 bucks they want after 30 days.
My opinion of course! -- maybe others will have more joy with it.
Tags: general