DroidScript wiki

(was AndroidScript) unofficial documentation by the community

User Tools

Site Tools


built_in:nxt_getcurrentprogram

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

built_in:nxt_getcurrentprogram [2015/03/09 15:52] (current)
octazid created
Line 1: Line 1:
 +====== GetCurrentProgram ======
  
 +The **GetCurrentProgram** function gets the name of the NXT-G program currently running on the NXT brick.
 +<​code>​program = nxt.GetCurrentProgram();</​code>​
 +
 +
 +====Example - Get current program====
 +<code javascript>​
 +function OnStart()
 +{
 +  nxt = app.CreateNxt();​
 +  app.SetMenu( "​Connect,​Get Program"​ );
 +}
 +
 +function OnMenu( name )
 +{
 +  if( name=="​Connect"​ )
 +    nxt.ShowDevices();​
 +
 +  else if( name=="​Get Program"​ )
 +  {
 +    program = nxt.GetCurrentProgram();​
 +    app.ShowPopup( program );
 +  }
 +}
 +</​code>​
built_in/nxt_getcurrentprogram.txt ยท Last modified: 2015/03/09 15:52 by octazid