character*(*) <-> Delphi

character*(*) <-> Delphi

character*(*) parameters in fortran require 2 parameters in Delphi, one of them being the string length (hidden argument in fortran).
Unfortunately these length parameters are after all other parameters.
What should I do to keep the character string argument and the length argument together ?
Example : fortran : parameters c1, c2, i1, i2 (c=char, i=integer)
Seen by Delphi :
c1, c2, i1, i2, l1, l2 (l1 and l2 being the length of c1 and c2 respectively).
Desirable is :
c1, l1, c2, l2, i1, i2
According to the release notes, this parameter order would be possible, but I am unable to find out how this can be obtained.
Thanks for any help offered !
Jan (Belgium)

2 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

You can force fortran compiler not to expect length at all using REFERENCE attribute on string dummy. See here for an illustration. You have to provide length explicitly, though, but you could do it either by hard-coding or by passing an additional real (i.e. not hidden) integer argument. In this way, you'd have full control over how and where length arguments are passed.

There's also compiler switch /iface: which can be set up on Project/Settings/Fortran/External Procedures/String Length Arg Passing (maybe it's moved somewhere nearby in newer CVF versions).

HTH
Jugoslav

Jugoslav
www.xeffort.com

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui