# if

Start a boolean branch

Last updated: 2026-09-09

Package: language | Status: stable

Tags: complete-program, cpu, keyword, logic, yeho

Use if for a small number of ordered decisions. Use match when one value has several named shapes or cases.

```yh
if
```


## File choose runtime

Use if for a small number of ordered decisions. Use match when one value has several named shapes or cases.

Verification: type checked

```yh
text chosen = File.Choose("Choose a file for the Yeho test")
if Text.Length(chosen) == 0 { Console.Log("file-choose-cancel-ok") }
else { Console.Log("file-choose-selected-ok") }

```

Save this beside start.yh as project.mech:

```toml
package = "tests.compiler.kyber.fileChooseRuntime"
version = "0.1.0"
backend = "kyber"
osTarget = "windows"
archTarget = "x64"
selfContainedApp = false

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/word--if/complete --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


The condition must be bool.

Keep the most specific or highest-priority branch first.

Source: yeho/parser_statements.cpp parseIfStatement; conformance control.boolean-conditions

AI training permission: https://demonhunterlabs.com/ai-use
