Multiple If
Hi, i need have in script multiple code IF. For example:
[code]
If Field("A")="Yes" And Field("B")="Yes" Then Value="test.jpg"
[/code]
This code not function - what i do wrong?
(i am amater scripter
)
Thanks for help
[code]
If Field("A")="Yes" And Field("B")="Yes" Then Value="test.jpg"
[/code]
This code not function - what i do wrong?
(i am amater scripter
Thanks for help
0
-
Hi,
There may be a way to do this in a single line script (I have seen some If statement shortcuts), but below is working code for a multi-line script. You can use that by changing your data source from single-line to multi-line script. You can change the below code to fit your needs hopefully:
[code]if (Format.NamedSubStrings("fielda").Value = "Yes") and (Format.NamedSubStrings("fieldb").Value = "Yes") then
Value = "test.jpg"
end if[/code]0 -
[quote name='nRyder' timestamp='1340976410' post='2727']
Hi,
There may be a way to do this in a single line script (I have seen some If statement shortcuts), but below is working code for a multi-line script. You can use that by changing your data source from single-line to multi-line script. You can change the below code to fit your needs hopefully:
[code]if (Format.NamedSubStrings("fielda").Value = "Yes") and (Format.NamedSubStrings("fieldb").Value = "Yes") then
Value = "test.jpg"
end if[/code]
[/quote]
Hi, thank for your time - i trying write code like your sample (with my fields) without good request.
[code]
Value="Datum narozeni"
If (Len(Field("1davka.apend_0"))>0) and (Field("1davka.ctype_0")="6") and (Field("1davka.creator_0")="DPO") Then
Value="Osobní číslo"
End If
[/code]
I have 2 creator "DPO" and "VEO"
Both Creator have ctype "0","2","4","5","6"
If I have in 1st field "DPO", in 2nd field "6" and in 3rd field (apend) is some data then Value is "Osobní číslo"
Karel0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare