|
| HReadSeek() Altering a element of the line returned |
| Iniciado por guest, 06,jul. 2017 18:49 - 3 respuestas |
| |
| | | |
|
| |
| Publicado el 06,julio 2017 - 18: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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 06,julio 2017 - 19:28 |
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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 06,julio 2017 - 20:08 |
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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 06,julio 2017 - 21:06 |
what "line" ?
there is no line in a file |
| |
| |
| | | |
|
| | | | |
| | |
|