Native Code error

cybero's picture

Finally caught in captivity - a native code error - yet it renders still.

PreviewAttachmentSize
nativecode result QC.png
nativecode result QC.png22.89 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

smokris's picture
Re: Native Code error

Could you post a composition that triggers this?

cybero's picture
Re: Native Code error

If I stumble upon it again I shall post it, It was definitely associated with seeking to call a CharCodeAt a particular point of reference, although it was not the named function as the screen grab seems to indicate , it was the function point that broke. I've had this happen with other than

I get these oddities from time to time and this time I snagged it but didn't bag it.

Just bad JS in the Script Editor and easily enough to stop from occurring, but all too elusive to reproduce. Probably just down to a nudging space character or something.

cybero's picture
Re: Native Code error

You're in luck - that's two native code results in one code sitting - a rare event indeed and worthy of posting - not only that but I've saved the error making item - easy to see what's gone 'wrong' there & the one that works . Of course a picture may speak a thousand words but the code listing often makes all crystal clear.

You get the before - sortarrayrandomwords.qtz - working OK and after - sortarrayrandomwordsqwak.qtz - with added error messaging in the render.

smokris's picture
Re: Native Code error

You're seeing this because you're casting a javascript function to a string.

On this line:

result.outputNumber = ('The word is :- ', S + inputNumber.split); }

you're using the comma-operator, which executes both the first and second expressions, but returns the value of the second, so it becomes:

result.outputNumber = S + inputNumber.split;

You're taking a string and adding a function to it, which implicitly casts the function to a string and concatenates the two.

You probably meant to call the function instead:

inputNumber.split();

...and then process the results of the array into a string to output.

cybero's picture
Re: Native Code error

Thanks for that - I did understand that the change I'd made to the script is what prompted the native code message.

Just seemed so difficult to reproduce when it often as not happened as I entered text and amended it.

Yeah - .split(); or slice would certainly do.

Still got an ongoing problem with Web and other dingbat fonts that I'd hoped to exploit as default installed fonts not rendering the dingbat mapped to the common letters.

Just seems to be the default installed one's that are failing to 'ornament'.

Most 3rd party dingbats and ornamentals work well enough.