Creating Metatrader Dlls with Lazarus / Free Pascal @ Forex Factory

Total Page:16

File Type:pdf, Size:1020Kb

Creating Metatrader Dlls with Lazarus / Free Pascal @ Forex Factory 5/4/2014 Creating Metatrader DLLs with Lazarus / Free Pascal @ Forex Factory Login 6:21am Google Powered Home Forums Trades Calendar News Market Brokers Platform Tech / 7 Subscribe Reply to Thread Options Creating Metatrader DLLs with Lazarus / Free Pascal Search This Thread Page 1 2 3 4 5 First Unread Last Post Go to Post# Go to Page# First Post: Feb 6, 2010 5:54pm | Edited Dec 15, 2010 3:06am Quote Post 1 Bookmark Thread 7bit Printable Version In this thread i will try to collect all the small bits of information that are not so obvious but needed to create DLLs that play together with Metatader, a collection of minimal and self contained code snippets that illustrate how things are done. The intended audience are people already familiar with programming, this is no Pascal tutorial, i will focus only on all the little things that need to be known for Metatrader specific development projects. I will use Lazarus, the free IDE containing the the Free Pascal compiler FPC, an excellent and very advanced (Object- )Pascal Compiler. I chose Lazarus/FPC because it is by far the easiest and most efficient tool for this job that is available today, and it is free! Make sure you are downloading the 32 bit version, even if you are running Windows 64 bit on x64 hardware, Metatrader is a 32 bit application and can only use 32 bit DLLs, the 64 bit version of Lazarus/FPC would by default produce 64 bit binaries which can not be used for our purpose. To create a new DLL project (if you started Lazarus for the first time) click on Project -> new project -> Library. Give it a meaningful name and save it into an empty folder. The project will initially consist of only two files. An .lpi file containing all compiler settings and and .lpr file containing the source code, these two files are all you need to backup, pass on to your colleagues or manage in a source code repository. Additional units (if you decide to split up bigger projects) are saved as individual .pas files. If you come from a C background you will find it notable that there is no need for make, .def or whatever-files, everything that compiler and linker need to know is written in the pascal source itself, you simply throw the main unit at the compiler and it will figure out everything by itself: http://www.at.freepascal.org/advantage.html I will expand this first Posting over time with examples of increasing complexity, whenever I have new examples. 1. Minimal example with strings I will start this thread with a minimal example of a working dll that will show you how to pass strings to your DLL and how to return strings to Metatrader. Since we are using modern Object-Pascal instead of ancient and clumsy C or C++ it is really easy and intuitive: This is all that is needed on the Pascal side: Inserted Code [b]library[/b] minimal; [color=DeepSkyBlue]{$mode objfpc}{$H+}[/color] FXCM Specs [b]uses[/b] sysutils; Similar Threads Free trial- MYFX - [color=SeaGreen]// strings from and to Metatrader will always be passed METATRADER plug in - // as PChar which is a pointer to a nullterminated C-string.[/color] revolutionising trade [b]function[/b] foo(x: double; y: [color=Blue]PChar[/color]): [color=Blue]PChar[/color]; [b management - ][color=Red]stdcall[/color][/b]; metatrader [b]var[/b] 32 replies s :[color=Black]ansistring[/color]; [color=SeaGreen]// reference counted and memory manag Free EA Creating ed strings.[/color] Software 2 replies [b]begin[/b] IPC with Lazarus and [color=SeaGreen] // our PChar will be copied into an ansistring automatically, MT4 // no need to worry about the ugly details of memory allocation.[/color] 0 replies s := 'Hello ' + FloatToStr(x) + ' ' + y + '!'; A Free Indicator for Metatrader Mt4 [color=SeaGreen] // cast it back into a pointer. Metatrader will copy the 10 replies // string from the pointer into it's own memory.[/color] result := [color=Blue]PChar[/color](s); [b]end;[/b] [b]exports[/b] foo; [b] begin end.[/b] and this is the corresponding mql4: Inserted Code http://www.forexfactory.com/showthread.php?t=219576 1/9 5/4/2014 Creating Metatrader DLLs with Lazarus / Free Pascal @ Forex Factory #import "minimal.dll" [color=SeaGreen]// declare the imported function exactly as it is exported by the dll[/c olor] [color=Blue]string[/color] foo(double x, [color=Blue]string[/color] y); #import int init(){ [color=Blue]string[/color] s = foo(42.3, "Worlds"); Print(s); [color=SeaGreen]// will print "Hello 42.3 Worlds!"[/color] } int start(){ } The very first and most important thing you need to know about DLLs used for MT4 is marked with red color: Metatrader assumes the 'stdcall' calling convention which means MT4 will push the arguments onto the stack from right to left and our function is responsible for cleaning the stack before returning. FPC's default calling convention would be 'register', also known as 'Borland fastcall', which would use processor registers for the first three 32 Bit arguments. Using the wrong calling convention would immediately crash Metatrader with a segfault due to a messed up stack. Thus we must decorate all exported functions with the keyword stdcall. Another option for achieving the same goal would be the compiler directive {$CALLING STDCALL} at the top of each unit containing exported functions. 2. Passing doubles and integers by reference By reference means in Metatrader simply putting an ampersand & behind the type identifier in the function declaration and the function can then write values to these arguments. This is a convenient way to return more than one value from a Home funcFtoiornu.m Usnfortunately wiTthra imdepsorted functionsC athleisn sdeaer ms only possibNlee wsith arrays. For soMmaer wkeetird reason we caBnronkoetrs just pass scalar values by reference to a DLL, MT4 would just push a bunch of zeros onto the stack which is quite useless. We need to do this with the help of arrays. If we pass an array by reference MT4 will pass a Pointer to the first array element which is easily handled in Pascal either by a typed pointer to an array that can be dereferenced or even more elegantly by declaring the arguments with the keyword var which is technically the same, only nicer: Inserted Code [b]library[/b] testlib; [color=DeepSkyBlue]{$mode objfpc}{$H+}[/color] [b]type[/b] TDPair = array[0..1] of double; TIPair = array[0..1] of LongInt;[color=SeaGreen] // 32 bit int[/color] [color=SeaGreen]// function parameters declared as var will accept pointers.[/color] [b]procedure[/b] VarsByReference([color=Red][b]var[/b][/color] a: TDPair; [color=Red][b]var [/b][/color] b: TIPair); stdcall; [b]begin[/b] [color=SeaGreen]// now let's make some changes to the variables[/color] a[0] += a[1]; a[1] -= a[0]; b[0] += b[1]; b[1] -= b[0]; [b]end;[/b] [b]exports[/b] VarsByReference; [b]begin[/b] [b]end.[/b] and in mql4: Inserted Code Platform Tech / Creating Metatrader DLLs with Lazarus / Free Pascal Page 1 2 3 4 5 http://www.forexfactory.com/showthread.php?t=219576 2/9 5/4/2014 Creating Metatrader DLLs with Lazarus / Free Pascal @ Forex Factory #import "testlib.dll" [color=SeaGreen] /** * the function takes 2 arrays which will be * passed by reference. On the DLL side this * means we will receive Pointers to the * the memory locations of the arrays */[/color] void VarsByReference(double[b][color=Red]&[/color][/b] a[], int[b][color=Red]&[/color] [/b] b[]); #import int init(){ double foo[2];[color=SeaGreen] // define pair of doubles[/color] int bar[2]; [color=SeaGreen]// define pair of integers[/color] foo[0] = 1.23; foo[1] = 4.56; bar[0] = 42; bar[1] = 23; VarsByReference(foo, bar); [color=SeaGreen]// print the changed values[/color] Print(foo[0]); Print(foo[1]); Print(bar[0]); Print(bar[1]); } int start(){ } 3. Giving the DLL access to all bars in the chart mql4 has two interesting functions: ArrayCopyRates() and ArrayCopySeries(). These functions, when applied to an empty array, do something interesting with it. Despite the name "copy" they don't actually copy anything, instead they replace the array entirely with something different and very interesting: Once you have applied one of these functions to an array variable, this variable will from now on behave exactly like one of the built-in arrays Time[], Open[], High[], Low[], Close[], Volume[]. It will automatically update when new ticks come in and if you now pass such an array by-reference to your DLL your DLL will receive a pointer to a memory location containing always up to date quotes. We will use ArrayCopyRates() since this will give us the pointer to a 2-dimensional array, containing time and OHLCV for every bar in the chart. There is only one noteworthy thing: in mql these series arrays always start with 0 being the current bar, in reality when accessing the memory directly in our DLL, it starts with 0 being the oldest bar and we need to pass an additional parameter to tell the DLL how many bars there are in total so it can figure out which one is the current one. (The array has no upper bound but values beyond the current index (Bars-1) are undefined and meaningless.) The following example will calculate a simple moving average over the last 14 close prices to illustrate this concept, the mql4 EA will call this function and plot an arrow into the chart at the calculated price: Inserted Code [b]library[/b] testlib; [color=MediumTurquoise]{$mode objfpc} {$H+}[/color] [b]type[/b] [color=SeaGreen]{ MT4 stores the data of each candle in such a structure.
Recommended publications
  • LAZARUS UNDER the HOOD Executive Summary
    LAZARUS UNDER THE HOOD Executive Summary The Lazarus Group’s activity spans multiple years, going back as far as 2009. Its malware has been found in many serious cyberattacks, such as the massive data leak and file wiper attack on Sony Pictures Entertainment in 2014; the cyberespionage campaign in South Korea, dubbed Operation Troy, in 2013; and Operation DarkSeoul, which attacked South Korean media and financial companies in 2013. There have been several attempts to attribute one of the biggest cyberheists, in Bangladesh in 2016, to Lazarus Group. Researchers discovered a similarity between the backdoor used in Bangladesh and code in one of the Lazarus wiper tools. This was the first attempt to link the attack back to Lazarus. However, as new facts emerged in the media, claiming that there were at least three independent attackers in Bangladesh, any certainty about who exactly attacked the banks systems, and was behind one of the biggest ever bank heists in history, vanished. The only thing that was certain was that Lazarus malware was used in Bangladesh. However, considering that we had previously found Lazarus in dozens of different countries, including multiple infections in Bangladesh, this was not very convincing evidence and many security researchers expressed skepticism abound this attribution link. This paper is the result of forensic investigations by Kaspersky Lab at banks in two countries far apart. It reveals new modules used by Lazarus group and strongly links the tools used to attack systems supporting SWIFT to the Lazarus Group’s arsenal of lateral movement tools. Considering that Lazarus Group is still active in various cyberespionage and cybersabotage activities, we have segregated its subdivision focusing on attacks on banks and financial manipulations into a separate group which we call Bluenoroff (after one of the tools they used).
    [Show full text]
  • Lazarus Under the Hood Kaspersky Lab Global Research and Analysis Team Executive Summary
    Lazarus Under The Hood Kaspersky Lab Global Research and Analysis Team Executive Summary The Lazarus Group’s activity spans multiple years, going back as far as 2009. Its malware has been found in many serious cyberattacks, such as the massive data leak and file wiper attack on Sony Pictures Entertainment in 2014; the cyberespionage campaign in South Korea, dubbed Operation Troy, in 2013; and Operation DarkSeoul, which attacked South Korean media and financial companies in 2013. There have been several attempts to attribute one of the biggest cyberheists, in Bangladesh in 2016, to Lazarus Group. Researchers discovered a similarity between the backdoor used in Bangladesh and code in one of the Lazarus wiper tools. This was the first attempt to link the attack back to Lazarus. However, as new facts emerged in the media, claiming that there were at least three independent attackers in Bangladesh, any certainty about who exactly attacked the SWIFT systems, and was behind one of the biggest ever bank heists in history, vanished. The only thing that was certain was that Lazarus malware was used in Bangladesh. However, considering that we had previously found Lazarus in dozens of different countries, including multiple infections in Bangladesh, this was not very convincing evidence and many security researchers expressed skepticism abound this attribution link. This paper is the result of forensic investigations by Kaspersky Lab at banks in two countries far apart. It reveals new modules used by Lazarus group and strongly links the SWIFT system attacking tools to the Lazarus Group’s arsenal of lateral movement tools. Considering that Lazarus Group is still active in various cyberespionage and cybersabotage activities, we have segregated its subdivision focusing on attacks on banks and financial manipulations into a separate group which we call Bluenoroff (after one of the tools they used).
    [Show full text]
  • Rapid Application Development Resumo Abstract
    Rapid Application Development Otavio Rodolfo Piske – [email protected] Fábio André Seidel – [email protected] Especialização em Software Livre Centro Universitário Positivo - UnicenP Resumo O RAD é uma metodologia de desenvolvimento de grande sucesso em ambientes proprietários. Embora as ferramentas RAD livres ainda sejam desconhecidas por grande parte dos desenvolvedores, a sua utilização está ganhando força pela comunidade de software livre. A quantidade de ferramentas livres disponíveis para o desenvolvimento RAD aumentou nos últimos anos e mesmo assim uma parcela dos desenvolvedores tem se mostrado cética em relação a maturidade e funcionalidades disponíveis nestas ferramentas devido ao fato de elas não estarem presentes, por padrão, na maioria das distribuições mais utilizadas. Além disso, elas não contam com o suporte de nenhum grande distribuidor e, ainda que sejam bem suportadas pela comunidade, este acaba sendo um empecilho para alguns desenvolvedores. Outro foco para se utilizar no desenvolvimento RAD é a utilização de frameworks, onde esses estão disponíveis para desenvolvimento em linguagens como C e C++ sendo as mais utilizadas em ambientes baseados em software livre, embora estas linguagens não sejam tão produtivas para o desenvolvimento de aplicações rápidas. Abstract RAD is a highly successful software development methodology in proprietary environments. Though free RAD tools is yet unknown for a great range of developers, its usage is growing in the free software community. The amount of free RAD tools available has increased in the last years, yet a considerable amount of developers is skeptic about the maturity and features available in these tools due to the fact that they are not available by default on the biggest distribution.
    [Show full text]
  • Modern Object Pascal Introduction for Programmers
    Modern Object Pascal Introduction for Programmers Michalis Kamburelis Table of Contents 1. Why ....................................................................................................................... 3 2. Basics .................................................................................................................... 3 2.1. "Hello world" program ................................................................................. 3 2.2. Functions, procedures, primitive types ....................................................... 4 2.3. Testing (if) ................................................................................................... 6 2.4. Logical, relational and bit-wise operators ................................................... 8 2.5. Testing single expression for multiple values (case) ................................... 9 2.6. Enumerated and ordinal types and sets and constant-length arrays ......... 10 2.7. Loops (for, while, repeat, for .. in) ............................................................ 11 2.8. Output, logging ......................................................................................... 14 2.9. Converting to a string ............................................................................... 15 3. Units .................................................................................................................... 16 3.1. Units using each other .............................................................................. 18 3.2. Qualifying identifiers with
    [Show full text]
  • Beginners' Guide to Lazarus
    Beginners’ Guide to Lazarus IDE Conquering Lazarus in bite-size chunks! An E-book on Lazarus IDE to help newbies start quickly by Adnan Shameem from LazPlanet First Edition: 15 December 2017 This book is licensed under Creative Commons Attribution 4.0 International (can be accessed from: https://creativecommons.org/licenses/by/4.0/). You can modify this book and share it and use it in commercial projects as long as you give attribution to the original author. Such use and remix is encouraged. Would love to see this work being used in the Free Culture. Source files for this E-book can be found at: https://github.com/adnan360/lazarus-beginners-guide Fork and remix. Have fun! i Contents 1: What is Lazarus........................................................................................................................................ 1 2: How to Install........................................................................................................................................... 2 3: How to Create Your First Program...................................................................................................... 3 4: How to Position Stuff on a Form........................................................................................................ 5 5: How to Customize your Tools.............................................................................................................. 7 6: How to use Events................................................................................................................................
    [Show full text]
  • Free Pascal and Lazarus Programming Textbook
    This page deliberately left blank. In the series: ALT Linux library Free Pascal and Lazarus Programming Textbook E. R. Alekseev O. V. Chesnokova T. V. Kucher Moscow ALT Linux; DMK-Press Publishers 2010 i UDC 004.432 BBK 22.1 A47 Alekseev E.R., Chesnokova O.V., Kucher T.V. A47 Free Pascal and Lazarus: A Programming Textbook / E. R. Alekseev, O. V. Chesnokova, T. V. Kucher M.: ALTLinux; Publishing house DMK-Press, 2010. 440 p.: illustrated.(ALT Linux library). ISBN 978-5-94074-611-9 Free Pascal is a free implementation of the Pascal programming language that is compatible with Borland Pascal and Object Pascal / Delphi, but with additional features. The Free Pascal compiler is a free cross-platform product implemented on Linux and Windows, and other operating systems. This book is a textbook on algorithms and programming, using Free Pascal. The reader will also be introduced to the principles of creating graphical user interface applications with Lazarus. Each topic is accompanied by 25 exercise problems, which will make this textbook useful not only for those studying programming independently, but also for teachers in the education system. The book’s website is: http://books.altlinux.ru/freepascal/ This textbook is intended for teachers and students of junior colleges and universities, and the wider audience of readers who may be interested in programming. UDC 004.432 BBK 22.1 This book is available from: The <<Alt Linux>> company: (495) 662-3883. E-mail: [email protected] Internet store: http://shop.altlinux.ru From the publishers <<Alians-kniga>>: Wholesale purchases: (495) 258-91-94, 258-91-95.
    [Show full text]
  • IV. Программное Обеспечение Для Объектно-Ориентированного Программирования И Разработки Приложений (Kdevelop, Lazarus, Gambas)
    IV. Программное обеспечение для объектно-ориентированного программирования и разработки приложений (Kdevelop, Lazarus, Gambas).............................................................. 2 1. Введение в ООП......................................................................................................................... 2 2. Разработка ПО с использованием Kdevelop.......................................................................... 16 2.1. Основы языка программирования C++.......................................................................... 17 2.2. Работа со средой разработки ПО KDevelop .................................................................. 30 3. Разработка ПО с использованием Lazarus............................................................................. 37 3.1. Основы языка программирования Pascal....................................................................... 38 3.2. Работа со средой разработки ПО Lazarus ...................................................................... 48 4. Разработка ПО с использованием Gambas ............................................................................ 54 4.1. Основы языка программирования BASIC (ОО диалект) ............................................. 55 4.2. Работа со средой разработки ПО Gambas...................................................................... 61 Академия АйТи Установка и администрирование ПСПО. Лекции. Часть 4 Страница 1 из 67 IV. Программное обеспечение для объектно- ориентированного программирования и разработки приложений
    [Show full text]
  • UAH Research Report No. 122 Interim Report Contract No. NAS8-25750
    UAH Research Report No. 122 Interim Report Contract No. NAS8-25750 THE RESPONSES OF THE THERMOSPHERE DUE TO A GEOMAGNETIC STORM - A MHD MODEL by S. T. Wu and Shih-chih Chang Submitted by School of Graduate Studies and Research The University of Alabama in Huntsville Post Office Box 1247 Huntsville/ Alabama December 1972 UAH Research Report No. 122 Interim Report Contract No. NAS8-25750 THE RESPONSES OF THE THERMOSPHERE DUE TO A GEOMAGNETIC STORM - A MHD MODEL by S. T. Wu and Shih-chih Chang Submitted by School of Graduate Studies and Research The University of Alabama in Huntsville Post Off ice Box 1247 Huntsville/ Alabama December 1972 ACKNOWLEDGMENT This work was supported by Marshall Space Flight Center/NASA under Contract NAS8-25750 with the technical coordination of Mr« R. E* Smith, Chief, Space Envi- ronment Branch/Aero-Astronautics Lab. His encouragement and consultation during the course of this study are highly appreciatedo TABLE OF CONTENTS Chapter Page SUMMARY . 1 I. INTRODUCTION 2 II. FORMULATION OF THE PROBLEM 5 II-l Basic Equations II-2 Some Fundamental Solutions II-3 Time Dependent Problem III. NUMERICAL EXAMPLES 15 III-l Statement of the Problem III-2 Results IV. CONCLUDING REMARKS AND RECOMMENDATIONS 18 ii LIST OF FIGURES Figure 1. Perturbations in horizontal component of magnetic field at College, Alaska for May 25-26, 1967. Figure 2. Perturbations in vertical component of magnetic field at College, Alaska for May 25-26, 1967. Figure 3. Electric field at 140 km over College, Alaska on May 25-26, 1967. Figure 4. Horizontal wind velocity at 140 km over College, Alaska on May 25- 26, 1967.
    [Show full text]
  • C++ Application Development with Code::Blocks Ebook, Epub
    C++ APPLICATION DEVELOPMENT WITH CODE::BLOCKS PDF, EPUB, EBOOK Biplab Kumar Modak | 128 pages | 31 Oct 2013 | Packt Publishing Limited | 9781783283415 | English | Birmingham, United Kingdom C++ Application Development with Code::Blocks PDF Book Prosanto on May 23, Creation of multi-platform GUI dialogue boxes. A shortcut will be created on the desktop. Click the Run button the blue triangle to execute your program. Last Updated : 25 Aug, Flag as inappropriate. Visual Studio provides many features that help you to code correctly and more efficiently. Features :. Red colored lines indicate Code::Blocks was unable to detect the presence of a particular compiler. Jump to: navigation , search. Linx is a low code IDE and server. Class browser. It helps you to write, run, and debug code with any browser. This course is divided into clear chunks so you can learn at your own pace. The other application templates in Figure 3 are for developing more advanced types of applications. Supports Static Code Analysis. Installation will now be completed:. You can install it to default installation directory. Management pane : This window shows all open files including source files, project files, and workspace files. Figure 3: Step 1, selecting a project template. All these different phases would need different packages to be installed and was difficult to maintain by a Developer. Also, please look at the C programming test to measure your proficiency in C. Debugger toolbar. This optional setting aids while the program faces some unexpected errors occurring during the execution related to the Linker, compiler, build options, and directories setting. Reviews Review policy and info.
    [Show full text]
  • Notre Dame Scholastic, Vol. 17, No. 17
    §0LS Sisce quasi semper victurus ; vive quasi eras moritTLms. VOL. XVIL NOTRE DAME, INDIANA, JANUARY 5, 1SS4, No. 17. Salutatio AD R. T. E. WALSH, C. S. C. NOSTRA DOMIXJE UXIVERSITATIS PR^BSIDEM IN DIE FESTO PATRONI ILLIUS S. THOM^ APOSTOLI AB ALUMNIS ANNO MDCCCXXXIV GRADCJS ACCEPTURIS OBLATA. NOS LiCEAT THOMA DIGNUM CONSCRIBERE CARMEN. • O prjEclara dies, hyranO sacrata canor o, Semper adauscebis noStr^e sraudia mentis. Lingua tacere potest, bLanda jam luce micat s'oL In CCEIO atque homini vltam dat Christus et orbj. Oum fidei constant miraOula tauta, Deo nunO Est standum, Thoma, nEque fas incredulus essE. Aeterno Verbo cAi'nem internerata MariA Tempore donavit cerTo: perfectus homo fiT. T e r r i f i c a T mundum, aTque InfanDum numen adoranT HoiTescendo Homines Homo, nam luvat esse JehovaH- Omnipotens Oi'itur, mOrbos Dominatur, et unO Mors verbo Moritur: Lazarus Mox corpore vita M Accipit:ex ipsA radiAt vis Morte supei'nA. Discipulis reSonat Domini vox desIJbito; seD Interea Didimus tetlgit Sacra vulnera "VidI! Gratia me domuit!" Qaudens, " Deus " I exclamat et nunG; Nos LiCEAT THOMA DtGNUM CONSCRIBERE CARMEN. Usus inest animum gratUm depromere versIJ: M'ljorem juvenes Malunt persolvei'e laudeM- Orescit amor. Humerus Crescit: Senioribus anno hoO Officium majus, festO redeunte patemO- Num quid enim melius Nobis quam pectora sint? AN. Sexcentos PatriS mereamur amore favoreS? Oonstantes Thomce Ouras mirantur alumni, aO Ridentem faciem et fRontem placidam, ut maris sBquoR. Ingenio eximius, vigil ans, . ac mente sagacj, Blanditias horrens, duBitas, Cunctator, asrendo: aB Extremis iTa te rEmoves, sapiens .que v5 viderE- Regulce Honos, fidus sacRata^ cRucis amatoR Et .
    [Show full text]
  • 1 Porting Delphi Components to Lazarus
    1 Porting Delphi Components to Lazarus Introduction Porting applications to a different development environment is not an easy task. For stan- dard, vanilla applications, this should be a relatively painless operations. But when porting Delphi applications to Lazarus, one sometimes is faced with the task to port used third-party components to Lazarus. For most non-visual components this task should also not be very difficult: the Free Pascal compiler is meanwhile very Delphi compatible. Only when porting to new platforms, the Windows API must be replaced with something cross-platform: This is the main obstacle. However, many existing Delphi visual components are deeply rooted in Windows and are next to impossible to port to Lazarus - unless they are rewritten from the ground up. The Lazarus structure aims to re-implement the VCL as closely as possible, but it is nevertheless sufficiently different to make porting some components a difficult task - but not impossible: simple descendents of standard Delphi components will be easily ported. Compiler issues The Free Pascal compiler is a bit different from Delphi: It knows multiple compiler modes, and one point to be considered when converting components is which compiler mode will be used: • Plain FPC. This does not allow use of classes or threads or many other delphi fea- tures, so it is most likely out of the question • TP compatibility mode has the same drawbacks as the FPC mode, so is equally useless. • OBJFPC mode: This is the object-pascal mode of the compiler: Support for classes, exceptions, threads are switched on. • Delphi mode: The compiler tries to be as Delphi-compatible as possible.
    [Show full text]
  • Новые Возможности Pascalabc.NET 2015
    Язык программирования PascalABC.NET 3.0 2015 год Обзор новых возможностей PascalABC.NET – завоевание популярности • Компактная мощная оболочка. • Мощный современный язык программирования, совместимый со «стандартным Паскалем». • Сайт http://pascalabc.net с огромным количеством примеров. • Около 2000 скачиваний в день. • 29.03.2015 – 1 миллион скачиваний с начала проекта. • Включение PascalABC.NET как основного языка в ряд школьных учебников по информатике. • С 2013 г. – активное использование на олимпиадах по программированию. 2 Этап всероссийской олимпиады по информатике в Москве 2014-15 2013-14 Школьный Окружной Региональный * Школьный Окружной Региональный Всего участников (>0 баллов) 5740 100,00% 1932 100,00% 478 100,00% 5492 100,00% 2061 100,00% 471 100,00% * - учтены все участники PascalABC.Net 2723 47,44% 552 28,57% 59 12,34% 1906 34,71% 765 37,12% 78 16,56% FPC 881 15,35% 433 22,41% 58 12,13% 1907 34,72% 552 26,78% 45 9,55% Дельфи 43 0,75% 30 1,55% 9 1,88% 99 1,80% 26 1,26% 24 5,10% Все паскали 3608 62,86% 944 48,86% 102 21,34% 3783 68,88% 1402 68,03% 129 27,39% g++ 557 9,70% 368 19,05% 222 46,44% 348 6,34% 58 2,81% 158 33,55% gcc 225 3,92% 87 4,50% 22 4,60% 157 2,86% 11 0,53% 20 4,25% clang++ 34 0,59% 20 1,04% 9 1,88% 41 0,75% 306 14,85% 13 2,76% clang 8 0,14% 4 0,21% 4 0,84% 41 0,75% 64 3,11% 3 0,64% Все С/C++ 811 14,13% 462 23,91% 244 51,05% 564 10,27% 371 18,00% 188 39,92% Python-3 580 10,10% 379 19,62% 174 36,40% 339 6,17% 214 10,38% 162 34,39% Python-2 38 0,66% 22 1,14% 8 1,67% 52 0,95% 21 1,02% 13 2,76% Все питоны 611 10,64%
    [Show full text]