Knowledge Base

Blog Faq400

Frida-i Quick Poll: RPG IF-ELSEIF or SELECT-WHEN? (EN)

blog
Last Updated on 13 September 2019 by Roberto De Pedrini IF_ELSEIF or SELECT_WHEN? It’s a battle from RPGers on different forums… who like IF_ELSEIF and who like SELECT_WHEN to control flow on multiple conditions. Let’s start by saying that IF-ELSEIF and SELECT-WHEN are the exact same thing from a point in the program flow and the performance of the code itself, so these following two pieces of code do exactly the same thing: if YourAge<30; dsply 'Oh, you are very young!' 'inp; elseif YourAge<40; dsply 'You are young!' 'inp; elseif YourAge<50; dsply 'OK you are still young!' 'inp; elseif YourAge<60; dsply 'Oh, you were young once!' 'inp; else; dsply 'Oh yeah, it's RPG!...' 'inp; ENDIF; select …

Riservato agli iscritti

Per leggere l'articolo completo serve un account Faq400. È gratis, e con lo stesso account fai domande a Willi e leggi tutto l'archivio.

Prova a chiederlo a Willi

Willi risponde usando questo articolo e gli altri contenuti di Faq400, e ti dice da dove prende ogni frase. Serve un account: è gratis.

Chi legge questo, legge anche