Hi all
I am reading the Map file created after linking a project to identify the
error
line within a module.
Can somebody enlighten me as to why I cant find a string in another string
when I know that the string is there. (for example 0416:01A9)
I have done all the usual removal of spaces , printed the string to confirm
that the string was in fact retrieved from the file etc.
This is a code snippet.
'First find the file length
MF = FREEFILE
OPEN "Module02.MAP" FOR input AS #MF
FLEN = LOF(MF)
CLOSE #MF
'Next make a blank string equal to the length of the file.
A$ = STRING$(FLEN," ")
'Now get the whole string from the file.
OPEN "Module02.MAP" FOR RANDOM AS #MF LEN = FLEN
GET #MF,,A$
Close #MF
REC = INSTR(A$,Address$)
IF REC > 0 THEN
blah
blah
Regards
Dinasaur
String Search
Hi Dinosaur,
The problem comes from the second Open statement, when opening a file for random like you do here, it is expected to have a type, a fixed length. and data is somehow encrypted (binarized?) into the file. so when you get your string after teh 2nd open, the data is not plain text.
You might want to try opening the file as binary instead of random. And reading it that way.
Hope this helps.
The problem comes from the second Open statement, when opening a file for random like you do here, it is expected to have a type, a fixed length. and data is somehow encrypted (binarized?) into the file. so when you get your string after teh 2nd open, the data is not plain text.
You might want to try opening the file as binary instead of random. And reading it that way.
Hope this helps.
String Search
Thanks for that,
Interesting that when you print the contents of the filled string to the screen, it all looks normal.
But opening AS Binary solves that.
Thanks again
Dinosaur
Interesting that when you print the contents of the filled string to the screen, it all looks normal.
But opening AS Binary solves that.
Thanks again
Dinosaur