Category

Tools

Created by

Andreas Dreier

Name

TextEdit

Uploaded

02.11.2008

 

Download

Content of ZIP file
  TextEdit.ric     1       3 3 8
  TextEdit.nxc
  TextEdit.inc

 

Description

This tool enable you to manipulate strings by using only the 3 buttons of the NXT. The selection of the letters is split into 2 levels:

 

  1st level : Selection of a group of letters
  2nd level : Select the letter inside the selected group

 

This kind of input reduce the count of pressing the buttons on your NXT for entering a text! The text itself can be longer than 16 characters. When it's longer than only the last 16 characters of the input string will be displayed on the first line of the NXT display.

 

 

1st level: Group selection:

 

 

 

 

 

 

 

 

 

 
 

2nd level: Letter selection:

 

 

 

       

 

       

 

 

 

 

The following NXC example shows how easy you can use the TextEdit for our own programs:

 

  #include "TextEdit.inc"

task main()
{
    string text;

    text = "Hello";

    // Modify text without staying in the letter group
    text = TextEdit( text, LEAVE_GROUP );
    TextOut( 0,0, text, TRUE );
    Wait( 5000 );

    // Modify text with staying in the letter group
    text = TextEdit( text, STAY_GROUP );
    TextOut( 0,0, text, TRUE);
    Wait( 5000 );
}