Is operator overloading possible in Turbo Pascal ? 
Author Message
 Is operator overloading possible in Turbo Pascal ?

I have tried so much to write a program to carry out mathematical
process with function overloading but I
failed.  I would like to add to vectors A and B and store the result
in vector C as follows:

C:=A+B;

This can be done in C++ but can someone tell me that is it possible to
do operator overloading in Turbo
Pascal or Object Pascal (DELPHI) ?

Regards

Mehrzad Abdollahi    



Wed, 18 Jun 1902 08:00:00 GMT  
 Is operator overloading possible in Turbo Pascal ?

Quote:

>I have tried so much to write a program to carry out mathematical
>process with function overloading but I
>failed.  I would like to add to vectors A and B and store the result
>in vector C as follows:
>C:=A+B;
>This can be done in C++ but can someone tell me that is it possible to
>do operator overloading in Turbo
>Pascal or Object Pascal (DELPHI) ?

Delphi does not support user-defined operator overloading.  But there's
nothing to prevent you from writing the semantically-identical thing:

        C.Assign(A.VectorAdd(B));

Or any variation you like.

Personally, I guess I'm old-fashioned enough to prefer a language in which
operators work either by the string-concat rules or by plain ol' arithmetic,
because that way when something funky's going on the language is noticeably
different and I can see at a glance that the regular rules don't apply.  

Clearly, though, if you're doing a bunch of arithmetic calculations you would
reasonably feel exactly the opposite.

/mr/



Wed, 18 Jun 1902 08:00:00 GMT  
 Is operator overloading possible in Turbo Pascal ?

Quote:

> I have tried so much to write a program to carry out mathematical
> process with function overloading but I
> failed.  I would like to add to vectors A and B and store the result
> in vector C as follows:

> C:=A+B;

> This can be done in C++ but can someone tell me that is it possible to
> do operator overloading in Turbo
> Pascal or Object Pascal (DELPHI) ?

> Regards

> Mehrzad Abdollahi

No.


Wed, 18 Jun 1902 08:00:00 GMT  
 Is operator overloading possible in Turbo Pascal ?

Quote:

>This can be done in C++ but can someone tell me that is it possible to
>do operator overloading in Turbo
>Pascal or Object Pascal (DELPHI) ?

It's not possible in Turbo Pascal 6.0 or lower!




Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. overloading operators in object pascal?

2. HELP needed - OVERLOADING OPERATORS????

3. Error: Operator is not overloaded?

4. Overloaded operators

5. FPC - operator overloading

6. HELP needed - OVERLOADING OPERATORS????

7. operator overloading (for complex math)

8. CGI-scripts with Turbo Pascal 6.0 possible ???

9. Turbo Pascal 7.0 and XMS - possible or not?

10. Function Overload in Gnu Pascal ?

11. HELP Plse: Pascal equivalent of C++ Overloading

12. I am missing TURBO.TPL

 

 
Powered by phpBB® Forum Software