Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Double varial in Compaq Pascal

Status
Not open for further replies.

1234shu

Programmer
Feb 13, 2003
11
US
I'm working with Compaq Pascal. The problem I'm having is when assigning a value to a variable of Double type (e.g. d := 12345678.9876543, I have place D0 at the end to make it double precision (d := 12345678.9876543D0). Otherwsie it will be treated as single precision. What I want to achieve is to find a way to make the value treated as double precision without adding the D0). Any help will be highly appreciated.

Shu
 
This seems compiler-specific stuff, check your documentation for compiler switches and options or switch to a decent compiler: Borland Pascal (but anything without a "Compaq" prefix will do I suppose ;-)).

Regards,
Bert Vingerhoets
vingerhoetsbert@hotmail.com
Don't worry what people think about you. They're too busy wondering what you think about them.
 
Thank you very much Bert.

To find an option at compile time is the solution that I'm trying to get. But so far no success. Any further help will be highly appreciated.

Best regards,

Bill
 
There is no further help I can offer. You just don't like the syntax conventions that your compiler uses; that would be the same a me complaining that string constants are contained within single quotes in stead of double quotes.
The only possible solution is to check if there is some kind of option to change. In Borland Pascal there is no option to choose between single or double quotes, so I have to live with that.

Besides, if you worry about syntax, you shouldn't start programming. Every language has its own peculiar syntax for doing things, get over it! It's the way how you use this syntax to create fast, reliable and foolproof applications that counts.

Regards,
Bert Vingerhoets
vingerhoetsbert@hotmail.com
Don't worry what people think about you. They're too busy wondering what you think about them.
 
Thanks Bert.

The thing is not that I don't like the syntax. We're trying to convert Oregon pascal programs with double precision values to Compaq pascal. It would be very difficult to go over all the programs and add D0 to every decimal value in the programs.

Best regards,

Bill
 
Make a program to that! I've made lots of those little tools to do a quick runover a file changing little things.

Regards,
Bert Vingerhoets
vingerhoetsbert@hotmail.com
Don't worry what people think about you. They're too busy wondering what you think about them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top