How to convert from string to integer?

Discussion in 'ASP .Net' started by Allen Maki, May 1, 2007.

  1. Allen Maki

    Allen Maki Guest

    I am working with MS Visual C++ .net 2003.

    With your help, thank you, I am able to take data from the user through a
    text box of a form and show the information on label of another form. But I
    discovered that the data that I collected was not in such a format by which
    I can do simple arithmetic operations on them. I want to be able to
    manipulate the collected data arithmetically such as adding and multiplying
    them. I would be please if someone can help converting this code in a way
    that I can be able to manipulate the the collected data arithmetically. In
    other words, I would like to have the date in int or double, instead of
    string.



    Below are snip shots of two classes. Form1 and ResultOut. From the first
    class I show the event handler and from the second class I show the
    property.





    //Form1 :- Form1.h:



    public __gc class Form1 : public System::Windows::Forms::Form

    {

    ..

    ..

    ..

    ..



    private: System::Void OKBtn_Click(System::Object * sender,
    System::EventArgs * e)

    {

    //Create dialog

    ResultOut* box = new ResultOut();



    //Fill fill in data



    box->Result = Form1::NumInBox->Text;



    //Show dialog

    if (box->ShowDialog() == DialogResult::OK)

    {

    box->Result; //get is used

    }





    };



    //Form2:- ResultOut.h:



    public __gc class ResultOut : public System::Windows::Forms::Form

    {

    ..

    ..

    ..

    ..

    ..

    ..



    public:

    __property void set_Result(String* n){resultOutLbl->Text = n;}

    __property String* get_Result(){return resultOutLbl->Text;}



    };
     
    Allen Maki, May 1, 2007
    #1
    1. Advertising

  2. Allen Maki

    Mark Rae Guest

    "Allen Maki" <> wrote in message
    news:sDzZh.2508$...

    > I am working with MS Visual C++ .net 2003.



    In which case, you're posting in the wrong group - this group is for C#...
     
    Mark Rae, May 1, 2007
    #2
    1. Advertising

  3. Allen Maki

    Aidy Guest

    > In which case, you're posting in the wrong group - this group is for C#...

    Is it? I thought it was for asp.net ;)
     
    Aidy, May 1, 2007
    #3
  4. Allen Maki

    Mark Rae Guest

    "Aidy" <> wrote in message
    news:...

    >> In which case, you're posting in the wrong group - this group is for
    >> C#...

    >
    > Is it? I thought it was for asp.net ;)


    Apologies - you're quite right.

    --
    http://www.markrae.net
     
    Mark Rae, May 1, 2007
    #4
  5. Allen Maki wrote:
    > I am working with MS Visual C++ .net 2003.
    >
    > With your help, thank you, I am able to take data from the user through a
    > text box of a form and show the information on label of another form. But I
    > discovered that the data that I collected was not in such a format by which
    > I can do simple arithmetic operations on them. I want to be able to
    > manipulate the collected data arithmetically such as adding and multiplying
    > them. I would be please if someone can help converting this code in a way
    > that I can be able to manipulate the the collected data arithmetically. In
    > other words, I would like to have the date in int or double, instead of
    > string.
    >


    The data types have Parse methods for parsing string data, like
    Int32::parse and Double::parse.

    --
    Göran Andersson
    _____
    http://www.guffa.com
     
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, May 1, 2007
    #5
  6. Allen Maki

    Allen Maki Guest

    I really do not know what is asp.net.
    Thanks Aide anyway.


    "Aidy" <> wrote in message
    news:...
    >> In which case, you're posting in the wrong group - this group is for
    >> C#...

    >
    > Is it? I thought it was for asp.net ;)
    >
     
    Allen Maki, May 2, 2007
    #6
  7. Allen Maki

    Allen Maki Guest

    Thanks, Göran Andersson, for your answer. Can you give more details?




    "Göran Andersson" <> wrote in message
    news:OgbpUX$...
    > Allen Maki wrote:
    >> I am working with MS Visual C++ .net 2003.
    >>
    >> With your help, thank you, I am able to take data from the user through a
    >> text box of a form and show the information on label of another form.
    >> But I discovered that the data that I collected was not in such a format
    >> by which I can do simple arithmetic operations on them. I want to be
    >> able to manipulate the collected data arithmetically such as adding and
    >> multiplying them. I would be please if someone can help converting this
    >> code in a way that I can be able to manipulate the the collected data
    >> arithmetically. In other words, I would like to have the date in int or
    >> double, instead of string.
    >>

    >
    > The data types have Parse methods for parsing string data, like
    > Int32::parse and Double::parse.
    >
    > --
    > Göran Andersson
    > _____
    > http://www.guffa.com
     
    Allen Maki, May 2, 2007
    #7
  8. =?ISO-8859-1?Q?G=F6ran_Andersson?=, May 2, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon Paskett

    Convert a Base32 string to Base10 integer

    Jon Paskett, Dec 18, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,119
    Nathan Sokalski
    Dec 18, 2005
  2. Azmie
    Replies:
    12
    Views:
    1,066,963
    Azmie
    Dec 30, 2003
  3. les ander
    Replies:
    4
    Views:
    887
    wes weston
    Oct 5, 2004
  4. news
    Replies:
    2
    Views:
    1,112
  5. Randy Kramer
    Replies:
    12
    Views:
    377
    Robert Klemme
    Oct 25, 2007
Loading...

Share This Page