<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile='Immersive'  version='3.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' https://www.web3d.org/specifications/x3d-3.0.xsd ' >
<head>
<meta name='titlecontent=' ScriptSyntaxExampleTest.x3d '/>
<meta name='creatorcontent='Don Brutzman'/>
<meta name='createdcontent='8 January 2000'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='descriptioncontent='Script node syntax example, testing sample values of various types with simple escaping of apostrophe and quotation mark characters, with results shown on Browser console output.'/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Basic/development/ScriptSyntaxExampleTest.x3d '/>
<meta name='generatorcontent=' X3D-Edit, https://www.web3d.org/x3d/content/README.X3D-Edit.txt '/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF node: myScript
-->
<Scene>
<WorldInfo title='ScriptSyntaxExampleTest.x3d'/>
<Script DEF='myScript'
  url=' "NoSuchScript1.js" "https://www.web3d.org/x3d/content/examples/Basic/development/NoSuchScript2.class.ignore" ' >
<field name='someSFBooltype='SFBoolaccessType='inputOnly'/>
<field name='someMFInt32type='MFInt32accessType='outputOnly'/>
<field name='someMFFloatstype='MFFloatvalue='0.0 1.0 2.0accessType='initializeOnly'/>
<field name='someStringFieldtype='SFStringvalue='helloaccessType='initializeOnly'/>
<field name='stringTest1type='MFStringvalue='"'" "apostrophe"accessType='initializeOnly'/>
<field name='stringTest2type='MFStringvalue='"Quote &quot; character" "More Text"accessType='initializeOnly'/>
<field name='someInitializedRotationtype='SFRotationvalue='0 1 0 0accessType='initializeOnly'/>
<field name='someInitializedTimetype='SFTimevalue='0accessType='initializeOnly'/>
<![CDATA[
      
ecmascript:

// Preferred style for inlined script code is contained CDATA
// in order to simplify use of characters < > " " ' ' etc. in source code

// When inlined script code appears in url instead, XML special characters
// must be carefully 'escaped' or an incorrect translation will result.

// url appears before contained code when translating to VRML encoding,
// so that external (possibly updated) code scripts can take precedence

function someSFBool (value, timestamp)
{
	Browser.println ('someSFBool input event=' + value);
	someMFInt32 = 0; // set outputOnly event, for example
}
function initialize (value)
{
	Browser.println ('    someMFFloats=' + someMFFloats);
	Browser.println ('someStringField=' + someStringField);
	Browser.println ('    stringTest1=' + stringTest1);
	Browser.println ('    stringTest2=' + stringTest2);
}

    
]]>
</Script>
<Anchor description='Select text to view source documentation'
  url=' ScriptSyntaxExampleTest.html"https://www.web3d.org/x3d/content/examples/Basic/development/ScriptSyntaxExampleTest.html" ' >
<Shape>
<Text string='"Script node syntax example," "select this text to view source"'>
<FontStyle justify='"MIDDLE" "MIDDLE"'/>
</Text>
<Appearance>
<Material diffuseColor='0.7 0.4 0.1'/>
</Appearance>
</Shape>
<!-- selectable Text to show Anchor description -->
<Shape>
<Box size='11 2 .001'/>
<Appearance>
<Material transparency='1'/>
</Appearance>
</Shape>
</Anchor>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF node: myScript
-->

Event Graph ROUTE Table with 0 ROUTE total, showing X3D event-model relationships for this scene.

Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.


-->

<!-- Online at
https://www.web3d.org/x3d/content/examples/Basic/development/ScriptSyntaxExampleTestIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/development/ScriptSyntaxExampleTest.x3d -->

<!-- Color legend: X3D terminology <X3dNode DEF='idName' field='value'/> matches XML terminology <XmlElement DEF='idName' attribute='value'/>
(Light-blue background: event-based behavior node or statement) (Grey background inside box: inserted documentation) (Magenta background: X3D Extensibility)
-->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->