Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 5 of 5

Thread: Command help

  1. #1
    Join Date
    Aug 2008
    Posts
    20

    Command help

    I making a project that includes giving commands
    There are 2 inputs
    I wanna make it when someone enters a unknown command it will show
    Unknown Command at Input1
    Code:
    Code:
    if(e_Key==13)then
    	sCommand=Input.GetText(this);
    	sCommand=String.Replace(sCommand, "\r\n", "", false);
    	if(sCommand=="minimize")then
    	Input.SetText("Input1", "The program will now minimize");
    	Application.Minimize();
    	Input.SetText("Input2", "");
    	end
    	end
    Input2 is the place where u write commands and Input1 is the place where it shows the text like this for ex: The program will now minimize or what ever.
    Thanks in advance.

  2. #2
    Join Date
    Jun 2007
    Location
    Delphi II
    Posts
    1,534
    Could you please upload your project (apz) file so we forum browsers can open it for ourselves?

    (Goto File -> Export to get the project archive file)

    Thanks,
    CS.

  3. #3
    Join Date
    Aug 2008
    Posts
    20
    Here it is:
    Attached Files

  4. #4
    Join Date
    Jun 2007
    Location
    Delphi II
    Posts
    1,534

    Post Solution

    Ok, so here's what I came up with. Basic, but I think that it's what you're looking for. I didn't comment the code but it's all pretty self-explanatory.

    You'll find the new code on the On Preload section and in your Input2 object.

    BTW, I taught myself to program and as such have not had the benefit of proper training. That said, I have never heard of "this" until I was looking at your project. Thanks much, that is a powerful command. I lived without it but I see that it was not easy now that I know what "this" can do.

    I would recommend trying to put your command list into an xml file so the user can add custom commands and your program can be easily updated.

    Oh, and hide that button at runtime...unless you like the color .
    Last edited by Centauri Soldier; 10-18-2008 at 12:58 PM.

  5. #5
    Join Date
    Jun 2007
    Location
    Delphi II
    Posts
    1,534

    Oops

    forgot the file...
    Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts