fpc

Free Pascal for Android on MIPS

萝らか妹 提交于 2019-12-08 19:34:05
问题 Trying to port a Delphi library to Android. Free Pascal has Android/ARM support - a prebuilt compiler for Windows is available. However, Android NDK now supports MIPS and x86 as well. What's the status of support for those in FPC? For now, my project is more or less CPU agnostic - the native bits are built for all four supported architectures. Don't want to let go of that. I'm not after the full cycle of Android development in Pascal - just an algorithm library that does no I/O. I tried

Exporting overloaded functions with fpc

吃可爱长大的小学妹 提交于 2019-12-08 07:35:26
问题 I need to create a dll within fpc (delphi-mode). It works fine - but for some reasons, I want to do something (in a unit) like function doSomeThing(a:type1):type2;stdcall; function doSomeThing(a:type3):type4;stdcall; and in the library (for building the dll using the unit above) exports doSomeThing(a:type1) name 'doSomeThingTYPE1', doSomeThing(a:type3) name 'doSomeThingTYPE3'; The syntax is self explanatory and is told in How to export Overload functions from DLL? . But it seems to be

GUI Only By Using FPC

我们两清 提交于 2019-12-07 06:28:45
问题 I want to know how I can develop GUI applications(32 Bits) without using Delphi language(Object Pascsl), only by using FPC with Lazarus installed(Pascal). Thanks. 回答1: Use a widget set directly. Look at e.g. the examples in packages/gtk2 for unix, or the windows win32api usage demo. (demo\win32 in the FPC win32 installation) But not using lazarus makes you lose platform independance, and a lot of ease. Looking how lazarus does it, is still a possibility. A second option is https://github.com

Best way for read and write a text file

孤街醉人 提交于 2019-12-07 05:43:50
问题 I am using the latest version of Lazarus IDE and I have a Memo1 on my TForm1. I have to load a text file in Memo1 and then edit every line of the Memo (I use Memo1.Lines.Strings[i] := ... ). At the end I must save the edited memo at a particular path. Question : I am looking for the faster way between: Load the whole text inside the memo, edit its content and save into a new file (load all -> edit all -> write all) Do a while loop (until the end of my *.txt file) that reads the file line by

How can I compile a Lazarus Apache module to Apache 1.3, 2.0 and 2.2 selectively?

℡╲_俬逩灬. 提交于 2019-12-07 00:31:31
I've had a look at /etc/fpc.cfg and there is mention to some defines: FPCAPACHE_1_3 FPCAPACHE_2_0 Then in the fcl-web examples there is mention to: Apache1_3 The only one I've found is on the apr.pas on both these files: /usr/share/fpcsrc/2.4.0/packages/httpd20/src/apr/apr.pas /usr/share/fpcsrc/2.4.0/packages/httpd22/src/apr/apr.pas So how does the compiler decide what version of APR to compile? If you enable the right one of those conditionals/directives afaik, the rest of the fpc.cfg should put the corresponding httpd dir first in the compilers search path, so that that version gets taken.

Best way for read and write a text file

廉价感情. 提交于 2019-12-05 08:24:45
I am using the latest version of Lazarus IDE and I have a Memo1 on my TForm1. I have to load a text file in Memo1 and then edit every line of the Memo (I use Memo1.Lines.Strings[i] := ... ). At the end I must save the edited memo at a particular path. Question : I am looking for the faster way between: Load the whole text inside the memo, edit its content and save into a new file (load all -> edit all -> write all) Do a while loop (until the end of my *.txt file) that reads the file line by line, edit the content and save it in the new file. (load line -> edit -> write | load -> edit -> write

Problem compiling a WebLaz project under Lazarus

旧巷老猫 提交于 2019-12-04 18:26:29
My specs: OS: Ubuntu 10.04 LTS amd64 fpc: 2.4.0 lazarus: 0.9.28 I'm trying to compile a WebLaz project just by creating one and then compiling. Somehow the compiler gets all lost when determinig witch httpd and fpapache Units to use. I've found similar problems in the forums: mod_helloworld.lpr Can't find fpapache Unit ... I NEED HELP with fpweb ... After trying some of the solutions provided there I'm still at this point: Project compiles fine if I only have httpd22 under the Compiled units and the Source for the packages. Alas it then completely fails to link. With the original fpc/lazarus

Class Reference as Property

那年仲夏 提交于 2019-12-03 09:55:50
问题 Google is useless for these sorts of searches, because you get hundreds of millions of results absolutely none of which relate to the specific question. The question is simply this: Is it possible to have a Class Reference Property in Delphi? If so, how? Here's what I've tried... type TMyObject = class // ... end; TMyObjectClass = class of TMyObject TMyObjectA = class(TMyObject) // specifics here end; TMyObjectB =class(TMyObject) // specifics here end; TMyComponent = class(TComponent) private

What is the implementation of sets used in pascal?

我与影子孤独终老i 提交于 2019-12-01 23:29:38
问题 I want to know the actual implementation of the set type in pascal, provided by the language. Specially, I would like to know the one used in the freepascal runtime library, but I'm interested in any pascal implementation. I care about the run-time complexity of it. The best implementations of Disjoint-set data structure are in O(log*n), and I wish to know if pascal implementation has this one. The doc for the fpc rtl is found here: ftp://ftp.freepascal.org/pub/fpc/docs-pdf/rtl.pdf , but it's

What is the implementation of sets used in pascal?

别说谁变了你拦得住时间么 提交于 2019-12-01 21:38:32
I want to know the actual implementation of the set type in pascal, provided by the language. Specially, I would like to know the one used in the freepascal runtime library, but I'm interested in any pascal implementation. I care about the run-time complexity of it. The best implementations of Disjoint-set data structure are in O(log*n) , and I wish to know if pascal implementation has this one. The doc for the fpc rtl is found here: ftp://ftp.freepascal.org/pub/fpc/docs-pdf/rtl.pdf , but it's too large (>1700 pages) for looking for this without knowing if it's even there. The freepascal wiki