Lazarus

Programming => General => Topic started by: giahung1997 on May 25, 2019, 04:54:28 pm

Title: Flattening Object Pascal to use within C
Post by: giahung1997 on May 25, 2019, 04:54:28 pm
How to? I know I would use the same procedure as flattening C++ to procedural styles C could understand. But give me an example. Tks.
Title: Re: Flattening Object Pascal to use within C
Post by: jamie on May 25, 2019, 05:30:16 pm
Object pascal  is much more powerful than C in that respect..

You would need lots of overhead functions created to simulate it..
Title: Re: Flattening Object Pascal to use within C
Post by: jamie on May 25, 2019, 05:38:51 pm
To add to that, you would  need a Struct to how all the variables and all functions related to that simulated class would
need a minimum parameter to pass the instance copy of the data to it.

 all references to the struct members would be done via that Reference.

 after do this, you can the use the same functions with many different instances..
etc
Title: Re: Flattening Object Pascal to use within C
Post by: julkas on May 25, 2019, 05:44:06 pm
How to? I know I would use the same procedure as flattening C++ to procedural styles C could understand. But give me an example. Tks.
Can you give more information about your project, environment? What is your goal?
Title: Re: Flattening Object Pascal to use within C
Post by: marcov on May 25, 2019, 06:16:05 pm
Example of what you tried and didn't work? It is hard explaining such complex issues with one line of text to go on.
Title: Re: Flattening Object Pascal to use within C
Post by: giahung1997 on May 26, 2019, 08:17:02 am
Example of what you tried and didn't work? It is hard explaining such complex issues with one line of text to go on.
Oh. I found someone created a simple binding of LCL to plain C on Lazarus CCR and want to help. If it really that hard I should give up  :)
Title: Re: Flattening Object Pascal to use within C
Post by: jamie on May 26, 2019, 04:23:51 pm
Please show what you are trying to convert?
TinyPortal © 2005-2018