Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 2 Jahren, 4 Monaten
Letzter Beitrag:
vor 2 Jahren, 4 Monaten
Beteiligte Autoren:
Al, Steven Sitas

WD[20] Halias() code works with HFClassic does not work with HFCS

Startbeitrag von Al am 17.02.2016 03:02

Hello All

We have moved some clients from HFClassic to HFCS and a number of programs have stopped working as they should. In each case it involves the use of HAlias() and copying from a file to itself using the alias.
This is a snippet of the code

EstRefAlias is Data Source
HAlias(EStRef, EstRefAlias)
HChangeName(EstRefAlias, "EstRef")
WHILE NOT HOut(EstRefAlias)
EstRef.ESCLEUNIK = LCopyToEstimateCle
//other code
END //WHILE NOT HOut(EstRefAlias)

After the HReadNext, the file does not go to the next record. It stays on the starting record and the code after the End is executed so it is only processing the first record. Clearly the HFCS engine cannot cope with using the same file as an aliased source of itself and then copying between the AliasFile and the original file but the same code executes fine in HFClassic. Changing the code around to use a view or a query as the source file works fine with the HFCS.
I thought the whole point of the HAlias() function was to create a completely separate view of a file that then could be addressed independently of the source file. This the case in HFClassic but not in HFCS. I use this method in a few places in my applications and on checking, they all fail under HFCS.

Has anyone else seen this behaviour or has a solution ? At the moment I am going through my code looking for similar examples so I can change them



Hi Al,
in HF C/S you must do a small change to your code:

PartyMain_alias is Data Source
HChangeConnection(PartyMain_alias ,myconnect) //only necessary if using a connection
HChangeName(PartyMain_alias, "PartyMain")

where myconnect is your connection

Steven Sitas

von Steven Sitas - am 17.02.2016 12:26
Hello Steven

Thanks for the solution.


von Al - am 17.02.2016 18:29
Hello Steven

I tried using HChangeConnection(PartyMain_alias ,myconnect) //only necessary if using a connection as suggested but it made no difference.
I establish the connection named "HyperFileCS" and use it to connect to the HFCS when the exe loads and I nominated the same connection name in the HChangeConnection(QTLinesAlias,HyperFileCS)
I will have go back to using a view or a query to hold the alias

Thanks anyway


von Al - am 18.02.2016 01:15
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.