consoleNum

output a label and a number to the console.

Requires

#include "tiktag.h"

Definition

void consoleNum(const char* label, int value);

Description

The consoleNum functions outputs a label and an int value to the console-output of your browser. This function is typically used for debugging purposes to see if a number matches its expected value

Parameters

label: a zero-terminated ASCII String (Label)

value: An integer value

Return Value

void

Remarks

-

Example: debug C++ Code

main.js:

import {_wasmInitA} from "./tt/ttWASM.js";
import wasm from "./web.wasm";

async function main()
{
	const wasmInstance = await _wasmInitA(wasm, {}, null);
	wasmInstance.exports.doProcessing();
}

main();

myCppExample.cpp:

#include "tiktag.h"

_export void doProcessing()
{
	int a;
	a = 2+2*2-2*2;
	if (a == 12)
		consoleLog ("a equals 12.");
	else
	{
		consoleNum ("a equals unexpected value: ", a);
	}
}

Output:

See Also

consoleLogconsoleStrconsoleHex