Help with Functions

Simulated dice for role playing games
Post Reply
Posts: 17
Joined: Wed Jul 27, 2011 8:22 am
IQ Test: Orange

Help with Functions

Post by BeeJay » Sun Sep 08, 2013 4:38 am

Hi guys and gals,

I need some help with sending variables to functions as I seem to only be able to send a single variable even if I declare two to say nothing of being able to get a return value from a JavaScript function.

Here's my first function:

Code: Select all

<function id="TAROCTEST2">
	@RES ← #1 + #2.
	"TT2" + @RES
And how I call it:

Code: Select all

Here's where it gets weird. If I ONLY use #1 in the function I'll get a result. But when I try and add #1 to #2 I get nothing back from the function so @EXTRA ends up being 0.

Trying to do a very simple HelloWorld JavaScript function ends up returning 0 as well.

Code: Select all

<function id="TAROCTEST" language="javascript">
	function TarocTest(diff) 
		return 'TTJS';
Calling it by:

Code: Select all

returns 0. :(



I have a much more complex JS function that I have actually tested as working in a HTML page, but if I can't get it to return...

Post Reply