Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 1 Jahr, 2 Monaten
Letzter Beitrag:
vor 1 Jahr, 2 Monaten
Beteiligte Autoren:
Garry Allen, Fabrice Harari, Stewart Crisler, Al

HSeekFirst problem during import

Startbeitrag von Garry Allen am 01.05.2017 17:30

I have the following code:

where dsComp.COMP_ID is SUN 01

The if statement is triggered despite the fact that there is no record with that COMP_ID in RBL_COMP. There is however a record with COMP_ID = SUN&01.

If I change the space in "SUN 01" to e.g. SUN*01 or SUN?01 I get an integrity error but if I change it to SUN101 the program proceeds just fine.
What am I missing?


Try HReadSeekFirst() for the behavior you want.

Stewart Crisler

von Stewart Crisler - am 01.05.2017 17:53
Hello Garry

You could be screwed by the simple fact that Windev originated in France and PCSoft have no clue that in English, the ampersand is a legitimate character meaning "and".

They treat it as a shortcut indicator on button labels which is probably okay except they apply it everywhere else and force the substitution of an underscore for the ampersand..
If they are doing it on data in field, which is what it looks like, then it is just crazy.

In some text this means that you have to use a double ampersand, in which case, they drop one off and display a single ampersand.

There is a half hearted attempt to fix it is some cases with the ..InterpretAmpersand function but I don't think it works with the "H" commands

It might work if you assign the field value to a variable and then use the variable in the seek or maybe use indirection to provide a value for the seek.

PCSoft have known about this for years but seem unable to grasp how the ampersand is used in English or maybe the problem is too embedded to be fixed properly.

Maybe tech support have a workaround ?


von Al - am 01.05.2017 18:06
Hi Garry,

it looks like your key is set in the analysis to ignore punctuation. Because of that, all these values are the same for the key (and unicity) :
SUN 01 - SUN*01 - SUN?01 - SUN.01 - SUN!01

(ie SUNAnyPunctuation1)

Furthermore, with a hreadseekfirst, you will also find SUN 011.

You should do a hreadseek with the hidentical option instead.

Best regards

von Fabrice Harari - am 01.05.2017 18:20
Stewart: I can't use HReadSeekFirst because it moves the record pointer and reads the record (which I don't want.

Al: Yes, it seems to be an & problem. It also occurs with another ID (LYN 01) where there is a LYN&01 on file, but I don't understand why replacing the & with a * or ? causes an integrity error. It's like only A-Z and 0-9 are allowed in key fields. The problem will go away in the end product since I only use Auto ID's for keys but I'm stumped on an easy way to import the data from the old xBase files since the old keys are referenced in other files.

von Garry Allen - am 01.05.2017 18:47
Fabrice: I'm using WinDev 20 and I don't think the hidentical is supported there although the help says that if I don't include an option then it does an exact search.
Where in the analysis do I set the option to ignore punctuation?

von Garry Allen - am 01.05.2017 18:52
Thanks for the advice Fabrice - I found the setting and changed it. Problem solved!

von Garry Allen - am 01.05.2017 19:02
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.