ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

How do you correctly have extended IF expression?

This forum is the place to learn about and discuss ADRIFT 5. Feel free to mention any bugs you find here, but please also add these to the Bugs & Enhancements list.

Please also refer to the ADRIFT 5 Wiki for more information.

How do you correctly have extended IF expression?

Postby DazaKiwi » Tue Jan 14, 2020 1:43 am

Someone else had worked it out in a demo ages ago and i cannot recall who or which demo, but i had written done the method in my notes and made an error somewhere..

adrift Code: Select all
<#if(Condition=A,"Text",if( (Condition=B,"Text",if ((Condition=C,"Text"," "))#>


I know in programming you are required to have a closed bracket for every opened one so i tried also..
adrift Code: Select all
<#if(Condition=A,"Text",if( (Condition=B,"Text",if ((Condition=C,"Text"," ")))))#>


How is this suppose to be written correctly?

Thanks
User avatar
DazaKiwi
 
Posts: 669
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 21

Re: How do you correctly have extended IF expression?

Postby ralphmerridew » Tue Jan 14, 2020 2:51 am

You have two left parens after the second and third "if". Try removing one each, as well as the corresponding right parens:

adrift Code: Select all
<#if(Condition=A,"Text",if (Condition=B,"Text",if (Condition=C,"Text"," ")))#>
Bloodhounds can make you laugh and cuss in the same breath. They are endearing, faithful, and can sling drool ten feet in any direction. -- Virginia Lanier
User avatar
ralphmerridew
 
Posts: 2577
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri
Points: 10

Re: How do you correctly have extended IF expression?

Postby DazaKiwi » Tue Jan 14, 2020 3:19 am

Thanks ralphmerridew that worked :)
User avatar
DazaKiwi
 
Posts: 669
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 21


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 1 guest