Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How do I pass user inputted data from TEdit box to string variable?

I downloaded Delphi 6 and the manuals have such complicated examples.
nothing simple - like passing data from one of their pre-written routines to a variable.

I'v been looking through their PDF manuals for a week and am not getting anywhere!!!

I have my program layout already made but nothing functions because I can't pass data.

Can anyone help?

Needed info:

Get data from TEdit box
Get data from Radio button (not mouse clicks but status...like ON or OFF)
Get data from check box (status)
Send string data to a RichEdit box.

Mr. Universal IP

Comments

  • zibadianzibadian Member Posts: 6,349
    : I downloaded Delphi 6 and the manuals have such complicated examples.
    : nothing simple - like passing data from one of their pre-written routines to a variable.
    :
    : I'v been looking through their PDF manuals for a week and am not getting anywhere!!!
    :
    : I have my program layout already made but nothing functions because I can't pass data.
    :
    : Can anyone help?
    :
    : Needed info:
    :
    : Get data from TEdit box
    : Get data from Radio button (not mouse clicks but status...like ON or OFF)
    : Get data from check box (status)
    : Send string data to a RichEdit box.
    :
    : Mr. Universal IP
    :
    You need the key-properties for that. Here are some examples:
    TEdit (TMemo, TComboBox, TRichEdit): Text
    TRadioButton & TCheckBox: Checked
    TCheckBox: State

    Hint: To answer this kind of questions, I always look through the list of properties for likely suspects. If I think I found 1, I look into its details to see if I thought right. Personally I never read a manual, unless I cannot find the answer in the help-files. It also helps to know the heirarchy-tree a little: For instance, the TRichEdit is a descendant from T(Custom)Edit, which holds the complete text in the Text property, thus it makes sense that TRichEdit also has a Text property.
  • cycordcycord Member Posts: 148
    : : Get data from TEdit box
    : : Get data from Radio button (not mouse clicks but status...like ON or OFF)
    : : Get data from check box (status)
    : : Send string data to a RichEdit box.
    : :
    on the TEdit box when passing into a variable , in the even tab properties you can find one property the OnChange inside the OnChange var1 := Edit1.text; anything you type will be put on the var1 variable, in the radio botton, on the OnClick property , if Checked = true then....add the rest;
  • mruniversalipmruniversalip Member Posts: 22
    : : : Get data from TEdit box
    : : : Get data from Radio button (not mouse clicks but status...like ON or OFF)
    : : : Get data from check box (status)
    : : : Send string data to a RichEdit box.
    : : :
    : on the TEdit box when passing into a variable , in the even tab properties you can find one property the OnChange inside the OnChange var1 := Edit1.text; anything you type will be put on the var1 variable, in the radio botton, on the OnClick property , if Checked = true then....add the rest;
    :


    Thanks, both of you, for answering...

    I happened accross the solution when I looked at some code on a completely un-related topic... so here is what I figured out incase anyone else needs to know...

    Always call the routine you want the data from followed by the variable. TEdit1 is the routine and so TEdit1.Text is what it stores its text stuff in.

    (I still can't find a decent reference in the PDF manuals about variables for each routine. But each appears to correspond to a name usually on the properties bar in the object inspector.)(anyone have a good reference?)

    how it seems to look...
    all of your own custom procedures must be declaired in the same "type" area to use any routine or variables belonging to that "type". all of your custom routins must begin with the name referenced just after the "type"
    designation in order to use the declared procedures in that type form.

    eg.

    type
    TMyForm = class(TForm)

    procedure TMyForm.Myroutine
    ...


    DATA checking and passing examples...

    e.g.
    //TEdit
    //store typed stuff
    UserTyped := TEdit1.Text

    //send typed stuff to a RichEdit Box
    RichEdit1.Text := UserTyped

    //Check box
    If CheckBox1.Checked = true then
    IsCheckboxChecked := 'yes'
    //or what ever ya want
    else
    IsCheckboxChecked := 'no';

    //spin edit
    //convert spinedit value to text...
    MySpinValueString := IntToStr(SpinEdit.Value);

    Now all I need to figure out is how to get a program to start up another external program like Internet Explorer.

    any ideas?

  • zibadianzibadian Member Posts: 6,349
    : : : : Get data from TEdit box
    : : : : Get data from Radio button (not mouse clicks but status...like ON or OFF)
    : : : : Get data from check box (status)
    : : : : Send string data to a RichEdit box.
    : : : :
    : : on the TEdit box when passing into a variable , in the even tab properties you can find one property the OnChange inside the OnChange var1 := Edit1.text; anything you type will be put on the var1 variable, in the radio botton, on the OnClick property , if Checked = true then....add the rest;
    : :
    :
    :
    : Thanks, both of you, for answering...
    :
    : I happened accross the solution when I looked at some code on a completely un-related topic... so here is what I figured out incase anyone else needs to know...
    :
    : Always call the routine you want the data from followed by the variable. TEdit1 is the routine and so TEdit1.Text is what it stores its text stuff in.
    :
    : (I still can't find a decent reference in the PDF manuals about variables for each routine. But each appears to correspond to a name usually on the properties bar in the object inspector.)(anyone have a good reference?)
    :
    : how it seems to look...
    : all of your own custom procedures must be declaired in the same "type" area to use any routine or variables belonging to that "type". all of your custom routins must begin with the name referenced just after the "type"
    : designation in order to use the declared procedures in that type form.
    :
    : eg.
    :
    : type
    : TMyForm = class(TForm)
    :
    : procedure TMyForm.Myroutine
    : ...
    :
    :
    : DATA checking and passing examples...
    :
    : e.g.
    : //TEdit
    : //store typed stuff
    : UserTyped := TEdit1.Text
    :
    : //send typed stuff to a RichEdit Box
    : RichEdit1.Text := UserTyped
    :
    : //Check box
    : If CheckBox1.Checked = true then
    : IsCheckboxChecked := 'yes'
    : //or what ever ya want
    : else
    : IsCheckboxChecked := 'no';
    :
    : //spin edit
    : //convert spinedit value to text...
    : MySpinValueString := IntToStr(SpinEdit.Value);
    :
    : Now all I need to figure out is how to get a program to start up another external program like Internet Explorer.
    :
    : any ideas?
    :
    :
    First of all TEdit isn't a routine, but a class. There is a HUGE difference between a routine and a class.
    A very good reference is the Delphi Developer's Guide by Teixeira & Pacheco. The standard delphi help files have helped me tremendously in learning delphi myself (in fact I learned delphi from the examples and the help files).
    Also I haven't got the faintest idea what you mean with those codes. Opening an external program is easy: ShellExecute(). Here is a simple example:
    [code]
    unit Unit1;

    interface

    uses
    Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
    StdCtrls, ShellApi;

    type
    TForm1 = class(TForm)
    Edit1: TEdit;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    private
    { Private declarations }
    public
    { Public declarations }
    end;

    var
    Form1: TForm1;

    implementation

    {$R *.DFM}

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    ShellExecute(Handle,nil,PChar(Edit1.Text),nil,nil,SW_Show);
    end;

    end.
    [/code]
    This opens any file, which the user types in the TEdit.
  • mruniversalipmruniversalip Member Posts: 22
    : : : : : Get data from TEdit box
    : : : : : Get data from Radio button (not mouse clicks but status...like ON or OFF)
    : : : : : Get data from check box (status)
    : : : : : Send string data to a RichEdit box.
    : : : : :
    : : : on the TEdit box when passing into a variable , in the even tab properties you can find one property the OnChange inside the OnChange var1 := Edit1.text; anything you type will be put on the var1 variable, in the radio botton, on the OnClick property , if Checked = true then....add the rest;
    : : :
    : :
    : :
    : : Thanks, both of you, for answering...
    : :
    : : I happened accross the solution when I looked at some code on a completely un-related topic... so here is what I figured out incase anyone else needs to know...
    : :
    : : Always call the routine you want the data from followed by the variable. TEdit1 is the routine and so TEdit1.Text is what it stores its text stuff in.
    : :
    : : (I still can't find a decent reference in the PDF manuals about variables for each routine. But each appears to correspond to a name usually on the properties bar in the object inspector.)(anyone have a good reference?)
    : :
    : : how it seems to look...
    : : all of your own custom procedures must be declaired in the same "type" area to use any routine or variables belonging to that "type". all of your custom routins must begin with the name referenced just after the "type"
    : : designation in order to use the declared procedures in that type form.
    : :
    : : eg.
    : :
    : : type
    : : TMyForm = class(TForm)
    : :
    : : procedure TMyForm.Myroutine
    : : ...
    : :
    : :
    : : DATA checking and passing examples...
    : :
    : : e.g.
    : : //TEdit
    : : //store typed stuff
    : : UserTyped := TEdit1.Text
    : :
    : : //send typed stuff to a RichEdit Box
    : : RichEdit1.Text := UserTyped
    : :
    : : //Check box
    : : If CheckBox1.Checked = true then
    : : IsCheckboxChecked := 'yes'
    : : //or what ever ya want
    : : else
    : : IsCheckboxChecked := 'no';
    : :
    : : //spin edit
    : : //convert spinedit value to text...
    : : MySpinValueString := IntToStr(SpinEdit.Value);
    : :
    : : Now all I need to figure out is how to get a program to start up another external program like Internet Explorer.
    : :
    : : any ideas?
    : :
    : :
    : First of all TEdit isn't a routine, but a class. There is a HUGE difference between a routine and a class.
    : A very good reference is the Delphi Developer's Guide by Teixeira & Pacheco. The standard delphi help files have helped me tremendously in learning delphi myself (in fact I learned delphi from the examples and the help files).
    : Also I haven't got the faintest idea what you mean with those codes. Opening an external program is easy: ShellExecute(). Here is a simple example:
    : [code]
    : unit Unit1;
    :
    : interface
    :
    : uses
    : Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
    : StdCtrls, ShellApi;
    :
    : type
    : TForm1 = class(TForm)
    : Edit1: TEdit;
    : Button1: TButton;
    : procedure Button1Click(Sender: TObject);
    : private
    : { Private declarations }
    : public
    : { Public declarations }
    : end;
    :
    : var
    : Form1: TForm1;
    :
    : implementation
    :
    : {$R *.DFM}
    :
    : procedure TForm1.Button1Click(Sender: TObject);
    : begin
    : ShellExecute(Handle,nil,PChar(Edit1.Text),nil,nil,SW_Show);
    : end;
    :
    : end.
    : [/code]
    : This opens any file, which the user types in the TEdit.
    :

    Hey... The last time I wrote a program it was in QuickBasic 4.5 and Turbo Assembler 2.0. Their all routines to me :-) they can call 'em by whatever name they want its all code to me. :-)

    Thanks for the Shell Execute... I haven't done Windows programming before. Delphi is cool... I've already almost finnished my first program in it. I don't like the manuals though. They need to be more people oriented (it's good in spots and not in others. Like 20 different people wrote it...not consistant). The help file is a bit better(not as easy to get around in as it should be).

    I'll have to find a good book somewhere. :-)


  • zibadianzibadian Member Posts: 6,349
    : : : : : : Get data from TEdit box
    : : : : : : Get data from Radio button (not mouse clicks but status...like ON or OFF)
    : : : : : : Get data from check box (status)
    : : : : : : Send string data to a RichEdit box.
    : : : : : :
    : : : : on the TEdit box when passing into a variable , in the even tab properties you can find one property the OnChange inside the OnChange var1 := Edit1.text; anything you type will be put on the var1 variable, in the radio botton, on the OnClick property , if Checked = true then....add the rest;
    : : : :
    : : :
    : : :
    : : : Thanks, both of you, for answering...
    : : :
    : : : I happened accross the solution when I looked at some code on a completely un-related topic... so here is what I figured out incase anyone else needs to know...
    : : :
    : : : Always call the routine you want the data from followed by the variable. TEdit1 is the routine and so TEdit1.Text is what it stores its text stuff in.
    : : :
    : : : (I still can't find a decent reference in the PDF manuals about variables for each routine. But each appears to correspond to a name usually on the properties bar in the object inspector.)(anyone have a good reference?)
    : : :
    : : : how it seems to look...
    : : : all of your own custom procedures must be declaired in the same "type" area to use any routine or variables belonging to that "type". all of your custom routins must begin with the name referenced just after the "type"
    : : : designation in order to use the declared procedures in that type form.
    : : :
    : : : eg.
    : : :
    : : : type
    : : : TMyForm = class(TForm)
    : : :
    : : : procedure TMyForm.Myroutine
    : : : ...
    : : :
    : : :
    : : : DATA checking and passing examples...
    : : :
    : : : e.g.
    : : : //TEdit
    : : : //store typed stuff
    : : : UserTyped := TEdit1.Text
    : : :
    : : : //send typed stuff to a RichEdit Box
    : : : RichEdit1.Text := UserTyped
    : : :
    : : : //Check box
    : : : If CheckBox1.Checked = true then
    : : : IsCheckboxChecked := 'yes'
    : : : //or what ever ya want
    : : : else
    : : : IsCheckboxChecked := 'no';
    : : :
    : : : //spin edit
    : : : //convert spinedit value to text...
    : : : MySpinValueString := IntToStr(SpinEdit.Value);
    : : :
    : : : Now all I need to figure out is how to get a program to start up another external program like Internet Explorer.
    : : :
    : : : any ideas?
    : : :
    : : :
    : : First of all TEdit isn't a routine, but a class. There is a HUGE difference between a routine and a class.
    : : A very good reference is the Delphi Developer's Guide by Teixeira & Pacheco. The standard delphi help files have helped me tremendously in learning delphi myself (in fact I learned delphi from the examples and the help files).
    : : Also I haven't got the faintest idea what you mean with those codes. Opening an external program is easy: ShellExecute(). Here is a simple example:
    : : [code]
    : : unit Unit1;
    : :
    : : interface
    : :
    : : uses
    : : Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
    : : StdCtrls, ShellApi;
    : :
    : : type
    : : TForm1 = class(TForm)
    : : Edit1: TEdit;
    : : Button1: TButton;
    : : procedure Button1Click(Sender: TObject);
    : : private
    : : { Private declarations }
    : : public
    : : { Public declarations }
    : : end;
    : :
    : : var
    : : Form1: TForm1;
    : :
    : : implementation
    : :
    : : {$R *.DFM}
    : :
    : : procedure TForm1.Button1Click(Sender: TObject);
    : : begin
    : : ShellExecute(Handle,nil,PChar(Edit1.Text),nil,nil,SW_Show);
    : : end;
    : :
    : : end.
    : : [/code]
    : : This opens any file, which the user types in the TEdit.
    : :
    :
    : Hey... The last time I wrote a program it was in QuickBasic 4.5 and Turbo Assembler 2.0. Their all routines to me :-) they can call 'em by whatever name they want its all code to me. :-)
    :
    : Thanks for the Shell Execute... I haven't done Windows programming before. Delphi is cool... I've already almost finnished my first program in it. I don't like the manuals though. They need to be more people oriented (it's good in spots and not in others. Like 20 different people wrote it...not consistant). The help file is a bit better(not as easy to get around in as it should be).
    :
    : I'll have to find a good book somewhere. :-)
    :
    :
    :
    A class holds more than code alone. It also has properties, which are very similar to variables. Also a class is a variable type (like string or integer), but then much more complicated.
    In delphi the word "routine" is used in reference to a piece of code, like a bubble-sort routine. Simple code like ShellExecute() are called procedures or functions, depending if they return a result. Nearly everything else is a class.
    The book I mentioned is one of the best I have ever seen. It takes you from the most basic of stuff (naming conventions), all the way through to very advanced things (additions to the windows shell). It comes with a CD-ROM (at least D4 developer's guide was), with very simple examples to very difficult examples.
  • mruniversalipmruniversalip Member Posts: 22
    : A class holds more than code alone. It also has properties, which are very similar to variables. Also a class is a variable type (like string or integer), but then much more complicated.
    : In delphi the word "routine" is used in reference to a piece of code, like a bubble-sort routine. Simple code like ShellExecute() are called procedures or functions, depending if they return a result. Nearly everything else is a class.
    : The book I mentioned is one of the best I have ever seen. It takes you from the most basic of stuff (naming conventions), all the way through to very advanced things (additions to the windows shell). It comes with a CD-ROM (at least D4 developer's guide was), with very simple examples to very difficult examples.
    :

    Cool..
    I'll have to find a store that sells programming books or a place on the net.

    (Juno just sent me an ad for a book club... buy 3 books for $9.99 then buy 3 more within 2 years at reg price. The books for the $9.99 were exactly what I was looking for - Upgrading & repairing PCs exc. - I repair computers. They have programming books too. Interesting coinsidence... or maybee just clever web tracking :-) . Free Internet access... go fig.)

Sign In or Register to comment.