Developing plug-ins in Free/Object Pascal: Delphi, Embarcadero, Lazarus, etc

A place where plug-in developers can share their knowledge and experience.
gamma
Posts: 19
Joined: Wed 16 Apr, 2008 17:06

Re: FAR2 and Pascal/Delphi

Post by gamma »

Latest post of the previous page:

t-rex, thank you for the detailed answer. Although it looks like a frustrating amount of work in order to be able to just handle Unicode file names, I think I will start slowly using Max' sources as a guide.
olesio
Posts: 12
Joined: Sat 18 Jun, 2011 14:02

Multiple lines in Message (Delphi source code).

Post by olesio »

Hello.

I'm total newbie in plugin writing. But I want to make simple plugin by myself. And I have problem with one simple thing. How can I wrote text in many line in message? I tried #13#10 and #10 chars but it display it and do not help. Please give me some example in Delphi language. Thanks in advice.
User avatar
t-rex
Страшный и ужасный
Posts: 4910
Joined: Tue 15 Mar, 2005 16:17
Location: Tel-Aviv
Has thanked: 1 time
Been thanked: 8 times
Contact:

Re: Multiple lines in Message (Delphi source code).

Post by t-rex »

User avatar
t-rex
Страшный и ужасный
Posts: 4910
Joined: Tue 15 Mar, 2005 16:17
Location: Tel-Aviv
Has thanked: 1 time
Been thanked: 8 times
Contact:

Re: Multiple lines in Message (Delphi source code).

Post by t-rex »

the example is for an older far version, but the idea is the same
olesio
Posts: 12
Joined: Sat 18 Jun, 2011 14:02

Re: Multiple lines in Message (Delphi source code).

Post by olesio »

@t-rex: Thank you for reply and example :) It help me a lot. Now all works fine.
User avatar
citRiks
Posts: 1733
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 610 times
Been thanked: 102 times

Developing plug-ins in Free/Object Pascal: Delphi, Embarcadero, Lazarus, etc

Post by citRiks »

Hello, thank you for sharing and caring, and you do it a lot :)
Good stuff, I am going to make use of it.
The sad part is, applying on editor selection is not working with any "external filter".
applying on the editor context seems to be ok.
i downloaded and installed Delphi (Embarcadero) for that purpose,
thinking probably i can fix it, considering your projects are in Delphi,
and by the incident i have had rather huge background in Delphi development (many years ago however).
Community edition, 10.3.3 (2019), licensed for 366 days trial, or something like that.
That is to say, legal, fresh installation.
And now i have even more sadness and questions, if you can help ?
The new Delphi is not working. At all.
It throws immediatly upon starting, either very soon after that, exceptions like:
"access violation at address 0x.. in module .... read of address 0x...
(different modules and memory addresses here)
Also when i create "hello world" app, or whatever basic.
On computer where works flawlessly several versions of Visual studio, VSCode, Eclipse, Java NetBeans, mingw/msys, and other regular stuff as well.
Here is legal fresh Delphi without any additional components.
i read about potential problems with delphi components, even TChart coming with Delphi installation,
so installed without any components beside Delphi x32 on the x32 host.
restarts, hour plus of googling and suggested registry tricking (HKCU\Software\Delphi\BDS). no love.

so, can you tip here me, and probably other folks,
how to make use of modern Delphi for FAR plugins build and debugging?

I got impression, Lazarus have compatibility with delphi projects?
am i wrong, or can it be the solution?

My host configuration:
Windows 7 Home edition x86, SP1
Delphi is from yesterday download, official community version (embarcadero)

Last edited by citRiks on Sun 18 Oct, 2020 17:09, edited 4 times in total.
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

Filters

Post by pepak »

citRiks wrote: Wed 14 Oct, 2020 11:17The sad part is, applying on editor selection is not working with any "external filter".
Seems to work fine for me as well. Note though that Filters is only applicable to regular blocks, not vertical blocks.
I took a look into the code, and it is not supposed to work by design too :)
there is something with 5 lines from the cursor, and not on selection.
Could you maybe be a bit more specific. I actually think that I designed the plugin precisely with the idea of supporting blocks.
The new Delphi is not working. At all.
It throws immediatly upon starting, either very soon after that, exceptions like:
Hard to say. Admittedly, I don't really do too much testing with Delphi 10.4 as my main development branches are Delphi 10 and Delphi XE2, but I find it unlikely that it would stop working so completely. Perhaps if the code was designed for pre-Unicode Delphi, then I could understand it, but not if I develop with Delphi 10 - the changes are not that big.

I would recommend compiling the plugin in DEBUG mode and using the Log function from the uLog method to mark its progress.
so, can you tip here me, and probably other folks,
how to make use of modern Delphi for FAR plugins build and debugging?
Building - use the build.bat scripts for that purpose. They have very few dependencies, basically just the compiler itself, everything else is set up to be self-sufficient.

Debugging - most of my plugins have their .dproj file set up so that if you copy the files to the appropriate places, the debugging will work "out of the box" - you simply "run" the plugin using F9 and FAR will start; you can place breakpoints within the plugin and they will react. The setup is:

- Copy FAR3 x86 to C:\fartest\far3
- Extract the plugin source code to C:\source\(plugin_name) (e.g. you would get C:\source\filters\bin\FiltersEng.lng); it may be a good idea to delete the old .dll files, although I don't think it's actually necessary.
I got impression, Lazarus have compatibility with delphi projects?
am i wrong, or can it be the solution?
Not sure. The GUI certainly isn't compatible, but I don't use that. I don't know how up-to-date is Lazarus (or FreePascal) with the modern Delphi features. Not that I use too many, but I do make use of both Unicode and generics, so these are required.
seems to be, I start to understand why and how Delphi went down to about zero popularity. Any other development enviroment run proper on the host, beside new Delphi. and all the internet is full of complaints to "access violation" without solution to it
I am pretty sure this is some problem related to your system specifically. Delphi do have their problems, sometimes serious problems, but what you describe is definitely not common.
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

Filters

Post by pepak »

Anyway, I just made a quick test with Delphi 10.4 compile and the plugin compiles without any issues and whatever I tried to do with it, it worked fine. Including the "external filter on a selection".
User avatar
citRiks
Posts: 1733
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 610 times
Been thanked: 102 times

Filters

Post by citRiks »

pepak, thank you for answering! i am going to provide you a lot of dull notes, keep on :)if you can
User avatar
citRiks
Posts: 1733
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 610 times
Been thanked: 102 times

Filters

Post by citRiks »

Oh, dear. I almost though i defeated the Embarcader new Delphi installation and use.
But, see the screen
image.png
There was is kind of progress, because i installed it not in default "C:\Program Files\..", but in the disk root, so that it can be without spaces in the path. And it behaves Ok some time, but continues to show this strange things, i dont know what is consequense and is it usable still
User avatar
citRiks
Posts: 1733
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 610 times
Been thanked: 102 times

Filters

Post by citRiks »

pepak wrote: Wed 14 Oct, 2020 18:27 The new Delphi is not working. At all.
It throws immediatly upon starting, either very soon after that, exceptions like:

Hard to say. Admittedly, I don't really do too much testing with Delphi 10.4 as my main development branches are Delphi 10 and Delphi XE2, but I find it unlikely that it would stop working so completely. Perhaps if the code was designed for pre-Unicode Delphi, then I could understand it, but not if I develop with Delphi 10 - the changes are not that big.
I would be happy to be wrong, i would also hard to believe, that this once kind of industry leader and industry standard, deteriorated so much, beyond any expectations.
Their current version is 10.3 of 2019, i took community edition RAD, and only choose Delphi x32 to isntall, with no extra-components (Them said on the stackoverflow there is often to be problems with any extra components choosen upon the installation)
So far my attempt to install and make use of it:
1.) Windows 7 HomePremium, x32, SP1. Restarts, reainstalls to places without spaces in the path, no luck
2.) Windows 7 Professional, x64, SP1. Th same as 1.)

Hacked version 10.4 from internet hacked downloads, unoficial preview beta.
Started to work partially at least, when installed to root of the disk, that is to say, so it can be without spaces in the installation path.
From here i put in the previous message the print screen with the error which still happen to be, probably there is more of it
Last edited by citRiks on Sat 17 Oct, 2020 15:51, edited 1 time in total.
User avatar
citRiks
Posts: 1733
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 610 times
Been thanked: 102 times

Filters

Post by citRiks »

[/quote]
citRiks wrote: Sat 17 Oct, 2020 15:46 Perhaps if the code was designed for pre-Unicode Delphi, then I could understand it, but not if I develop with Delphi 10 - the changes are not that big.
No, there is no any exotic code, i only tried to create some new "Hello world" proiject from the scratch, and immediatly from the scratch its tarted to crush about "memory access", i wrote the exact message in the previous this topic page.
Probably you can send the installation of your own?
Even without license key? I will do trial or whatever what will work with it.
It seems to me, previous versions is not appear on the oficial site.
Last edited by citRiks on Sat 17 Oct, 2020 16:01, edited 2 times in total.
User avatar
citRiks
Posts: 1733
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 610 times
Been thanked: 102 times

Filters

Post by citRiks »

A better view to "hello world" new project in the new Delphi, as it is in 2020 :)
image.png
User avatar
citRiks
Posts: 1733
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 610 times
Been thanked: 102 times

Filters

Post by citRiks »

pepak, propably you would sign in into the thematic far-dedicated telegram chanel here?
there is lot of useful communication, an probably it will be more convenient and appropriate to help with Delphi there,
because i am not sure moderation here will allow to us discuss Delphi on the phorum.
(although i think it yes appripriate, because we actually discuss far plugins building in Delphi)

https://t.me/FarManager
Last edited by citRiks on Sat 17 Oct, 2020 16:23, edited 1 time in total.
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

Filters

Post by pepak »

citRiks wrote: Sat 17 Oct, 2020 15:53Probably you can send the installation of your own?
I am sorry, but I can't legally do that.
citRiks wrote: Sat 17 Oct, 2020 16:23 pepak, propably you would sign in into the thematic far-dedicated telegram chanel here?
I don't use any IM and I don't want to start.
there is lot of useful communication, an probably it will be more convenient and appropriate to help with Delphi there,
because i am not sure moderation here will allow to us discuss Delphi on the phorum.
(although i think it yes appripriate, because we actually discuss far plugins building in Delphi)
Note that the problem is almost certainly related to your installation of Delphi, irrespective of any FAR issues. The error messages you posted strongly indicate that is the case. If I were to hazard a guess, I would say that the antivirus software you use either interferes incorrectly with some core Delphi library, or it deleted or modified that library during installation. I would definitely recommend that you create a new virtual machine with just Windows and nothing else, then install Delphi into it - I expect it will run just fine without any of the issues you describe.
User avatar
citRiks
Posts: 1733
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 610 times
Been thanked: 102 times

Filters

Post by citRiks »

pepak,
pepak wrote: Sat 17 Oct, 2020 17:43almost certainly related to your installation of Delphi, irrespective of any FAR issues.
I think, it is related to FAR, because i tried to make something with your plugin :)
Furthermor, it happens to, i have two decent computers, without antivurus (i prefer to check stuff with VirusTotal)
On both computers it is exactly the same problem :(
I may triy it on some virtual machine, but it is kind of bad practice,
if i cant use it on my regular machines, it is kind of unreliable to work with it.
I will do the test with some new virtual, newly installed, but i hate the idea already .. will see..
or it deleted or modified that library during installation.
Can not be, it was clean installation, without anything tricky, on TWO computers where any other numeruos software and IDEs works flawlessly
Post Reply

Return to “Plug-In Developers”