Page 1 of 1

Script '...' does not contain any valid lines

Posted: 13 Jan 2024 09:49
by MBaas
I'm not sure if I'm not following best practices (very possible) or if there is a problem, but here's an annoying thing I've struggled with.
I have two scripts that both need the same utility function. Instead of having that function's code in both scripts, I thought I'd put it into a .xyi file and then just load this file.

So initially that file only looked like:

function foo(){
// some code
}


However, load foo.xyi then failed with a msg "Script 'foo.xyi' does not contain any valid lines". If fixed this by adding a line $a=1; at the bottom - but that can't be the recommended way of dealing with such shared tools - so where's my fault?

Re: Script '...' does not contain any valid lines

Posted: 13 Jan 2024 10:44
by highend
include / include_once

Re: Script '...' does not contain any valid lines

Posted: 13 Jan 2024 11:09
by MBaas
Indeed. Thanks! :beer: