If you really want to keep the file in your first format, you can use or build a couple of custom string functions to return the specific data. I've simulated the resulting strings a$,b$ and c$ as if the were read in using
read string filenumber,string$ and then sent them through a custom function to look in between the quotes:
a$="ScreenWidth="+chr$(34)+"1024"+chr$(34)
b$="ScreenHeight="+chr$(34)+"768"+chr$(34)
c$="ScreenBpp="+chr$(34)+"32"+chr$(34)
print "The file is stored as:"
print a$
print b$
print c$
print
Print "Extracting the values from between the "+chr$(34)+" results in :"
print between_chars(start,chr$(34),chr$(34),a$)
print between_chars(start,chr$(34),chr$(34),b$)
print between_chars(start,chr$(34),chr$(34),c$)
end
function between_chars(start,char1$,char2$,string$)
rem return a string between any characters
rem start position is where in the string to start looking from
rem to start from the begninng of the string set this to 0
rem char$ are the characters to check between
rem string$ is the main string to look through
rem to look between parenthesis and quotes use chr$(40), chr$(41) , chr$(34)
rem get the length of the string
ln=len(string$)
rem loop through and find the char$
finish=0
s=start
for n=s to ln
start=n
if mid$(string$,n)=char1$
exit
endif
next n
for n=start+1 to ln
if mid$(string$,n)=char2$
finish=n
exit
endif
next n
rem if start =len of the string exit
if start >= ln then exitfunction chr$(0)
rem if finish is <= start get out of the function - no in between
if finish <= start then exitfunction chr$(0)
rem now take the start and finish and find the string in between
out$=chr$(0)
for n=start+1 to finish-1
out$=out$+mid$(string$,n)
next n
endfunction out$
The above function will probably do the trick for a lot of different situations if you know how you are storing stuff in your file. You may want to create a few functions of your own like Instr() or a better mid$() function where you can put in a start and end value.
Or, a much easier way, if you stored your file like this:
ScreenWidth
1024
ScreenHeight
768
ScreenBpp
32
You could just read each line as a string and then convert the numbers using Val(string$).
Enjoy your day.