Re: help with storing user input
- Posted by Derek Parnell <ddparnell at bigpond.com> May 17, 2003
- 424 views
----- Original Message ----- From: "Jason Dube" <dubetyrant at hotmail.com> To: "EUforum" <EUforum at topica.com> Subject: Re: help with storing user input > > -Derek, I was wondering if you could give me an overview of what this > particular code is doing. > > -- Validate quote marks parameter > if sequence(pQuotes) then > if length(pQuotes) = 0 then > pQuotes = {{},{},{},{},{}} > elsif (length(pQuotes) != 5 > or > atom(pQuotes[1]) > or > atom(pQuotes[2]) > or > atom(pQuotes[3]) > or > length(pQuotes[1]) != length(pQuotes[2]) > or > atom(pQuotes[4]) > or > atom(pQuotes[5]) > or > length(pQuotes[4]) != length(pQuotes[5]) > ) > then > pQuotes = 0 > end if > end if > > if atom(pQuotes) then > if pQuotes = 0 then > pQuotes = {"\"'`", "\"'`", "\\~","",""} > else > pQuotes = {{pQuotes}, {pQuotes},{},{},{}} > end if > end if This is just validating and initializing the pQuotes group of data. pQuotes[1] and [2] is a pair of character sets. [1] is the start quote and [2] is the matching end quote. All the characters inside the quotes is considered to be a word. pQuotes[3] is a list of characters that are 'escape' characters to be used inside quoted strings. For example... 'abc~'def' with pQuotes = { "'", "'", '~', ...} gives the word value as abc'def pQuotes[4] and [5] are not being used yet. ---------------- cheers, Derek Parnell