1

Im kind of a beginner with programming but here is the thing:

I have different variables set as local, these variables are strings of chars, messages and at the same time I have a set of Booleans that will fill with True or False depending of some circumstances.

The idea is to show a single Message Box containing these variables ONLY IF the booleans are False.

An example in pseudocode:

Local string Greetings = "Hi, my name is"

Local string Name1 = "John"
Local string Name2 = "James"

Local Boolean name1 = .T.

Local Boolean name2 = .T.


If Name1 (Have some conditions)
name1 = .T.
endif

If name2 (Some conditions)
name2 = .F.

If name1 == .T. OR name2 == .T.
MsgBox(Greetings+":"+name1+name2,"Messagebox","Alert")

Endif

Sorry I cant describe a lot about which code it is. but it is like Clipper with Xbase.

The problem I have is than even if the condition of these variables are false, the message box will show the both of them, Do I need to put all the contingencies there? for example if I have 3 booleans, Do I need to do this with True,False,False - False,True,False etc?

Best Regards.

codemania
  • 1,098
  • 1
  • 9
  • 26
Nickso
  • 785
  • 1
  • 10
  • 32

1 Answers1

0

I do not see how name1 can possibly be FALSE. It starts as TRUE and if your first condition evaluates to TRUE, you assign it TRUE again. So name1 must be TRUE.

Depending on your logic you might want to have Local Boolean name1 = .F. in the beginning or name1 = .F. inside your first IF.

PM 77-1
  • 12,933
  • 21
  • 68
  • 111
  • In the end what I did is the following: I put the "Switches" on .T. Then ask if "somefield" have certain conditions, if this is true, the it will change to .F. if not, it will keep on .T. If it stays on .T. the program will delete all its contents, but if it is .F., it will be shown at the last part of the code for example: aHey := "Hey Im a messagebox" lHey := .T. If Empty(FIELD) lHey := .F. endif If lHey == .T. aHey := "" endif msgbox("this is the message if any:"+ahey") The idea to delete the content is if you completed some field, then the program wont need to tell you otherwhise. – Nickso May 12 '14 at 19:02