PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Hf error
Hf error
Iniciado por guest, 14,may. 2015 17:26 - 1 respuesta
Publicado el 14,mayo 2015 - 17:26
The analysis excist out of 2 data filles /date/ name each date fille hes 1 key /date.DATE/name.NAME; both data filles are linked to a edt control.....button 1 adds the data that i am looking for in the data filles button 2 should modify the date if both date and name are equal to the searcht string

however when i run this code i get a error @ line Hmodify
what am i doing wrong here with this bit of code

click button 2
A1,A2,A3 are strings

A1=HSeek(EXPRESS_date,DATE,"DATE")
Trace(A1)
A1="4"
A2=HSeek(EXPRESS_name,NAME,"NAME")
Trace(A2)
A2="5"
A3=A1+A2
Trace(A3)
IF A3= "45" THEN

ScreenToFile(EXPRESS_WIN_TEST)
HModify(DATE)
HModify(NAME)
END
Publicado el 14,mayo 2015 - 17:50
Hi Starter,

Do not forget to post the error message so we can help you better.

I'm not sure if "DATE" is a reserved word in WinDev... Usually in the analysis when you try to create a table (or at least a field) that uses a reserved word, you have a warning to avoid doing so. Let us say it's not reserved.

Now HModify() should use the table name. HSeek will not load the record. Do not use ";", use real date in the query. Take the time to read the beginer's manual provided with the express version. (Look in the Help menu group, there is a self-training guide.)

EXPRESS_date should be your file name in the analysis. Make sure it is the case. In that file you should have a Date field and a Name field. You must use HReadSeek() to actually read the date from the DB.

HModify() should be called only if the record exists. Otherwise you must HAdd() the new record. ScreenToFile() can be used only if the controls on screen are linked to the DB fields.

Your project example looks weird and I can't provide a real example. This looks like a student's class project... any-way.

Here is a small example:
IF HReadSeek(EXPRESS_date,Date,"20150101") _AND_ HReadSeek(EXPRESS_name,Name,"The name") THEN EXPRESS_Name.Name = "Test" IF NOT HModify(EXPRESS_Name) THEN Error() END END
And I think you should use HReadSeekFirst() in that case.

Again, I kindly suggest that you take couple days to go through the self-training material.

Best regards,
Alexandre Leclerc

Edit 1: Fixed typos and code example.