Weird behavior of routine when reading hashfile
Posted: Wed Nov 21, 2007 11:56 am
Hello,
I have a server routine that reads all values of the key-field of a hash-file into an array using the code as below:
(note that STAGING_FOLDER and ARRAY_ELEMENT are arguments passed to the routine)
When I test the routine to display the array elements, they are not in the sequence in which they are present in the hash-file, i.e. for example the 24th element in the hash_file appears as the 1st element of the array etc
Also, the data in the array element is not in the same case as that in the hash-file e.g. the key value in the file is ITM_STATUS_unknown but when I display the array element, it is seen as ITM_STATUS_UNKNOWN, i.e. all in uppercase. Is there some way to prevent these two phenomena?
Thanks,
Kaus
[/code]
I have a server routine that reads all values of the key-field of a hash-file into an array using the code as below:
(note that STAGING_FOLDER and ARRAY_ELEMENT are arguments passed to the routine)
Code: Select all
DIM SubFileRunListArray(300)
MAT SubFileRunListArray=0
Openpath STAGING_FOLDER:"/SubFileRun_Types_HF" To FileVar
Then SELECT FileVar to 1
ctrJobsToRun=0
Loop
READNEXT key From 1
Else Exit
ctrJobsToRun=ctrJobsToRun+1
SubFileRunListArray(ctrJobsToRun) = key
Repeat
Close FileVar
Ans=SubFileRunListArray(ARRAY_ELEMENT)
Also, the data in the array element is not in the same case as that in the hash-file e.g. the key value in the file is ITM_STATUS_unknown but when I display the array element, it is seen as ITM_STATUS_UNKNOWN, i.e. all in uppercase. Is there some way to prevent these two phenomena?
Thanks,
Kaus
[/code]