nxtlib/src/Protocol.cs
/// <summary> 
/// [Native] Gets the name of the currently running program on the NXT brick.
/// </summary>
/// <returns>The name of the currently running program, as a string.  Null if no program running.</returns>
[Native] Gets the name of the currently running program on the NXT brick.
[ Native ] Gets the name of the currently running program on the NXT brick .
public string GetCurrentProgramName()
        {
            try
            {
                byte[] request = new byte[] {
                (byte) (0x00),
                (byte) (DirectCommand.GetCurrentProgramName),
                };
                byte[] reply = CompleteRequest(request);
                string filename = Encoding.ASCII.GetString(reply, 3, 20).TrimEnd('\0');
                return filename;
            }
            catch (NXTNoActiveProgram)
            {
                return null;
            }
        }
public string GetCurrentProgramName ( ) { try { byte [ ] request = new byte [ ] { ( byte ) ( 0x00 ) , ( byte ) ( DirectCommand . GetCurrentProgramName ) , } ; byte [ ] reply = CompleteRequest ( request ) ; string filename = Encoding . ASCII . GetString ( reply , 3 , 20 ) . TrimEnd ( ' \0 ' ) ; return filename ; } catch ( NXTNoActiveProgram ) { return null ; } }
[Native] Gets the name of the currently running program on the NXT brick.
[ Native ] Gets the name of the currently running program on the NXT brick .
The name of the currently running program, as a string.  Null if no program running.
The name of the currently running program as a string . Null if no program running .