Hey guys, is there any way for me to convert c++ code to delphi? I've found what I was looking for, but it's in c++ and I have also found a perl script that is supposed to do the trick (BCB2Delphi.pl from http://copycat.fr/wordpress/porting-old-cbuilder-software-to-new-versions/) which I am unable to execute, for whatever reason. I'd really appreciate the help.

Hey guys, is there any way for me to convert c++ code to delphi? I've found what I was looking for, but it's in c++ and I have also found a perl script that is supposed to do the trick (BCB2Delphi.pl from http://copycat.fr/wordpress/porting-old-cbuilder-software-to-new-versions/) which I am unable to execute, for whatever reason. I'd really appreciate the help.
http://copycat.fr/wordpress/porting-old-cbuilder-software-to-new-versions

Comments

  1. https://msdn.microsoft.com/en-us/library/c36yw7x9.aspx

    In short, it's a non-type-checked cast (or a cast that's barely checked at all.) Dynamic_cast is the equivalent of (Foo as TBar) whereas static_cast is the equivalent of TBar(Foo).

    Are you casting objects, or primitive types too? It gets a bit more complex there.

    ReplyDelete
  2. The guy whose code I'm translating is static casting a TJSONObject into another object, but I can't find any logical reason for him to do so, since he's not making any changes to the object he is static casting the TJSONObject into. I don't get it, why cast one object into another at all then?

    ReplyDelete
  3. Usually that is done because the runtime type is more derived than the compile time type. Very common with JSON parsing. If you only describe the code, we can only guess.

    ReplyDelete

Post a Comment