Lazarus

Free Pascal => Beginners => Topic started by: juanirias on July 10, 2014, 01:22:57 am

Title: >> HELP <<SOLVED by "engkin" "Astronomy on the PC" O.Montenbruck 2ed 1994
Post by: juanirias on July 10, 2014, 01:22:57 am
Hello! I need some help for running the NUMINT.PAS ( which need a mod on DELIB.PAS ).

link: http://extras.springer.com/1994/978-3-662-05861-9
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 4ed PASCAL
Post by: Bart on July 10, 2014, 01:45:03 am
Are you allowed to distribute the sources (they seem to go with to a book)?
The doc says you are allowed to alter the program to your needs, but it does not mention you are allowed to distribute.

Bart
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 3ed 1994
Post by: engkin on July 10, 2014, 02:04:27 am
The code posted above belongs to the 2nd edition (1994). With a random search I reached the 3rd edition's code on the publisher's website:
http://extras.springer.com/1998/978-3-662-03351-7/
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: juanirias on July 10, 2014, 02:07:52 am
Thanks "engkin" for found this... so is PUBLIC !!  You are a "hero member"
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: engkin on July 10, 2014, 02:53:14 am
Thanks "engkin" for found this... so is PUBLIC !!  You are a "hero member"
Actually my post was a solution to your problem, but that does not mean you have the right to distribute the code. I hope you understand that. I suggest that you delete the code from your post.
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: juanirias on July 10, 2014, 02:57:00 am
Thanks! Actually I’m trying to compile, but have trouble with WinCrt; can you help me?
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: engkin on July 10, 2014, 03:04:17 am
Please delete the code in your first post first.
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: juanirias on July 10, 2014, 03:05:27 am
Done!
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: engkin on July 10, 2014, 04:56:00 am
Thank you.

To be able to compile NUMINT.PAS, I took the following steps:
1 - Chose Turbo Pascal mode by adding {$MODE tp} after program:
2 - Defined DOS.
3 - Introduced type Integer as LongInt

Code: [Select]
...
PROGRAM NUMINT ( INPUT,OUTPUT, NUMINP );
{$MODE tp}  //<---- 1
{$define DOS} // <---- 2
...
  type integer=LongInt; // <---- 3

  CONST J2000  = 0.0;

4 - Replaced included files path from absolute to relative:
Code: [Select]
  (*$I \SomeDir\SomeFile.PAS *)
to
Code: [Select]
  (*$I .\SomeDir\SomeFile.PAS *)  //<---- 4 (notice the dot)
for this one I used Search in Files window to replace "$I \" with "$I .\" and applied it in the directory where I have NUMINT.PAS
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: juanirias on July 10, 2014, 05:14:14 am
I’m under openSUSE 13.1;  I make the additions, but still the error.
Can you try to mod using the advice (my knowledge is limited). In DELIB.PAS say:

(*  Turbo Pascal adaption:                                               *)
(*                                                                       *)
(*  Turbo Pascal uses special data types to pass a function or procedure *)
(*  as formal argument of another function or procedure. For this        *)
(*  purpose the following procedure type is declared and used in the     *)
(*  specification of STEP and DE:                                        *)
(*                                                                       *)
(*      DE_FUNC = PROCEDURE ( X: REAL; VAR Y,YP: DE_EQN_VECTOR );        *)
(*                                                                       *)
(*-----------------------------------------------------------------------*)

and in the DE.PAS says

ROCEDURE DE ( F                  :  DE_FUNC;            (* Turbo Pascal *)

I don’t know how to adapt...

Thanks for help me !!!

Regards, JUAN
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: engkin on July 10, 2014, 12:37:04 pm
I’m under openSUSE 13.1;  I make the additions, but still the error.
I don't use Linux. What error did you get?
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: juanirias on July 10, 2014, 05:00:20 pm
Error: Identifier not found "STEP"
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: engkin on July 10, 2014, 05:26:16 pm
Error: Identifier not found "STEP"
Obviously you did not do step 4:
4 - Replaced included files path from absolute to relative:
Code: [Select]
  (*$I \SomeDir\SomeFile.PAS *)
to
Code: [Select]
  (*$I .\SomeDir\SomeFile.PAS *)  //<---- 4 (notice the dot)
for this one I used Search in Files window to replace "$I \" with "$I .\" and applied it in the directory where I have NUMINT.PAS

Unit DELIB, for instance, has:
Code: [Select]
...
IMPLEMENTATION

  (*$I \DE\EPSMACH.PAS *)
  (*$I \DE\INTRP.PAS   *)
  (*$I \DE\STEP.PAS    *)
  (*$I \DE\DE.PAS      *)

END.

and must be changed to:
Code: [Select]
IMPLEMENTATION

  (*$I .\DE\EPSMACH.PAS *)
  (*$I .\DE\INTRP.PAS   *)
  (*$I .\DE\STEP.PAS    *)
  (*$I .\DE\DE.PAS      *)

END.
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: juanirias on July 10, 2014, 05:42:27 pm
error on DE.PAS:
"          STEP ( X,YY,F,NEQN,H,EPS,WT,START,          "
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: juanirias on July 10, 2014, 05:45:22 pm
picture of DE.PAS
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: engkin on July 10, 2014, 05:47:41 pm
Open DE\STEP.PAS and see what's in it.
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: juanirias on July 10, 2014, 05:49:53 pm
Empty !

Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: engkin on July 10, 2014, 05:51:07 pm
Are you using the code from 2nd edition or 3rd edition?

In 2nd edition STEP.PAS is empty (missing).
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: engkin on July 10, 2014, 05:53:12 pm
Empty !
That's the problem. Either use 3rd edition or try to copy STEP.PAS from 3rd edition to 2nd edition and see if it works.
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: juanirias on July 10, 2014, 05:56:33 pm
Dear Sir, you found one missing!!! In my floppy disk of my book is empty! On the network is not empty!
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: engkin on July 10, 2014, 06:00:01 pm
That explains it!
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: juanirias on July 10, 2014, 06:08:01 pm
Done! Dear Sir I offer for you help a coffee bag ( I will buy at amazon ). Warm greeting from Honduras! You are a gentleman .
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: engkin on July 10, 2014, 06:25:53 pm
Wow, I did not expect that. I would really appreciate it If you instead give its value or any equal alternative to a poor person. Thank you so much.
Title: Re: >> HELP << "Astronomy on the Personal Computer" by Oliver Montenbruck 2ed 1994
Post by: jdlinke on July 10, 2014, 08:17:47 pm
I appreciate the Lazarus/FPC community more every time I'm on these forums. It's so nice (and sadly rare in the online world) to see people offering real assistance and replying with genuine gratitude.

You guys made my day.

Alright. :-[ Back to coding!
TinyPortal © 2005-2018