[fpc-pascal] Visual studio code

2023-08-11 Thread Darius Blaszyk via fpc-pascal
Quick question for you all. Has anyone here worked with Visual Studio Code for Free Pascal? I've got the Free Pascal Toolkit plugin up and running, but I'm hitting a bit of a roadblock with setting up GDB debugging. After installing GDB Debugger - Beyond I still cant debug my app upon setting

[fpc-pascal] Parse JSON

2023-06-25 Thread Darius Blaszyk via fpc-pascal
Hi all, I've hardly done anything with JSON in Freepascal before, so apologies for the trivial question. I want to traverse an array in JSON and retrieve the elements (which I don't know what they are in advance) one by one. An example of the JSON file is given below. "keywords": {

Re: [fpc-pascal] Writing Pascal Physics and Vectors

2021-10-16 Thread Darius Blaszyk via fpc-pascal
;) > >> On 10/16/21 2:58 AM, Darius Blaszyk via fpc-pascal wrote: >> Can you put the link up to the source code please? >>>> On 16 Oct 2021, at 00:27, Anthony Walter via fpc-pascal >>>> wrote: >>> [...] >>> https://www.getlazarus.org/videos

Re: [fpc-pascal] Writing Pascal Physics and Vectors

2021-10-16 Thread Darius Blaszyk via fpc-pascal
Hi Anthony, Can you put the link up to the source code please? Rgds, Darius Sent from my iPhone > On 16 Oct 2021, at 00:27, Anthony Walter via fpc-pascal > wrote: > >  > I've been working on writing Pascal bindings a friendly object orient > interface to a few open source projects. I have

[fpc-pascal] Remove last character from pchar

2021-06-10 Thread Darius Blaszyk via fpc-pascal
Hi, I am a bit struggling with what should be fairly simple. I have a pchar where I am adding and removing characters. What I did so far is to allocate new memory every time and copying the source pchar over to a new one to append or delete a character. This required two helper variables in order

Re: [fpc-pascal] Pass type as function parameter

2021-03-24 Thread Darius Blaszyk via fpc-pascal
Thank you so much Michael! On Wed, Mar 24, 2021 at 11:05 AM Michael Van Canneyt wrote: > > > On Wed, 24 Mar 2021, Darius Blaszyk via fpc-pascal wrote: > > > Hi, > > > > Would it be possible in FPC to pass a type of a variable as a parameter > to > > a

[fpc-pascal] Pass type as function parameter

2021-03-24 Thread Darius Blaszyk via fpc-pascal
Hi, Would it be possible in FPC to pass a type of a variable as a parameter to a function? e.g. MyFunction(integer); I have legacy C code that does this via a macro. Hopefully, it can be done so I do not need to change the existing code too badly. TIA Rgds, Darius

Re: [fpc-pascal] Graphing library

2020-11-17 Thread Darius Blaszyk via fpc-pascal
old paper about the GKS system: > http://nsucgcourse.github.io/lectures/Lecture01/Materials/Graphical%20Kernel%20System.pdf > > The translator GOUTHGPL supports only a small subset of GKS; see again the > example picture above. > > If you are interested for more details, you cou

[fpc-pascal] Graphing library

2020-11-15 Thread Darius Blaszyk via fpc-pascal
Hi, I am looking for a simple to use non-visual graphing library to produce x-y plots in a raster file format (similar to how pyplot works). Rather than developing something from scratch or writing a wrapper to GNU plot (additional dependency), I was hoping something like this already would

Re: [fpc-pascal] Archive libraries

2020-08-22 Thread Darius Blaszyk via fpc-pascal
Thank you Michael! On Sat, Aug 22, 2020 at 9:31 AM Michael Van Canneyt wrote: > > > On Sat, 22 Aug 2020, Darius Blaszyk via fpc-pascal wrote: > > > On Thu, Aug 20, 2020 at 11:43 PM Darius Blaszyk > > wrote: > > > >> > >> I have done so

Re: [fpc-pascal] Archive libraries

2020-08-22 Thread Darius Blaszyk via fpc-pascal
On Thu, Aug 20, 2020 at 11:43 PM Darius Blaszyk wrote: > > I have done so for the xz format already. The code checks first if the > utility is available and then invokes it. Potentially any other utility > might be included that way. However, I was hoping to include mainly native

Re: [fpc-pascal] Archive libraries

2020-08-22 Thread Darius Blaszyk via fpc-pascal
Thank you Marco! I will have a look at it. Darius On Fri, Aug 21, 2020 at 11:04 AM Marco Borsari via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Il 20/08/2020 17:10, Darius Blaszyk via fpc-pascal ha scritto: > > > To my delight I found out that FPC actually pr

Re: [fpc-pascal] Archive libraries

2020-08-20 Thread Darius Blaszyk via fpc-pascal
On Thu, Aug 20, 2020 at 5:58 PM Tomas Hajny via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > bzip2 is directly supported in FPC packages as well. > I had a second look at the bzip2 unit. Unless I am missing something this unfortunately looks to be a decompression only implementation!

Re: [fpc-pascal] Archive libraries

2020-08-20 Thread Darius Blaszyk via fpc-pascal
> As a last resort, one might invoke the required archiver > executable, passing to it any necessary parameters. Far > Manager's MultiArc universal plugin works exactly that way, > and is easily configurable via invocation patterns with > macros. > I have done so for the xz format already. The

Re: [fpc-pascal] Archive libraries

2020-08-20 Thread Darius Blaszyk via fpc-pascal
< fpc-pascal@lists.freepascal.org> wrote: > On 2020-08-20 17:10, Darius Blaszyk via fpc-pascal wrote: > > > Hi, > > > To my delight I found out that FPC actually provides quite a few > > archive > > handling libraries out of the box. Thanks to all that hav

[fpc-pascal] Archive libraries

2020-08-20 Thread Darius Blaszyk via fpc-pascal
Hi all, To my delight I found out that FPC actually provides quite a few archive handling libraries out of the box. Thanks to all that have contributed to that! So far I found: * tar * tar.gz * zip Are there any other formats out there that I could use like out of the box? TIA! Darius

Re: [fpc-pascal] FPC buildbot

2020-08-19 Thread Darius Blaszyk via fpc-pascal
form across platforms. I'm happy to finally have a buildbot tool with "zero" configuration that provides me daily snapshots over different platforms. Rgds, Darius On Tue, Aug 4, 2020 at 1:58 PM Joost van der Sluis wrote: > > Op 20-07-2020 om 11:31 schreef Darius Blaszyk via fp

Re: [fpc-pascal] FPC buildbot

2020-07-20 Thread Darius Blaszyk via fpc-pascal
eef Darius Blaszyk via fpc-pascal: > > > I was looking for the sources of a buildbot suitable for an FPC project. > I would like to keep it as simple as possible, so no webserver hassle for > instance. Just simply repo sync, build, run test suite and upload to ftp. I > kn

[fpc-pascal] FPC buildbot

2020-07-16 Thread Darius Blaszyk via fpc-pascal
Hi all, I was looking for the sources of a buildbot suitable for an FPC project. I would like to keep it as simple as possible, so no webserver hassle for instance. Just simply repo sync, build, run test suite and upload to ftp. I know buildbot.net but I was hoping on finding something

[fpc-pascal] Database migration

2020-06-19 Thread Darius Blaszyk via fpc-pascal
Hi all, After spending the last 12 months working intensively on a PHP based project, I moved back to FPC once again for another project. One of the more interesting concepts working in PHP was migrations. These are simple scripts that define the columns in a database table including indexes and

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread Darius Blaszyk
> This might sound silly, but is it possible to somehow specify a variable > with a string containing the name of the variable? Yes it certainly is. I wrote a unit that can handle arbitrary variable types for my project pmake. Pmake it a build tool for pascal.

Re: [fpc-pascal] Developing a mini ERP / web based development

2019-06-27 Thread Darius Blaszyk
> > You can use fpWeb, which came with FPC. > Great, is there any database master/detail example that I could use to learn? I have no idea yet how to program the visuals for such an application. Any tips would be greatly appreciated! > I've wrote two simple articles about it, however written in

Re: [fpc-pascal] Developing a mini ERP / web based development

2019-06-27 Thread Darius Blaszyk
Thank you for the suggestions and tips. > I can't inform you about fano. > I sent out a mail to the developer. Let's see what comes back. I think he is also on this list. The demo fano-app did only crash here, see below: Exception class : *ERouteHandlerNotFound* Message : *Route not found.

[fpc-pascal] Developing a mini ERP / web based development

2019-06-27 Thread Darius Blaszyk
Hi all, I have been asked to write a limited functionality / mini ERP type of software for an NGO that is setting up a hospital. I'm doing this in my own time and free of charge. The compiler and IDE of choice are of course FreePascal & Lazarus. I’m still thinking about the direction to go

Re: [fpc-pascal] CopyFile for FreePascal without Lazarus?

2019-04-20 Thread Darius Blaszyk
Here’s another implementation using blockread and blockwrite. The main thing missing is setting the file attributes on *nix systems. Rgds Darius https://github.com/daar/pmake/blob/master/pmake/pmake_utilities.pas Verstuurd vanaf mijn iPhone > Op 20 apr. 2019 om 11:23 heeft Joost van der

Re: [fpc-pascal] Fatal: Can't find unit GL used by GLPT

2019-04-05 Thread Darius Blaszyk
/bin/i386-win32/"; For a simple hello world app it works perfectly. For GLPT, FPC cannot find the GL unit. Is this an fpc.cfg issue? How to solve this problem? The project including Travis CI script is located here: https://github.com/daar/GLPT TIA! Darius On Fri, Apr 5, 2019 at 9:59 AM D

[fpc-pascal] Fatal: Can't find unit GL used by GLPT

2019-04-05 Thread Darius Blaszyk
___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Unzip streams

2019-03-14 Thread Darius Blaszyk
Hi, I would like to unzip a file that contains folders and files from a stream. Can this be done with TUnzipper? Anyone has an example? Rgds, Darius <#m_6214636624668668523_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> ___ fpc-pascal maillist -

Re: [fpc-pascal] how to make a type private to the unit but not defining it in the implementation section?

2019-03-07 Thread Darius Blaszyk
Make stringgrid1 a pointer and put TMyStringGrid in the implementation section? Op do 7 mrt. 2019 om 09:11 schreef Dennis > unit frproxyserver; > > {$mode objfpc}{$H+} > > interface > > uses >Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Grids, >frBase; > > type > >

Re: [fpc-pascal] PMake a new build tool

2019-02-28 Thread Darius Blaszyk
Hi Silvio, I've looked for something like this to automate the build of some projects > I'm maintaining, so I have some questions: > > Could it build a Delphi-based project too? If so, does it allows to select > the build for a specific platform/config? (e.g: Win32/Release) > By executing 'pmake

[fpc-pascal] PMake a new build tool

2019-02-26 Thread Darius Blaszyk
Hi, I would like to inform everyone interested here that I just made a beta release (v0.0.2) of a build tool I have been developing for some of my projects which is called PMake. PMake is inspired on FPMake and CMake, but much easier in its use (as far as I am concerned). It compiles build

[fpc-pascal] Travis CI, install FPC on Windows

2019-02-25 Thread Darius Blaszyk
Hi, I created a repo on GitHub to test build FPC projects using Travis CI. So far, Linux and macOS work perfectly! Now I’m working on getting native windows testing setup in the script. For this I need a headless install of FPC and be able to invoke the compiler from command line. Does anyone

Re: [fpc-pascal] GLPT v0.1.1 released

2018-10-10 Thread Darius Blaszyk
t; On Oct 11, 2018, at 4:41 AM, Darius Blaszyk > wrote: > > > > I committed today the generic code for setting up a specific GL version > and additional parameters. What remains now is implementing the platforms. > Anyone interested in helping out is welcome! I will star

Re: [fpc-pascal] GLPT v0.1.1 released

2018-10-10 Thread Darius Blaszyk
with help from the community as well as a proper test to ensure the uniform working over all platforms. On Wed, Oct 10, 2018 at 2:07 PM Darius Blaszyk wrote: > > > Op wo 10 okt. 2018 13:41 schreef Anthony Walter : > >> A fallback should not be created if the initialization or re

Re: [fpc-pascal] GLPT v0.1.1 released

2018-10-10 Thread Darius Blaszyk
Op wo 10 okt. 2018 13:41 schreef Anthony Walter : > A fallback should not be created if the initialization or requested > context type could not be created. It should just fail with a reason, then > allow the programmer to decide what or even if there should be a fallback. >

Re: [fpc-pascal] GLPT v0.1.1 released

2018-10-10 Thread Darius Blaszyk
That a good idea Ryan. The only thing is that we should think about providing some sort of a fallback when the record is not setup entirely or incompatible settings are used. Op wo 10 okt. 2018 10:44 schreef Ryan Joseph : > > > > On Oct 10, 2018, at 2:35 PM, dhkblaszyk wrote: > > > > I created

Re: [fpc-pascal] GLPT v0.1.1 released

2018-10-09 Thread Darius Blaszyk
Setting the OpenGl version is on top of my list. I 'm no expert but I will make the changes accordingly, counting on feedback from you all. Rgds, Darius On Wed, Oct 10, 2018 at 6:08 AM Ryan Joseph wrote: > > > > On Oct 9, 2018, at 12:19 PM, Ingemar Ragnemalm > wrote: > > > > All your demos

Re: [fpc-pascal] GLPT v0.1.1 released

2018-10-08 Thread Darius Blaszyk
On Tue, Oct 9, 2018 at 7:26 AM Ingemar Ragnemalm wrote: > Yet another API for GUI-OpenGL glue? I would suggest that the closer to > an existing API (i.e. GLUT) the better. You are fairly close now so > maybe making it a GLUT replacement is just a matter of renaming? > True, GLPT is close to

[fpc-pascal] GLPT v0.1.1 released

2018-10-08 Thread Darius Blaszyk
Hi all, I just released the first complete version of GLPT. Thanks to Ryan Joseph GLPT now supports Linux, MacOSX and Windows. Anyone interested in the project is invited to test, use, discuss and code. Please submit found or proposed issues on GitHub. https://github.com/daar/GLPT/releases

Re: [fpc-pascal] Announcement GLPT

2018-09-26 Thread Darius Blaszyk
> > > > There is a unit called uglyfont.pas included in Lazarus. I ported it > I Dennis, I ported the Lazarus imgui example to GLPT today and committed it to GitHub. You will also find the font library in the examples folder. Rgds, Darius ___

Re: [fpc-pascal] Announcement GLPT

2018-09-25 Thread Darius Blaszyk
On Tue, Sep 25, 2018 at 5:21 PM Dennis wrote: > I tried it but found that drawing text in OpenGL seems to be problematic. > Is there anyway to draw text using windows' existing font? Or is there a > library for nicer vector based font? > There is a unit called uglyfont.pas included in Lazarus.

Re: [fpc-pascal] Announcement GLPT

2018-09-25 Thread Darius Blaszyk
On Tue, Sep 25, 2018 at 11:52 AM R0b0t1 wrote: > Are multiplexing synchronization primitives available? E.g. select(2) > but for keyboard/mouse/window events. > Multithreading is not available, however I'm open for suggestions and pull requests. > This seems to be the obvious usecase. Can

Re: [fpc-pascal] Announcement GLPT

2018-09-24 Thread Darius Blaszyk
Indeed, it resembles GLFW more, but also GHOST and fpGui to some extent. Even better, GLPT is still in development and it's 100% pascal. As far as I'm concerned it still malleable and should result in a mature alternative to any other library. On Tue, Sep 25, 2018 at 5:27 AM leledumbo via

Re: [fpc-pascal] Announcement GLPT

2018-09-24 Thread Darius Blaszyk
Hi Anthony, Thanks for your tip! I just committed some code that removes the Classes, SysUtils and GL units from GLPT. This is indeed better and cleaner. As for your questions about supporting different GL versions. GLPT only creates a native GL context and hides some of the platform specific

Re: [fpc-pascal] Announcement GLPT

2018-09-23 Thread Darius Blaszyk
> Sounds awesome. Thanks for sharing the code. I'll definitely be taking a > look at. You will notice in that case that some inspiration came from fpGui as well :). Cheers... Darius ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

[fpc-pascal] Announcement GLPT

2018-09-23 Thread Darius Blaszyk
Hi all, I committed GLPT or the OpenGL Pascal Toolkit just now on GitHub. This toolkit is a (free) pascal replacement for GLUT and other similar toolkits that depend on third party dynamic libraries. I have been using this library in a couple of projects and decided to publish under the MIT

Re: [fpc-pascal] Format specifier in FPC?

2018-06-27 Thread Darius Blaszyk
Thanks Michael! I made a custom function that adds the + in case of a positive value. Rgds ,Darius On Wed, Jun 27, 2018 at 9:02 AM Michael Van Canneyt wrote: > > > On Wed, 27 Jun 2018, Darius Blaszyk wrote: > > > Hi, > > > > I have the following format speci

[fpc-pascal] Format specifier in FPC?

2018-06-26 Thread Darius Blaszyk
Hi, I have the following format specifier in C : %+.05f. What would be the FPC equivalent? A float is printed like this: -0.70711 The specified '+' will explicitly print out the sign for the float independent if it is a positive or negative. Rgds, Darius

Re: [fpc-pascal] Realtime and freepascal???

2018-06-15 Thread Darius Blaszyk
Hi all, Thanks for all the feedback I got. I am looking into different solutions and admittedly I'm at a loss. For the data acquisition part I indeed will not be using an MPU. Instead I found some good references to using arduino in a master / slave setup. The master will poll all slaves over I2C

[fpc-pascal] Realtime and freepascal???

2018-05-30 Thread Darius Blaszyk
Hi, For a hard real-time project I am considering using freepascal. As this is my first endeavour in real-time I would like to ask the community on their experiences. Is FPC suitable for this kind of applications? If so what commercially available boards are out there? I believe a beagle bone for

[fpc-pascal] FPC linter tool

2018-03-04 Thread Darius Blaszyk
Hi all, I am looking for an open source linter tool to use on FPC projects. A quick google search didn't yield anything specific. Hoping someone here can help me further. TIA Darius Verstuurd vanaf mijn iPhone ___ fpc-pascal maillist -

[fpc-pascal] GetLocaleInfo returns ZZZ

2018-02-21 Thread Darius Blaszyk
On my machine getlocaleinfo returns ZZZ when requesting the abbrev langname. The country code is correctly set to NL. This makes gettext.GetLanguageIDs return zz_NL. What could be causing this? Also the behavior of GetLocaleInfoIDs does not seem to be according to the gettext manual. On

[fpc-pascal] GetLocaleInfo returns ZZZ

2018-02-21 Thread Darius Blaszyk
On my machine getlocaleinfo returns ZZZ when requesting the abbrev langname. The country code is correctly set to NL. This makes gettext.GetLanguageIDs return zz_NL. What could be causing this? Also the behavior of GetLocaleInfoIDs does not seem to be according to the gettext manual. On

Re: [fpc-pascal] Python interaction... how?

2018-02-17 Thread Darius Blaszyk
Thanks for the tips and hints! I found this page also explaining well on how to embed python bi-directionally in FPC. https://docs.python.org/3.4/extending/embedding.html The P4D code was very helpful as well. I stripped all the object and component code and now have a working FPC only python

[fpc-pascal] Python interaction... how?

2018-02-15 Thread Darius Blaszyk
Hi all, I just cannot wrap my head around this one. I would like to implement scripting support to a pure FPC application. The application implements some modifier on an internal data structure which will be exposed to python as a module. The data structure itself is managed by the calling

[fpc-pascal] Initialize records C style

2018-01-30 Thread Darius Blaszyk
I have this code in C, the variable p is a 20 element array. However only the first two items are initialized. Is this possible in pascal as well? TIA, Darius struct point { intx; inty; }; struct point p[20]= { {0, 100}, {3,1} };

Re: [fpc-pascal] Strange issue with TXMLConfig

2018-01-18 Thread Darius Blaszyk
Hi, I can only say that TDOMNode from Laz2_DOM in trunk has function CompareName. I'm using FPC 3.0.4 indeed. No dependency to the LCL. Darius ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] FPC 3.0.4 on Ubuntu Trusty

2018-01-18 Thread Darius Blaszyk
We sometimes have .deb downloads on the website, but not always. You're better off taking the .tar.gz. It should work on any linux system. Thanks Michael! However, as I understand installing from a .tar cannot be fully automatically done. Some interaction is still needed. This makes it

[fpc-pascal] Strange issue with TXMLConfig

2018-01-17 Thread Darius Blaszyk
All of a sudden I get a crash in my app trying to read a path from an XML file. The crash comes from the function TDOMNamedNodeMap.Find that crashes on this line: C := TDOMNode(FList.List^[I]).CompareName(name); The strange thing is that a simplified example app does not crash! In any case I'm

Re: [fpc-pascal] FPC 3.0.4 on Ubuntu Trusty

2018-01-17 Thread Darius Blaszyk
> About the best way to install it, I highly recommend to compile it from > sources, it is the best way without any doubt. Thanks Victor! However, compiling from sources is not very practical for me. I need to install the latest FPC for a Travis-CI build. So therefore I need a binary

[fpc-pascal] FPC 3.0.4 on Ubuntu Trusty

2018-01-17 Thread Darius Blaszyk
As I don't have Trusty installed I thought I would ask here instead. What is the most convenient way to install FPC 3.0.4 on Ubuntu Trusty? Is it as simple as downloading and installing the deb/rpm package from the website or is there a ppa somewhere for me to use? Does FPC 3.0.4 work on Trusty?

Re: [fpc-pascal] AppImage

2018-01-15 Thread Darius Blaszyk
> Take a look at > > https://appimage.org/ > > Is this possible for Freepascal and Lazarus? Though I'm not able to help you, it seems to be similar to https://www.docker.com/. Though docker apps can run on other platforms like windows and mac as well. Rgds,

Re: [fpc-pascal] Freepascal CLI library

2018-01-13 Thread Darius Blaszyk
> not specific to CLI apps but are you, perhaps, thinking of CheckOptions and > HasOption? No I do not look for commandline handling. Rather a CLI interaction library. Which allows to interact with the application during runtime. Similar to how sphinx-quickstart works for instance. Rgds

[fpc-pascal] Freepascal CLI library

2018-01-13 Thread Darius Blaszyk
I'm working on a CLI application that allows the user to do some configuration. During the process the user is presented with different questions that need to be answered, before the configuration is written to file. For convenience, the user is presented with default options as well. Something

Re: [fpc-pascal] Comp type

2018-01-09 Thread Darius Blaszyk
Comp is Int64 div 1. Thanks for the explanation Mathias! ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Problems with writing to console

2018-01-09 Thread Darius Blaszyk
Hi, I have been mixing "writeln(StdOut" and regular writeln in my application (actually a couple of applications working together) and found that the output on the console is mangled when I do that. Output is being overwritten and placed semi randomly on the console. What is the standard output

[fpc-pascal] Comp type

2018-01-09 Thread Darius Blaszyk
By accident I noticed the comp type for the first time. It's an Int64 but is considered to be a real type. Just out of curiosity, what is the use case of such a type, or is this just implemented for compatibility reasons? Rgds, Darius___ fpc-pascal

Re: [fpc-pascal] Translate C code

2018-01-06 Thread Darius Blaszyk
Well, not sure why one needs to do this abomination, without knowing the data structure it operates on, but nevertheless, you can do the same in Free Pascal, but you better turn the macro into a function: Thanks Charlie! ___ fpc-pascal maillist -

[fpc-pascal] Translate C code

2018-01-05 Thread Darius Blaszyk
Hi all, Again I would like to ask some support on a piece C code that I need to translate to pascal. The code in question is: #define MEMNEXT(x) ((MyStruct *)(((char *) x) - ((char *) & (((MyStruct *)0)->next What exactly is going on here? Where does the result point to? It seems like it

[fpc-pascal] Problem with array of const

2017-10-28 Thread Darius Blaszyk
Consider the application below. When I run it I do get the following output: name rgname�F&{---C000-0046} In other words I lose the first character (a) from the arguments supplied and the string returns with a lot of garbage. What am I doing wrong here? Rgds,

Re: [fpc-pascal] Overloaded functions

2017-10-28 Thread Darius Blaszyk
ent > parameter (or param. list). You can have different return type for each > parameter but you can never have the same parameters. > > V. > > ______ >> Od: Darius Blaszyk <dhkblas...@zeelandnet.nl> >>

[fpc-pascal] Overloaded functions

2017-10-28 Thread Darius Blaszyk
Hi, I have a problem with overloaded functions. I defined these functions: function val_(name: string): string; function val_(name: string): boolean; function val_(name: string): integer; function val_(name: string): double; var res: boolean; begin res := val_(option_variable); end; I get

[fpc-pascal] Initializing constant (translate from C)

2017-10-16 Thread Darius Blaszyk
Here's an interesting one. In C I have this code: #define ID1 MAKE_ID('A', 'B') Where MAKE_ID is a macro that depending on the endianness of the target will create either AB or BA. How would I be able to translate this into Pascal? ID1 preferably would need to remain a constant. I tried using

[fpc-pascal] New tool sspell for pascal programmers

2017-07-23 Thread Darius Blaszyk
Hi all, I've just finished working on a tool called sspell (stands for source code spell checker) for a project of mine. This tool extracts text from comments and string literals in source code files and checks them for spelling. Very useful in my case when you have a lot of resourcestrings,

[fpc-pascal] pyacc and using hexadecimals in the code

2017-02-21 Thread Darius Blaszyk
Hi all, I would like to use hexadecimal values in a pyacc script. However, when doing so pyacc thinks I am using a rule assign (or whatever the correct term is) eg $$ := $1 as opposed to writeln(yyoutput, $76);. Is this a shortcoming of pyacc, or do I need to escape the dollar sign in a specific

[fpc-pascal] How to translate C macro

2017-01-02 Thread Darius Blaszyk
Hi all, Could someone suggest how to translate the following code to pascal? #define prev(X) ( *( (void **) ( ((void *) (X)) - 32 ) ) ) . prev(ptr) = prev(last); I tried converting the macro to an inline function but I get the error message: Error: Argument cannot be assigned to. The

[fpc-pascal] TP lex change input buffer

2016-04-13 Thread Darius Blaszyk
Hi, I'm using TP lex in my application and I would like to change the input buffer from using files to (memory) strings. What is the supposed way to do this? Currently I have made a local copy of lexlib and modified the get_char (and friends) routine. However this does not seem to be the ideal

Re: [fpc-pascal] How do fpmake dependencies work??

2014-04-06 Thread Darius Blaszyk
. BTW: Lots of OSS nowadays use online review tools in combination with their bugtrackers. Would such a tool help the core developers in their work to review and resolve patches? One interesting tool is http://phabricator.org/ [2] Regards, Darius Darius Blaszyk schreef op 6 apr '14: Hi all

Re: [fpc-pascal] How do fpmake dependencies work??

2014-04-06 Thread Darius Blaszyk
://free-pascal-general.1045716.n5.nabble.com/fpmake-dependecies-td5718762.html [2] Regards, Darius Michael Van Canneyt schreef op 6 apr '14: On Sun, 6 Apr 2014, Darius Blaszyk wrote: I've implemented the basic workings of package dependency in fpmkunit. Please find attached a patch against

Re: [fpc-pascal] How do fpmake dependencies work??

2014-04-06 Thread Darius Blaszyk
The path for the FPC executable seems to be wrong. I'm on a 64bit machine. I will have a look to see where fppkg is getting the path from. Could you talk me trough the procedure of fppkg Michael in general as well? Regards, Darius Darius Blaszyk schreef op 6 apr '14: It's very

Re: [fpc-pascal] How do fpmake dependencies work??

2014-04-06 Thread Darius Blaszyk
in design. Darius Michael Van Canneyt schreef op 6 apr '14: On Sun, 6 Apr 2014, Darius Blaszyk wrote: The path for the FPC executable seems to be wrong. I'm on a 64bit machine. I will have a look to see where fppkg is getting the path from. Did you read: http://wiki.freepascal.org/fppkg

[fpc-pascal] fpmake dependecies

2014-03-26 Thread Darius Blaszyk
Hi, I'm playing again with fpmake and I struck an issue with it. Probably due to a wrong setup of my packages, but I cannot find a way to resolve it. I keep on getting the following error: Warning: Target XXX of package YYY depends on another package (ZZZ). These kind of dependencies are not

Re: [fpc-pascal] fpmake dependecies

2014-03-26 Thread Darius Blaszyk
$00010001A263 $00010001B5A7 $00010001A561 $00010001D030 $00010002C37E The FPC Package tool encountered the following error: [currentdir] Execution of FPMake manifest failed Regards, Darius Darius Blaszyk schreef op 26 mrt '14: Hi, I'm playing again with fpmake and I struck

Re: [fpc-pascal] fpmake dependecies

2014-03-26 Thread Darius Blaszyk
Hi Michael, I have never used fppkg this way. Can you explain how I should use it? Regards, Darius On Mar 26, 2014, at 6:09 PM, Michael Van Canneyt wrote: On Wed, 26 Mar 2014, Darius Blaszyk wrote: Hi, I'm playing again with fpmake and I struck an issue with it. Probably due

[fpc-pascal] struct definition in C

2014-03-23 Thread Darius Blaszyk
regards, Darius Blaszyk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] struct definition in C

2014-03-23 Thread Darius Blaszyk
: On 23/03/14 19:39, Darius Blaszyk wrote: What would be the equivalent of the following struct definition in C? typedef struct MyStruct { unsigned a :6; unsigned b :15; unsigned c:11; }MyStruct; I imagine this is some sort of struct initialization. Is thi spossible in FPC as well, or what

Re: [fpc-pascal] Linking object file

2014-03-20 Thread Darius Blaszyk
Thanks Tomas, I did a quick test and it works perfectly! Regards, Darius Tomas Hajny schreef op 20 mrt '14: On Wed, March 19, 2014 23:49, Darius Blaszyk wrote: Hi, I was wondering if it's possible to link FPC object files by using the $Link directive? At least I have troubles

Re: [fpc-pascal] Linking object file

2014-03-19 Thread Darius Blaszyk
to make an adjustment to produce 64 bit binary. It is just easier to stay with 32 bit if you can. Let us know how it turns out in 64 bit {$LINKLIB } Cheers, md On 3/19/2014 6:49 PM, Darius Blaszyk wrote: Hi, I was wondering if it's possible to link FPC object files by using

[fpc-pascal] Linking C library

2014-01-15 Thread Darius Blaszyk
Hi, I'm trying to link a C library to my pascal app. From the messages I understand that I forgot to link in some additional library. However I cannot find which one that is. In my app I have included: {$IFDEF MSWINDOWS} {$linklib libmsvcrt} {$ELSE} {$linklib c} {$ENDIF} Is there a way

[fpc-pascal] Strange error message

2013-05-08 Thread Darius Blaszyk
I'm working on a glut app but I keep on getting the message: Error: Can't assign local procedure/function to procedure variable The error is at this line: glutDisplayFunc(@redrawfunc); And the callback (which is declared in the same .inc file) is declared as: procedure redrawfunc; cdecl; I

Re: [fpc-pascal] Strange error message

2013-05-08 Thread Darius Blaszyk
Am 08.05.2013 11:20, schrieb Darius Blaszyk: I'm working on a glut app but I keep on getting the message: Error: Can't assign local procedure/function to procedure variable The error is at this line: glutDisplayFunc(@redrawfunc); And the callback (which is declared in the same .inc

Re: [fpc-pascal] Strange error message

2013-05-08 Thread Darius Blaszyk
Am 08.05.2013 11:40, schrieb Darius Blaszyk: Am 08.05.2013 11:20, schrieb Darius Blaszyk: I'm working on a glut app but I keep on getting the message: Error: Can't assign local procedure/function to procedure variable The error is at this line: glutDisplayFunc(@redrawfunc

[fpc-pascal] Porting C variable declaration

2013-05-04 Thread Darius Blaszyk
Hi, I came across a pointer variable in C which also get's assigned integer values. Anyone has an idea how to port this in FPC? The variable is declared as: static void *x=0; Later on it get's assigned as this: x= 1; Regards, Darius ___

Re: [fpc-pascal] Porting C variable declaration

2013-05-04 Thread Darius Blaszyk
Thanks Jonas! Jonas Maebe schreef op 4 mei '13: On 04 May 2013, at 10:25, Darius Blaszyk wrote: I came across a pointer variable in C which also get's assigned integer values. Anyone has an idea how to port this in FPC? The variable is declared as: static void *x=0; Later on it get's

Re: [fpc-pascal] Statically link library

2013-04-26 Thread Darius Blaszyk
On Apr 26, 2013, at 1:37 AM, Paul Breneman wrote: Yes it does find them, the statically libraries are linked into an executable which works fine. That is why I was surprised. I'm sure MinGW must link to other libraries as well. The question though is which. Anyway to find out for a

Re: [fpc-pascal] Statically link library

2013-04-25 Thread Darius Blaszyk
On Apr 24, 2013, at 10:00 AM, Ludo Brands wrote: On 04/23/2013 10:14 PM, Darius Blaszyk wrote: Thanks Ludo! Works perfectly also here. However for my understanding. Why does MinGW find open, filesize etc? Is there some header file that translates these functions to be compatible

Re: [fpc-pascal] Statically link library

2013-04-23 Thread Darius Blaszyk
On Apr 21, 2013, at 6:35 PM, Ludo Brands wrote: A few things wrong in your files: - the c program. When you want to link against msvcrt then you better use the ms functions;) There is no filesize, or open, or close (the latter are deprecated since a while and not present anymore in msvcrt)

[fpc-pascal] Statically link library

2013-04-20 Thread Darius Blaszyk
Hi, I'm linking a C and FPC program but I keep on getting undifined symbols (see example below). Error: Undefined symbol: _strcpy Sofar I have added: {$linklib msvcrt} {$linklib gcc} What other libraries should I add? BTW, I'm compiling the C library with MinGW. Regards, Darius

Re: [fpc-pascal] Porting C macro

2013-03-12 Thread Darius Blaszyk
Flávio Etrusco schreef op 12 mrt '13: On 3/11/13, Darius Blaszyk dhkblas...@zeelandnet.nl wrote: I'm stuck porting a macro from C. Below is the original define. The part I'm struggeling with is the right most part after the - sign. #define GETNEXT(x) ((LList *)(((char *) x) - ((char

[fpc-pascal] Porting C macro

2013-03-11 Thread Darius Blaszyk
I'm stuck porting a macro from C. Below is the original define. The part I'm struggeling with is the right most part after the - sign. #define GETNEXT(x) ((LList *)(((char *) x) - ((char *) (((LList *)0)^.next Does anyone know what is meant with the define? Obviously LList is a linked

  1   2   >