inky icon indicating copy to clipboard operation
inky copied to clipboard

Usage of external function will end the story immediately

Open julhe opened this issue 4 years ago • 2 comments

To reproduce:

EXTERNAL Foo()
Hello World!
~ Foo()

Output is just End of Story.

When removing ~ Foo() however, Hello World! is printed as expected.

julhe avatar Nov 16 '21 20:11 julhe

It's actually crashed - functions need to be defined in the ink script ("a fallback" that inky uses). Without a === function Foo() the ink doesn't compile and run. So there is a bug here - but it's the lack of a proper error message.

joningold avatar Nov 16 '21 22:11 joningold

The correct way is to define a function too in inky

~ Foo()

EXTERNAL Foo()
=== function Foo()
Hello World!
~ return

Selsynn avatar Mar 16 '23 17:03 Selsynn