C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming
The ASP Free website provides in-depth information on the latest developer tools available from Microsoft. Our cadre of writers, highly experienced industry experts, reveals the best ways to use established technologies as well as new and emerging technologies. Our coverage of Microsoft's development and administration technologies is among the most respected in the IT industry today.

ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!
Download and Activate to enter!

Intel® Graphics Performance Analyzers is a powerful tool suite for analyzing and optimizing your games, media, and graphics-intensive applications. Used by some of the best developers on the planet, Intel GPA lets you maximize your app’s performance.


Tutorials
| Forums

Download to Enter
| Contest Rules

DOWNLOAD INTEL® GPA FOR FREE

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 11th, 2004, 05:04 AM
MaKLeR MaKLeR is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 9 MaKLeR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Text editor in C

Hello. I need a simple console text editor written in C. It's very important to me... and very urgent. Please help me.
Lucas

Reply With Quote
  #2  
Old June 11th, 2004, 06:00 AM
macar macar is offline
Maciej Ignacy Arciuch
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: Warsaw, Poland
Posts: 56 macar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 25 sec
Reputation Power: 8
Send a message via ICQ to macar
Hi!

You need an editor or you have to write one?? If you want a simple text editor written in C, just grab pico, nano or something like that. If you're the one to write it, just try doing it and post here again when you have coding problems.

Matthew

Reply With Quote
  #3  
Old June 11th, 2004, 07:07 AM
MaKLeR MaKLeR is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 9 MaKLeR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
macar: I need to write one, but I have no ida how to do this. I'm just a begginner but I need this text editor's source very much...
P.S. Sorry for my english...

Reply With Quote
  #4  
Old June 11th, 2004, 07:28 AM
DaWei_M's Avatar
DaWei_M DaWei_M is offline
Renaissance Redneck
Dev Shed God 7th Plane (8000 - 8499 posts)
 
Join Date: Jan 2004
Location: Central New York. Texan via Arizona, out of his element!
Posts: 8,472 DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level) 
Time spent in forums: 4 Weeks 6 h 37 m 17 sec
Warnings Level: 20
Number of bans: 3
Reputation Power: 3242
The thing is, we don't generally serve as a free-code-on-demand software store. Being cruel creatures, we extract our price in sweat and anguish by normally making the requestor produce some code with which we then offer help. Particularly in those cases where the product is the person's homework or job.
__________________
Functionality rules and clarity matters; if you can work a little elegance in there, you're stylin'.
If you can't spell "u", "ur", and "ne1", why would I hire you? 300 baud modem? Forget I mentioned it.
DaWei on Pointers Politically Incorrect.

Reply With Quote
  #5  
Old June 11th, 2004, 07:29 AM
macar macar is offline
Maciej Ignacy Arciuch
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: Warsaw, Poland
Posts: 56 macar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 25 sec
Reputation Power: 8
Send a message via ICQ to macar
Ok, first tell us what operating system are you using. Console operations are quite OS-dependant...

M.

Reply With Quote
  #6  
Old June 11th, 2004, 07:44 AM
MaKLeR MaKLeR is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 9 MaKLeR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
DaWei_M: I don't know if I understood correctly, but I realy need this editor just to get graduate (sorry again for my english)
I could help other people in their problems in matlab or other languages, but I definitely don't know anything about C.

Macar: It's DOS or Linux - one of those.
Sorry for problems caused by my request, but You are my last chance...

Reply With Quote
  #7  
Old June 11th, 2004, 07:51 AM
DaWei_M's Avatar
DaWei_M DaWei_M is offline
Renaissance Redneck
Dev Shed God 7th Plane (8000 - 8499 posts)
 
Join Date: Jan 2004
Location: Central New York. Texan via Arizona, out of his element!
Posts: 8,472 DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level) 
Time spent in forums: 4 Weeks 6 h 37 m 17 sec
Warnings Level: 20
Number of bans: 3
Reputation Power: 3242
What kind of school requires a knowledge of C to graduate but doesn't teach C?

Reply With Quote
  #8  
Old June 11th, 2004, 08:32 AM
macar macar is offline
Maciej Ignacy Arciuch
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: Warsaw, Poland
Posts: 56 macar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 25 sec
Reputation Power: 8
Send a message via ICQ to macar
Quote:
Originally Posted by MaKLeR
Macar: It's DOS or Linux - one of those.


Well, make up your mind before you start the work!

As regards DOS, I know nothing (expept one useful function called gotoxy()...).

As regards Linux, look for a Ncurses tutorial - Ncurses is a widget set, but unlike GTK+ and Qt it works on console. This will be helpful in designing the interface for your editor.

Also, download source code of a simple text editor and try to analyse it. I might prove very helpful, although sometimes very difficult .

Hope this helps,
Matthew

Reply With Quote
  #9  
Old June 11th, 2004, 08:50 AM
MaKLeR MaKLeR is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 9 MaKLeR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm just trying to analize the JOE's Editor - and it's too difficult to me. I just want something like joe, but I want it to be simple to write... I mean it doesn't have to be so much functions...

Reply With Quote
  #10  
Old June 11th, 2004, 05:32 PM
bergner bergner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 144 bergner User rank is Private First Class (20 - 50 Reputation Level)bergner User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 h 48 m 6 sec
Reputation Power: 8
Writing a working editor is never easy

No matter which platform you choose an editor is a hard task. It will probably require a couple of thousand lines of well structured code to have an editor that can be reasonably usable. I think you should check out exactly what you are expected to do. I seriously doubt that you have to write a fully fledged editor.

If you have a lot of freedom on what platform, operating system and you have access to Visual Studio at school you could always write a simple notepad look-alike in MSVC++ or MSVB. Writing a editor from scratch is not for the faint of heart.

Reply With Quote
  #11  
Old June 11th, 2004, 09:39 PM
MaKLeR MaKLeR is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 9 MaKLeR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This text editor is too much for me. I'll try to write simple code which should be written in C (console programme which may be compiled under linux - using gcc compiler), should get text from keyboard (let's say 2000 charakters) and after each line of text should print this line and ask if it's ok or not.
If ok - then write it to file (name of file as a parameter of programme) and continue with next line of text.
If not ok - than read the line of text again...
If nothing promped in (I mean "enter") - should end.
I still don't know how to do this... Can anyone help me with this task?
I know I mess too much on this forum and cause problems - sorry for that but I count on Yours unerstanding.

Reply With Quote
  #12  
Old June 11th, 2004, 10:29 PM
super_serge super_serge is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 136 super_serge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Think how you would do it if you were to use your memory or a piece of paper as a file. First you would get the information into your brain (hint: scanf() or gets()). Then, you would see if the maximum line width (80) has been reached. Then, if the user presses enter (ascii 10, if im not mistaken), save the line to file. After, repeat the whole thing over again until only an enter is entered.

Reply With Quote
  #13  
Old June 11th, 2004, 10:30 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
Posts: 8,978 Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 39th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 6 Days 22 h 11 m 29 sec
Reputation Power: 3561
Probably easiest to write code for Windows or X-Windows environment (using Kylix/C++ Builder). You can easily bang out a Notepad clone (or better) in less than 1/2 hour. As for writing a text editor in DOS, you might want to look around for the right tools -- Borland used to supply a library called Turbo Vision that may have had a text editor class built in. Then again, these are in C++, not C.

I did write a text editor in C a long time ago. However, that was using Turbo C 1.5 and I don't have that code on me right now.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Diary of a first time dog owner <-- my cousin's blog

Reply With Quote
  #14  
Old June 11th, 2004, 10:58 PM
MaKLeR MaKLeR is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 9 MaKLeR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
super_serge: Exactly - i know how to write headers, how to get started with the main function, how to scan string, but I don't know nothing about file operations. I don't know how to write string to file (I mean something like ">>" in linux's bash) and how to pass the argument (the name of file to write text to) to the main function. I'm total lame...

Reply With Quote
  #15  
Old June 11th, 2004, 11:23 PM
DaWei_M's Avatar
DaWei_M DaWei_M is offline
Renaissance Redneck
Dev Shed God 7th Plane (8000 - 8499 posts)
 
Join Date: Jan 2004
Location: Central New York. Texan via Arizona, out of his element!
Posts: 8,472 DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level) 
Time spent in forums: 4 Weeks 6 h 37 m 17 sec
Warnings Level: 20
Number of bans: 3
Reputation Power: 3242
You say that it is very important and urgent that you have a simple text editor, and that YOU need to write it. Your frustration at your inability to do so is quite palpable. I have the feeling you need this to show that you are qualified for something, say a job. You should think very carefully about that, should it be the case, for it would be a short and unhappy stint for all concerned. If I'm wide of the mark, I apologize; if I'm not, you really do need to hear it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Text editor in C


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 6 - Follow our Sitemap