>(video or display) and blinking
>
>>(VIDEO.OR.DISPLAY).AND.BLINKING
>
>>(ATC('VIDEO', problem)>0.OR.ATC('DISPLAY', problem)>0).AND.ATC('BLINKING',problem)>0 >>It started to look easy but it's more work than I initaly thinking. Before I take too much time is there something else I could use. API? Website? that would help in converting these types of querys into Foxpro commands.
#define TRUE .t. #define FALSE .f. *--------------------------------------------------------------------------- function do_it() local Entered, Result Entered = '(video or display) and blinking' if( !Convert(Entered, @Result) ) ? 'Bad expression' else ? Result select * from Table where (&Result) endif endfunc *--------------------------------------------------------------------------- function Convert(src, xx) local RegExp, Match, i, s RegExp = CreateObject('VBScript.RegExp') RegExp.IgnoreCase = TRUE RegExp.Global = TRUE RegExp.Pattern = '([_a-zA-Z][_a-zA-Z0-9]*)' && (1) Need all the words && if not in ('and', 'or', 'not') && change Match = RegExp.Execute(src) for i = Match.Count-1 to 0 step -1 do case case inlist(upper(Match.Item[i].Value), 'AND', 'OR', 'NOT') && skip otherwise s = [!empty(atc('] + Match.Item[i].Value + [', problem))] src = stuff(src, Match.Item[i].FirstIndex+1, Match.Item[i].Length, s) endcase endfor && (2) check syntax private ExprError ExprError = FALSE s = on('error') on error ExprError = TRUE xx = normalize(src) on error &s return !ExprError endfunc *---------------------------------------------------------------------------See also http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnclinic/html/scripting051099.asp