8000 Defining fallback functions for testing in Ink Editor · inkle ink · Discussion #890 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Defining fallback functions for testing in Ink Editor #890

Discussion options

You must be logged in to vote

These two don't match parameters; also the external function def is supposed to name parameters (the parameters aren't used by ink, so it's just a way of telling the compiler how many to expect, but still - you can't use "true").

So

EXTERNAL SetTestBool1(true)
    == function SetTestBool1() ==
~ return

should be

EXTERNAL SetTestBool1(booleanVar)
    == function SetTestBool1(booleanVar) ==
~ return

You're also going to need your ink fallback for "getTestBool" to return something, or you'll hit an error when inky tries to use it.

    == function GetTestBool1() ==
~ return true

Note I quite often use "return RANDOM(0,1)" for this kind of fallback, so I can test different paths, but your u…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@afejesrichard
Comment options

Answer selected by joningold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
< 8000 div id="partial-discussion-sidebar" class="flex-shrink-0 col-12 col-md-3 mt-3 mt-md-0 js-socket-channel js-updatable-content" data-channel="eyJjIjoiZGlzY3Vzc2lvbjo2MjI2Nzk5IiwidCI6MTc0NzE4NTcxMX0=--e15b13c619dbc81a01636329a7dc216f2c1b27ee59396e80e54eb717221ef0db" data-gid="D_kwDOAv6sQc4AXwNv" data-url="/inkle/ink/discussions/890/sidebar" data-project-hovercards-enabled>
Labels
None yet
2 participants
0