473,385 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

String, substrings for commands in textbox

Hi all, I have a issue, a have a textbox which takes commands, the commands can be something like:

rp73{
rp36 {av 14, td 10} ,
td 35,
cc -1 1 -2
};

I have the code below so far and cant figure out how to make a command like the one below execute.
Expand|Select|Wrap|Line Numbers
  1. if (e.KeyChar == '\r')  
  2.  
  3.              {  
  4.  
  5.                  String command = tbCommand.Text.ToLower().Trim();  
  6.  
  7.  
  8.  
  9.                  if (command.Contains("="))  
  10.  
  11.                  {  
  12.  
  13.                      String[] ch = command.Split(new char[] { '=' });  
  14.  
  15.                      ch[0] = ch[0].Trim();  
  16.   else 
  17.  
  18.                  {  
  19.  
  20.                    String[] ch = commande.Split(new char[] { ' ' });  
  21.  
  22.                    if (ch.Length == 2) 
  23.  
i give some commands in the text box then its executes the commands, something like turtle gaphics, i need to use the string format i think im really not familiar with strings. Any help pr advise thx
Nov 7 '10 #1
0 1633

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: MLH | last post by:
I'm having trouble pasting a VLS into a textbox control on FormB. FormB is open in form view. I'm trying to do it from a procedure running in FormA. I'm up against 2048-Char limits no matter how...
3
by: PC Datasheet | last post by:
I need a textbox to be set to a string of 15 Xs. Is there some expression that does something like the following pseudocode: MyTextbox = "X"(15) If there is, can it be done with a multiple...
3
by: War Eagle | last post by:
I've been looking at .substring and .trim methods and I still have a question about extracting substrings from a textbox. Basically the textbox contains the full path to a file ... for example ...
1
by: VMI | last post by:
How can I parse the string in a web textbox? In Window, the textbox.Lines property parses the string in a multi-line textbox and passes it to an array. Is this possible with the Web textbox? ...
2
by: AllcompPC | last post by:
I have a value in a text box pulled in from a dataadapter. This text might be "Black White Tan". If it is, then I want to have three other boxes and will fill with these colors. That part I know...
7
by: andym | last post by:
Dear All, I wish to have an ASP page that displays a predetermined date in the middle of a string. I wish this date to be set in a seperate control panel type page. I am hoping somebody could...
8
by: frohlinger | last post by:
Hi, I have a search textbox in my website. I validate the search string with a "white list" of allowed characters: if((/^+$/).test(theSearchWord) == false) { return; }
5
by: sagardeshmukh310 | last post by:
Sir, Following is my code Textbox tb = (TextBox)Convert.ToString(s) ; In above code i want to pass value present in the string variable 's' to the 'tb' variable but i am getting following...
6
by: uicouic | last post by:
Hi all. I need help about this particular aspect. In a webform I have an <asp:textbox> (txtName) and <asp:DropDownList> (lstSchool) with 2 values inside. I have typed in a value for the...
2
by: uicouic | last post by:
Hi all. I need help about this particular aspect. In a webform I have an <asp:textbox> (txtName) and <asp:DropDownList> (lstSchool) with 2 values inside. I have typed in a value for the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.