I have a file conversion program with multiple 5 logical variables that I want to test. If any one of the variables are true I want the routine to run, if none are true I want to skip the code.
The variables are initialized in a master program as global, a form acts on the variables and then launches code to perform the operation. My declarations are as follows.
DIM GLOBAL gl_deleteEagle AS l = .f.
DIM GLOBAL gl_deleteKilly AS l = .f.
DIM GLOBAL gl_deleteRegal AS l = .f.
DIM GLOBAL gl_deleteSummit AS l = .f.
DIM GLOBAL gl_deleteWoodstone AS l = .f.
If I only operate on one of the variables the routine triggers and runs such as follows:
if gl_deleteEagle
do stuff
end if
I have changed out the variables and they all work indivicually
I want to get something like this to work
if gl_deleteEagle .OR. gl_deleteKilly .OR. gl_deleteRegal .OR. gl_deleteSummit .OR. gl_deleteWoodstone
end if
The above code throws errors. I have tried
if gl_deleteEagle = .T. .OR. gl_deleteKilly = .T. .OR. gl_deleteRegal=.T. .OR. gl_deleteSummit=.T. .OR. gl_deleteWoodstone=.T.
if (gl_deleteEagle = .T. .OR. gl_deleteKilly = .T. .OR. gl_deleteRegal=.T. .OR. gl_deleteSummit=.T. .OR. gl_deleteWoodstone=.T.)
if gl_deleteEagle == .T. .OR. gl_deleteKilly == .T. .OR. gl_deleteRegal==.T. .OR. gl_deleteSummit==.T. .OR. gl_deleteWoodstone==.T.
I have tried adding Then at the end and other permutations. I know this is a really simple issue to solve but I have been banging my head against this and am very frustrated. I have coded for over 20 years in a couple of other languages which just adds insult to injury.
Will someone kindly point out the very simple solution that I have been missing.
The variables are initialized in a master program as global, a form acts on the variables and then launches code to perform the operation. My declarations are as follows.
DIM GLOBAL gl_deleteEagle AS l = .f.
DIM GLOBAL gl_deleteKilly AS l = .f.
DIM GLOBAL gl_deleteRegal AS l = .f.
DIM GLOBAL gl_deleteSummit AS l = .f.
DIM GLOBAL gl_deleteWoodstone AS l = .f.
If I only operate on one of the variables the routine triggers and runs such as follows:
if gl_deleteEagle
do stuff
end if
I have changed out the variables and they all work indivicually
I want to get something like this to work
if gl_deleteEagle .OR. gl_deleteKilly .OR. gl_deleteRegal .OR. gl_deleteSummit .OR. gl_deleteWoodstone
end if
The above code throws errors. I have tried
if gl_deleteEagle = .T. .OR. gl_deleteKilly = .T. .OR. gl_deleteRegal=.T. .OR. gl_deleteSummit=.T. .OR. gl_deleteWoodstone=.T.
if (gl_deleteEagle = .T. .OR. gl_deleteKilly = .T. .OR. gl_deleteRegal=.T. .OR. gl_deleteSummit=.T. .OR. gl_deleteWoodstone=.T.)
if gl_deleteEagle == .T. .OR. gl_deleteKilly == .T. .OR. gl_deleteRegal==.T. .OR. gl_deleteSummit==.T. .OR. gl_deleteWoodstone==.T.
I have tried adding Then at the end and other permutations. I know this is a really simple issue to solve but I have been banging my head against this and am very frustrated. I have coded for over 20 years in a couple of other languages which just adds insult to injury.
Will someone kindly point out the very simple solution that I have been missing.
Comment