freepascal

How to fix run-time error 201

家住魔仙堡 提交于 2019-12-02 14:07:59
help me, please. I don't know how to fix this error. Program Polynomial; type arrayOfInt = Array[1..21] of Integer; biggerArrayOfInt = Array[1..41] of Integer; function isNumber(c : Char): Boolean; var res : Boolean; code : Longint; begin code := Ord(c); if ((code > 47) AND (code < 58)) then begin res := true end else begin res := false; end; isNumber := res; end; function parsePolynomial(polynomial : String): arrayOfInt; var coeficients : Array[1..21] of Integer; number : Integer; coef : Integer; tmp : String; i, j : Integer; positive : Boolean; numberPosition, numberLength : Integer; expectX

How to call a list of the physically attached hard disks using Free Pascal, or, failing that, Delphi?

孤街浪徒 提交于 2019-12-01 16:35:10
Further to this question and this one that I asked more recently but without the correct specifics...and lastly this one that I asked at the Free Pascal forum specifically.... Can anyone provide me with guidance, examples or a link to something somewhere that explains how to call a list of the physically attached hard disks using Free Pascal, or, failing that, Delphi, regardless of whether the disks have been mounted by the operating system or not? An example is shown in the screenshot of what I am trying to achive (what is shown in this screenshot is by another software product). So pulling a

How to call a list of the physically attached hard disks using Free Pascal, or, failing that, Delphi?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 14:29:45
问题 Further to this question and this one that I asked more recently but without the correct specifics...and lastly this one that I asked at the Free Pascal forum specifically.... Can anyone provide me with guidance, examples or a link to something somewhere that explains how to call a list of the physically attached hard disks using Free Pascal, or, failing that, Delphi, regardless of whether the disks have been mounted by the operating system or not? An example is shown in the screenshot of

Delphi TFrame Create/Destroy

空扰寡人 提交于 2019-11-30 10:04:18
How to create (when I want to show it) and destroy (when I want to hide it) frames on the main TForm? Frames' align = alClient. I tried this: The form: unit main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, uFrame1, uFrame2; type TFormMain = class(TForm) procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } f1: TFrame1; f2: TFrame2; end; var FormMain: TFormMain; implementation {$R *.dfm} procedure TFormMain.FormCreate(Sender: TObject); begin f1 := TFrame1.Create(Self); f1.Parent :=

Exchanging strings (PChar) between a Freepascal compiled DLL and a Delphi compiled EXE

北城余情 提交于 2019-11-30 07:52:59
After a lot of experimentations, I found a way to exchange PChar from a FreePascal compiled DLL with a Delphi compiled EXE. I'm in charge of both the DLL and EXE source code but one MUST BE in FreePascal and the other one in Delphi. My solution involves the following methods in the DLL: function GetAString(): PChar; var aString: string; begin aString := 'My String'; result := StrAlloc(length(aString) + 1); StrPCopy(result, aString); end; procedure FreeString(aString: PChar); begin StrDispose(aString); end; And from the Delphi EXE, to call the GetAString method, I need to Call the GetAString

Why do Delphi and Free Pascal usually prefer a signed-integer data type to unsigned one?

南笙酒味 提交于 2019-11-30 06:39:45
I'm not a Pascal newbie, but I still don't know until now why Delphi and Free Pascal usually declares parameters and returned values as signed integers whereas I see them should always be positive. For example: Pos() returns type of Integer. Is it possible to be a negative? SetLength() declares the NewLength parameter as a type of Integer. Is there a negative length for string? System.THandle declared as Longint. Is there a negative number for handles? There are many decisions like those in Delphi and Free Pascal. What considerations were behind this? In Pascal, Integer (signed) is the base

Exchanging strings (PChar) between a Freepascal compiled DLL and a Delphi compiled EXE

♀尐吖头ヾ 提交于 2019-11-29 10:19:13
问题 After a lot of experimentations, I found a way to exchange PChar from a FreePascal compiled DLL with a Delphi compiled EXE. I'm in charge of both the DLL and EXE source code but one MUST BE in FreePascal and the other one in Delphi. My solution involves the following methods in the DLL: function GetAString(): PChar; var aString: string; begin aString := 'My String'; result := StrAlloc(length(aString) + 1); StrPCopy(result, aString); end; procedure FreeString(aString: PChar); begin StrDispose

How to build a Treeview design (a task group with tasks nesting hierarchy) using Inno Setup?

假如想象 提交于 2019-11-29 09:00:18
I'm trying to build a Treeview hierarchy of checkable elements and labels that must be more or less like this: Standalone Controls (label, root) |__Check/Uncheck all controls of all groups (checkbox) | | | |__Controls group 1 (group description label) | | |__Check/Uncheck all these controls (checkbox) | | |__Control name 1 (task) | | |__Control name 2 (task) | | |__Control name 3 (task) | | | |__Controls group 2 (group description label) | | |__Check/Uncheck all these controls (checkbox) | | |__Control name 1 (task) | | |__Control name 2 (task) | | |__Control name 3 (task) ...and so on. Or

Why do Delphi and Free Pascal usually prefer a signed-integer data type to unsigned one?

自作多情 提交于 2019-11-29 06:17:56
问题 I'm not a Pascal newbie, but I still don't know until now why Delphi and Free Pascal usually declares parameters and returned values as signed integers whereas I see them should always be positive. For example: Pos() returns type of Integer. Is it possible to be a negative? SetLength() declares the NewLength parameter as a type of Integer. Is there a negative length for string? System.THandle declared as Longint. Is there a negative number for handles? There are many decisions like those in

Difference between armeabi and armeabi-v7a

此生再无相见时 提交于 2019-11-29 02:31:45
问题 As far as I can tell from the docs, the difference between the two supported flavors of ARM architecture in Android NDK is only in the set of supported CPU instructions. Is that really so? Is there no difference in calling conventions, or system call sequence, or something else? I'm wondering what will happen if I compile a module to an ARM object file (with a compiler other than NDK - Free Pascal specifically), specifying ARMv6 as the architecture, and then link it to both armeabi and