Recent

Author Topic: Flattening Object Pascal to use within C  (Read 1475 times)

giahung1997

  • Full Member
  • ***
  • Posts: 113
Flattening Object Pascal to use within C
« 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.

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: Flattening Object Pascal to use within C
« Reply #1 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..
The only true wisdom is knowing you know nothing

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: Flattening Object Pascal to use within C
« Reply #2 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
The only true wisdom is knowing you know nothing

julkas

  • Guest
Re: Flattening Object Pascal to use within C
« Reply #3 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?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Flattening Object Pascal to use within C
« Reply #4 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.

giahung1997

  • Full Member
  • ***
  • Posts: 113
Re: Flattening Object Pascal to use within C
« Reply #5 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  :)

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: Flattening Object Pascal to use within C
« Reply #6 on: May 26, 2019, 04:23:51 pm »
Please show what you are trying to convert?
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018