gg:=Добро
if !(gg contains Вход or Добро)
MsgBox +
ExitApp
Why + ?
Variables
Re: Variables
msgbox + if contains
or not contains
Code: Select all
gg=Добро
if gg contains Вход,Добро
MsgBox +
ExitApp
Code: Select all
gg=Добро
if gg not contains Вход,Добро
MsgBox +
ExitApp
Re: Variables
Thanks. There is another question:
gg:=ттт
if gg != ууу1,contains еее
MsgBox 1
ExitApp
Why 1 ?
gg:=ттт
if gg != ууу1,contains еее
MsgBox 1
ExitApp
Why 1 ?
Re: Variables
see also some examples with AND / OR etc
and also INSTR , Regex...
and also INSTR , Regex...
Code: Select all
g1:="TTT"
g2:="AAA"
if (g1 ="TTT" and g2 = "AAA" )
MsgBox,(g1 ="TTT" and g2 = "AAA" )
if (g1 ="TTT" or g2 != "AAC" )
MsgBox,(g1 ="TTT" or g2 != "AAC" )
if (g1 ="TTT" and g2 = "AAC" )
MsgBox,CASE-1
else
MsgBox,CASE-2
ExitApp
/*
;- if GG containsx Instrxx
If InStr( GG, "by:" ) || InStr( GG, "CCCC" ) || InStr( GG, "Summar" ) || InStr( GG, " " )
Continue
;-or also
If GG Contains by:,CCCC, ,Summar
Continue
;-or
If ( RegExMatch(GG, "i)" . "by:|CCCC| |Summar") ) ;- "i)" means "Case-Insensitive"
Continue
;-or
If ( GG ~= "(?i:" . "by:|CCCC| |Summar" . ")" ) ;- "?i:" means "Case-Insensitive"
Continue
*/
Re: Variables
fedek,
You must use the syntax shown and explained in the manual:It seems that you've just made up your own syntax. That won't work.
The first is if (expression).
You must use the syntax shown and explained in the manual:
You have written:if Var contains MatchList
if Var not contains MatchList
Code: Select all
if !(gg contains Вход or Добро)
Code: Select all
if gg != ууу1,contains еее
The first is if (expression).
The second is IfNotEqual.An if-statement that contains an expression is differentiated from a traditional-if such as If FoundColor <> Blue by making the character after the word "if" an open-parenthesis. [...] the open-parenthesis may be omitted entirely if the first item after the word "if" is a function call or an operator such as "not" or "!".
Source: if (expression)
Your variable gg does not contain the literal value "yyy1,contains eee", so the MsgBox is shown.IfNotEqual, var, value (same: if var <> value) (!= can be used in place of <>)
Source: If/IfEqual/IfNotEqual/IfLess/IfLessOrEqual/IfGreater/IfGreaterOrEqual
Re: Variables
also you are assigning the variable incorrectly
read the variables help page
Code: Select all
gg:=Добро ; wrong
; either :
gg := "Добро"
; or
gg = Добро
Who is online
Users browsing this forum: Bing [Bot] and 346 guests