HReadSeek() Altering a element of the line returned

Startbeitrag von p44 am 06.07.2017 16:49

Hi,
for training purposes,id liked to search with (composite key) return the position of the line and then access record line and change a element ... so far i have the lines below,but it s triggering error,(i know i can load in table and aply filteror que however id like to learn how to access it directly.Can someone give a example of a code brick that could work.

thanks in advance


ValCompKey is Buffer
ValCompKey = HBuildKeyValue(time,daymonthyear , sAb2, sAb3,sAb4)
HReadSeek(time,time.daymonthyear, ValCompKey, hIdentical) ///Returns record line associated with the search
WHILE HFound() = True
...
HReadFirst(time,hCurrentRecNum)// access record line first position key 1
HReadNext(time,hCurrentRecNum)//key2
HReadNext(time,hCurrentRecNum)//key3
HReadNext(time,hCurrentRecNum)//key4
time.name=EDT_NoName1 //change or add key 5
HModify(time.name,hCurrentRecNum) //modify (key) if already entered
HModify(time,hCurrentRecNum) //modify (complete line)
HSave(time.name) // save file

Trace("test")
END

Antworten:

Hi

First, let me say that from the type of questions you are asking, it looks like you would benefit from studying in details the tutorial.

Second, about your question:

Your code block doesn't seem to match the description of what you say you want to achieve.

To modify a value in a specific record, just do

if hreadseek(file, uniqueKey,Value,hidentical)=true then
File.Field=NewValue
hmodify(File)
end

Best regards

von Fabrice Harari - am 06.07.2017 17:28
id like to search u unique comp key
buth modify another record that dosent belong to that unique key buth is contained in the same line

von p44 - am 06.07.2017 18:08
what "line" ?

there is no line in a file

von Fabrice Harari - am 06.07.2017 19:06
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.