ParseData Removes Quotes
Keywords: parsedata
Question:
ParseData behaves strangely with the double-quotes. I receive from the registry the following string:C:\Win95\uninst.exe -f"C:\Program Files\blahblah\DelsL1.isu"After ParseData, I find the following:PARAM1 is C:\Win95\uninst.exe PARAM2 is -fC:\Program Files\blahblah\DelsL1.isuthe double-quotes in PARAM2 have disappeared. Because there is a space in the directory name, I have some problem using the data.Even if I replace the double-quote (") with a single-quote (') or with a back-quote (`), the ParseData destroys it. Replacing the double-quote by anything which is not a string delimiter leaded to "unpredictable results". Do you have a workaround for this kind of problem ??
Answer:
After getting the string from the registry, you are going to have to pick it apart very carefully. Perhaps avoid parsedata.I don't think you can make a general solution the the problem, but you should be able to solve this problem.
Basically you use the strscan function to look for a doublequote OR a space. When it finds a character, look at the character.
; you'll need to set up the exact syntax in this example. This is just the general logic. param0=0 start=1 while 1 finish=strscan for " or space if finish==0 then break if char at a is " finish=strscan for " if finish==0 then break continue endif param0=param0+1 param%param0% = strsub(line,start,finish) endwhile
Article ID: W13098Filename: ParseData Removes Quotes.txt