Evanys Mayor
Evanys Mayor

Reputation: 11

If conditional in visual fox pro

I am not a visual fox pro developer, I work whit python, but I in the task to pass a complete program from VFP to django, so far I didn't have much problem but this conditional appears and I don't know what does it mean, I look for this in internet but any of the results gave a clear answer. vxSeries is a variable that only contains string and could be in this way 'EF001-01254585960000' IF 'E' $ vxSerie OR 'F' $ vxSerie

Upvotes: 0

Views: 650

Answers (1)

Cetin Basoz
Cetin Basoz

Reputation: 23797

It is a plain If condition check that is available in any language including python, strange you couldn't find any clear answer.

IF 'E' $ vxSerie OR 'F' $ vxSerie

Probably it is the $ operator that fooled you. It is an operator in VFP, that means X exists in Y - "Y contains X" (where X = 'E' and Y = vxSerie). So:

'E' $ vxSerie

means, is there any 'E' character in whatever the vxSerie variable is holding at that moment (that variable is not explicitly aliased, might be a field or memory variable).

If

vxSerie =  'EF001-01254585960000'

then

IF 'E' $ m.vxSerie OR 'F' $ m.vxSerie

would be true. It is looking if either E or F is available in that string (and shortcutting on first part finding E, second part is not evaluated at all).

(Note that I added m. to mean it is a memory variable explicitly.)

Upvotes: 3

Related Questions