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
Labels
None yet
2 participants