Quantcast
Channel: WinDev Forum
Viewing all articles
Browse latest Browse all 1914

corrupt data file? (3 replies)

$
0
0
While updating a field in a file from some other data (HF files imported from XLS) I came upon the following problem using the following code:
arrFiles is array of strings = ["Beans$","Choc$","Frozen$","Fruit$","Grains$","Juice$","Misc$","Nuts$","Olives$","Pasta$","PB$","Snacks$","Spices$"]
sFile, sItem, sTmp, sSC_Code is string
i, nMax is int
nMax = ArrayCount(arrFiles)
FOR i = 1 TO nMax
sFile = Upper(arrFiles)
HReadFirst(sFile)
WHILE NOT HOut(sFile)
sSC_Code = ""
sItem = {sFile +".Item"}
IF sFile = "SPICES$" THEN
sSC_Code = NoSpace({sFile +".ScaleCode"})
ELSE
sTmp = NoSpace({sFile +".SC_CODE"})
IF Left(sTmp,1) = "S" THEN
sSC_Code = sTmp // SCCODE
END
END
HReadSeekFirst(TNF_Item,ITMDESC,sItem) // THIS FAILS
IF HFound(TNF_Item) THEN // AND OF COURSE SO DOES THIS
TNF_Item.SCODE = sSC_Code
HModify(TNF_Item)
ELSE
Info(sItem +" not found!")
END
HReadNext(sFile)
END
END

The ITMDESC in TNF_Item is defined as string[50] unique key. The results shown in Step1.png and Step2.png don't seem to make any sense. Step1 shows status just before HReadSeekFirst and Step2 shows just after.
[attachment 2580 Step1.png]
[attachment 2581 Step2.png]

Viewing all articles
Browse latest Browse all 1914

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>