×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    129

    Read input from console application and save the input data in a variable

    Hi All,

    I want to take input from a console application. Is there any function like scanf available in symbian c++? or any other methods to get the input from the user in a variable.

    Any help would be great.

    Regards
    Sumeet Kumart

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Read input from console application and save the input data in a variable

    Why shold not you open SDK and check API CConsoleBase ?? Anyway CConsoleBase does not have any method like Scanf(), check CConsoleBase::Getch(), if its helpful in anyway.

  3. #3
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: Read input from console application and save the input data in a variable

    When in doubt, search :-)

    Here is one from the wiki

    http://wiki.forum.nokia.com/index.ph...e_applications
    Cheers,
    Mayank

  4. #4
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    129

    Re: Read input from console application and save the input data in a variable

    Thanks for your reply Mayank.

    But I am not able to make this code run on the emulator. My requirement is, that i want user to enter his/her phone number on the console and then save this phone number in a text file. I am able to save a hard coded number in the text file but have no success in taking input from user and then saving it.

    Can you please suggest something

    Thanks once again

  5. #5
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: Read input from console application and save the input data in a variable

    Well what is the issue/error you are facing with that link, did you maintain a class level buffer of some kind where u keep appending the key presses so that it can be saved to the file at a later point in time?
    Cheers,
    Mayank

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: Read input from console application and save the input data in a variable

    Why? What happens? Note that the Wiki example relies on a running Active Scheduler. Have you instantiated, installed and started such thing in your code?

  7. #7
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    129

    Re: Read input from console application and save the input data in a variable

    Thanks for the reply.

    Actually, i m new to the symbian c++ developmentso thats why i just copy pasted the code given in that link and tried to run it in my application but i not even able to see the console.
    Last edited by sumeet_netsmartz; 2009-06-12 at 09:08. Reason: Typos

  8. #8
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: Read input from console application and save the input data in a variable

    Create a blank console exe using New->Project->Symbian OS C++ Project->Basic Console Application, and first try to understand the workings of that plain example.

    Also enable the panic codes by http://wiki.forum.nokia.com/index.ph...ded_panic_code

    You would also do well to go through some basic beginner's stuff

    http://wiki.forum.nokia.com/index.ph..._Symbian_OS%3F

    Once you are comfortable with it then try selectively copy/pasting the code from that link shared earlier. Try debugging the code to see what is going wrong where for a better understanding.
    Cheers,
    Mayank

Similar Threads

  1. how to save form data
    By rams.vundela in forum Symbian
    Replies: 6
    Last Post: 2009-03-16, 06:39
  2. Data Store in console application
    By tiyyob in forum Symbian
    Replies: 1
    Last Post: 2008-08-26, 11:52
  3. Save data
    By bobbrink in forum Mobile Java General
    Replies: 3
    Last Post: 2007-12-12, 23:06
  4. Replies: 2
    Last Post: 2007-02-06, 15:16
  5. Replies: 1
    Last Post: 2005-05-26, 14:22

Posting Permissions

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