Text Programs

This is a discussion on Text Programs within the C Programming forums, part of the General Programming Boards category; How would I go about making it where they type in something (I know how to make them type things..) ...

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    70

    Text Programs

    How would I go about making it where they type in something
    (I know how to make them type things..) and then save like the entire file? like say
    blah blah blah
    then after so many lines or a certain key word is typed it askes
    'Do you want to save?'

  2. #2
    Registered User Draco's Avatar
    Join Date
    Apr 2002
    Posts
    463
    Well I don't know how to specifically save to other files, but you could make a loop that gets characters then turns each word into a seperate string (it would check for if getch()=\r). I believe you could then use strcmp() on the string to check for your desired word.

  3. #3
    Registered User Draco's Avatar
    Join Date
    Apr 2002
    Posts
    463
    just a correction for above: it would probably do you a lot more good to check for if the space bar has been pressed than the return key (although checking for both might be good).

  4. #4
    Registered User
    Join Date
    Nov 2001
    Posts
    70
    What I mean is like edit.com you know only so basic you type and then press say alt s and alt l for save/load.

  5. #5
    Registered User Draco's Avatar
    Join Date
    Apr 2002
    Posts
    463
    do you mean something like getch(), then save if( getch() = 'S'); ?

  6. #6
    Registered User
    Join Date
    Nov 2001
    Posts
    70
    Yea something like that I don't totaly get the whole fprint and stuff so it will be hard to write a prorgam that does that though

  7. #7
    Registered User Draco's Avatar
    Join Date
    Apr 2002
    Posts
    463
    I don't either . I'm sure you can find some place that explains it, like off of www.google.com.

  8. #8
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    > How would I go about making it where they type in something
    Several ways.

    > (I know how to make them type things..)
    That'll be useful for your assumed implimentation.

    > and then save like the entire file?
    The one that magically appeared?
    Or, the one you previously created, with their specified filename?

    > like say blah blah blah then after so many lines or a certain key word is typed it askes
    There's a better way.

    > 'Do you want to save?'
    Same as above.

    > What I mean is like edit.com you know only so basic you type and then press say alt s and alt l for save/load.
    Which way are we going to do this now?

    > I don't totaly get the whole fprint and stuff
    Maybe you should totaly get the basics before tackling a text editor, and stuff.
    The world is waiting. I must leave you now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DirectX | Drawing text
    By gavra in forum Game Programming
    Replies: 4
    Last Post: 06-08-2009, 12:23 AM
  2. Text positioning and Text scrolling
    By RealityFusion in forum C++ Programming
    Replies: 3
    Last Post: 08-13-2004, 12:35 AM
  3. Scrolling The Text
    By GaPe in forum C Programming
    Replies: 3
    Last Post: 07-14-2002, 04:33 PM
  4. Replies: 1
    Last Post: 07-13-2002, 05:45 PM
  5. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 09:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21