Jump to content
Sign in to follow this  
Guest flightmike1

Borland's Turbo Pascal?

Recommended Posts

Guest A_Delta_Sierra

Greetings,Being from the "older" school, I picked up Turbo Pascal a years ago and was able to do all of my real world data collection/reduction at that time as a field test engineer. Put it away "several" years ago, wasn't needed in the next job, but now I am wondering; I have read that dll/gau files are a "kind of" exe file. So my question has to be ... "beings" I still have that old Borland Turbo Pascal program, it will run under windows 98se, can I compile an "exe" and rename it gau?Probably would be graphics free, but all of the logic for "doing" certain events based upon other events/conditions may be accomplished?Yes, I know, why don't I just try and see. .... On the Road with "Carol Sue" enroute to the Hot Air Balloon festival and we have "layed over" in KC at her sisters home taking care of two cats while sister is on vacation in Estonia. strange but true ... From the Johson County Library in Shawnee Mission KS. traveling westward, best regards.BobS

Share this post


Link to post
Share on other sites

Bob,Strictly speaking, you could probably program gauges using Turbo Pascal. However... (You knew this was coming didn't you :-) )All the libraries that ship with the SDK are coded in C. You would find yourself re-inventing some rather significant wheels if you were determined to use TP as your compiler of choice. I would strongly suggest that you consider brushing up on your C skills, or learn to love XML, if you want to code gauges.BTW, I just purchased a package called EasyGauge. It puts a fairly friendly graphic front end over top of the MinGW C compiler. Great if you want to get started at this without being a C genius.Also - dll's and gau files are not stand alone executables. You would not likely be able to compile a gauge as an 'exe' and rename it.Doug Dawson

Share this post


Link to post
Share on other sites
Guest Paul_S

You should be able to use Turbo Pascal if it can compile 32bit Windows DLLs.Gauges are plain Windows DLLs but with specific exports and imports.I'm not sure if Turbo Pascal 7.0 (last version of TP) can compile 16 or 32 bit apps.If you really want to use Pascal syntax then try get a copy of Delphi 2.0 or higher which will be up to date and capable of creating the gauge DLLs.I'm currently trying to get into gauge programming myself using Delphi but as Doug mentioned it's a pain having to convert C into object pascal (Delphi).However if you know your stuff you shouldn't battle for too long - the gauges.h file is only 5000+ lines of C. :DI'll write a little tutorial when I figure it all out - those C macros are a pain in the ####!I've been battling to figure out what the panel system needs as a bare minimum and how the interfacing exactly works.I will definately strip out all that macro rubbish and go OOP.If only my C skills were a bit better ... ;)RegardsPaul

Share this post


Link to post
Share on other sites
Guest flightmike1

If you get it figured in Delphi please contact me :(

Share this post


Link to post
Share on other sites
Guest Paul_S

>If you get it figured in Delphi please contact me :(It's not a matter of if but rather when. ;)I have already converted a lot of the structures and data types but need to ask a C expert about some specifics.Porting is not as hard as I thought it would be but you have to understand C and Delphi syntax very well.I've noticed several guys wanting a Delphi port - I'll try collect all the names and notify them when I have something working.The "90 day inactive account deletion" thing is a pain because it deletes all the contact info as well and now I can't get some people's e-mail addresses to contact them.Paul

Share this post


Link to post
Share on other sites
Guest flightmike1

I'm hopeless with C++ :( , will be great WHEN you get it all ported over to delphi, I'll sure be having a go at writing some gauges, will hopefully have my first gmax model completed by then waiting for a panel and VC :D.

Share this post


Link to post
Share on other sites
Guest bartels

You're sure? I personally came from PASCAL to C, to C++. And I didn't find it hard to switch. The concepts to program are the same it is just a matter of slightly different wirting between Delphi and C++ (unlike e.g. VB). Apart from that, as often stated in the forum, you need C, and also only a very basic form of C for gauges. Admittedly a gauge in C is mainly a lot of global declaration spilled all over the source instead of a "proper" organization you have usually in Delphi (or C/C++ if it comes to that), and you have to know how in C a function is ended (return value; instead of functionname:=value), but these are actually almost all pitfalls you can find.Arne Bartels

Share this post


Link to post
Share on other sites
Guest Paul_S

Ok I take my words back ...Gauges for MSFS can only be written in C or C++ !This is the first time ever that I have not been able to do something in Delphi that can be done in C/C++.Delphi is unable to export record structures like C and this makes it impossible to port since those exported structures are how the whole interface works. :(The structures I am refering to are the ImportTable and Linkage structures.If MS had used purely a function interface it would have been possible.i.e. If they had used a function to return a pointer to the structures then it could be done in Delphi.Looks like I'm going to have to brush up on my C and C++ skills. ;)Paul

Share this post


Link to post
Share on other sites

Paul,Have you looked at the SDK for FSUIPC? It has a section for Delphi development. If you get FSUIPC working for you, you can achieve a whole lot of cool things by using the IPC interface.Doug

Share this post


Link to post
Share on other sites
Guest Paul_S

Yeah but I am trying to write gauges.They have to be done in C/C++It's not a train smash - it's about time I brushed up on my C/C++ skills anyway. :)Paul

Share this post


Link to post
Share on other sites
Guest flightmike1

:-( Looks like I'll have to have a good go @ C.

Share this post


Link to post
Share on other sites

I'm quite versed in both pascal and Delphi itself.You can indeed export the record structures... specifically the ImportTable and such... so that's not an issue.While I know how to write code in C/C++ it is not my strength and macros seriously kill me.If you're truly interested in getting this to work for Delphi, I think we can.Let me know.Ed Wilson


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...