Jump to content

Windows Notepad: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Line 41: Line 41:


This issue has been resolved in [[Windows Vista]] version of Notepad.
This issue has been resolved in [[Windows Vista]] version of Notepad.

/******************************************************************************
* Filename:2-DArraysAsArguments.c
* Description: To understand how to pass 2-D arrays as arguments
* Author: E&R department, Infosys Technologies Ltd.
* Date: 6-Mar-2009
******************************************************************************/

#include<stdio.h>
#include<stdlib.h>


/* Declare the prototypes of the functions */
double fnCustFeedbackAverage(int aiEmpCustFeedbackTemp[][4],
float afAvgFeedbackTemp[]);

/*****************************************************************************
* Function:main()
* Description: To accept details of an employee and to
* update the basic salary of an employee by invoking
* functions
* Input Parameters:
* int argc-Number of command line arguments
* char **argv-The command line arguments passed
* Retuns: 0 on success to the operating system
*****************************************************************************/

int main(int argc, char** argv){
/*Declaration of 2-D arrays . Since ther are 2 emloyees and 3
customers,row size is 2 & col size is 4*/

int aiEmpCustFeedback[2][4]={71005,7,8,10,71006,5,5,7};

float afAvgFeedback[2];
int iCount,iCount1;
/* Call the function to find the average feedback and it
must be stored in afAvgFeedback[] array */
fnCustFeedbackAverage(aiEmpCustFeedback,afAvgFeedback);


/* Print the details */
printf("Empid\tFeedback1\tFeedback2\tFeedback3\tAverage Feedback\n");
printf("-----\t---------\t---------\t---------\t----------------\n");
for(iCount1=0;iCount1<=1;iCount1++)
{
for(iCount=0;iCount<=3;iCount++)
{
printf("%d\t\t",aiEmpCustFeedback[iCount1][iCount]);
}printf("\t%f",afAvgFeedback[iCount1] );
printf("\n");
}
return 0;
}

/*****************************************************************************
* Function:fnCustFeedbackAverage()
* Description: To calculate the average customer feeedback
* Input Parameters:
* aiEmpCustFeedbackTemp[][4]- customer feedback
* afAvgFeedbackTemp[]-Average cutomer feedback
* Returns: none
*****************************************************************************/
double fnCustFeedbackAverage(int aiEmpCustFeedbackTemp[][4],
float afAvgFeedbackTemp[])
{
int iCount1;

for(iCount1=0;iCount1<=1;iCount1++)
{
afAvgFeedbackTemp[iCount1]=((aiEmpCustFeedbackTemp[0][1]+\
aiEmpCustFeedbackTemp[0][2]+\
aiEmpCustFeedbackTemp[0][3])/3.0f);
}
return afAvgFeedbackTemp[iCount1];
}

/**************************************************************************
* End of 2-DArraysAsArguments.c
**************************************************************************/


== Competing software ==
== Competing software ==

Revision as of 16:36, 8 March 2009

Template:Infobox Windows component

Notepad is a simple text editor included in all versions of Microsoft Windows since Windows 1.0 in 1985.

Overview

Notepad is a common text-only (also referred to as plain text) editor. The resulting files – typically saved with the .txt extension – have no format tags or styles, making the program suitable for editing system files that are to be used in a DOS environment.

One notable feature of Notepad is that it does not support formatting of any kind - if text/rich text is copied from a web page and pasted into a word processor, the formatting and embedded metadata comes along with the text, and can be difficult to remove. However, if text is copied from a formatted web site, pasted into Notepad, then copied again from Notepad before being pasted into a destination program, Notepad will have stripped all of the formatting. An alternative of this use is, however, provided in many word processors through the possibility to paste unformatted text, which may be easier to use with a little initial effort.[1]

As an interesting aside, Notepad does support both left-to-right and right-to-left based languages, and one can alternate between these viewing formats by pressing and releasing the arrow key followed by Ctrl+Shift, using the right or left arrow and shift keys to go to right-to-left format or left-to-right format, respectively.

Notepad can edit files of almost any format; however, it does not treat Unix- or Mac-style text files correctly (see newline). Wordpad however does.

Early versions of Notepad offered only the most basic functions, such as finding text. Newer versions of Windows include an updated version of Notepad with a search and replace function (Ctrl + H), as well as Ctrl + F for search and similar keyboard shortcuts. In older versions such as those included with Windows 95, Windows 98, Windows Me and Windows 3.1, there is a 64k limit on the size of the file being edited, an operating system limit of the EDIT class.

Up to Windows 95, Fixedsys was the only available font for Notepad. Windows NT 4.0 and 98 introduced the ability to change this font. In Windows 2000 and XP the default font was changed to Lucida Console.

Up to Windows Me, there were almost no keyboard shortcuts and no line-counting feature. Starting with Windows 2000, shortcuts for common tasks like new, open and save were added, as well as a status-bar with a line counter (available only when word-wrap is disabled).

In the Windows NT-based versions of Windows, Notepad can edit traditional 8-bit text files as well as Unicode text files (both UTF-8 and UTF-16, and in case of UTF-16, both little-endian and big-endian; see Endianness.)

Notepad makes use of a built-in window class named "EDIT".

Notepad also has a built-in simple logging function, which simply inserts a new timestamp each time the file is opened. To activate this feature, the first line of the text file must be “.LOG”, without the quotes.[2][3]

Notepad may be used as a text-based HTML editor for its pure simplicity and more control over WYSIWYG editors. However, because it lacks many features, such as syntax highlighting, web developers may favor more specialized editors for this purpose (see List of text editors).

Unicode detection

The Windows NT version of Notepad, installed by default on Windows 2000 and Windows XP, has the ability to detect Unicode files even when they are missing a byte order mark. To do this, it utilizes a Windows API function called IsTextUnicode()[4][5]. However, this function is imperfect, incorrectly identifying some all-lowercase ASCII text as UTF-16. As a result, Notepad interprets a file containing a phrase like "aaaa aaa aaa aaaaa" as two-byte Unicode text file and attempts to display it as such. If a font with support for Chinese is installed, Chinese characters are displayed.

A few people misinterpreted this issue for an easter egg.[citation needed] Many phrases which fit the pattern (including "this app can break" and "Bush hid the facts") appeared on the web as hoaxes. Experts correctly attributed it to the Unicode detection algorithm.[citation needed]

This issue has been resolved in Windows Vista version of Notepad.

Competing software

Notepad does not require a lock on the file it opens, so it can open files already opened by other processes, users or computers, whereas WordPad cannot. Also, since Notepad lacks advanced formatting functionality, many people find its simple interface faster and easier to use for basic text operations. The DOS EDIT text editor, especially as updated in Windows 95, where it became an MDI application, also provides many features never offered by Notepad.

There are many third-party replacements for Notepad with additional functionality, including both free software (e.g. Notepad++ and Notepad2) and freeware (e.g. TED Notepad).

Notepad lacks many features available in other text editors, such as regular expressions, macros, block-select, and MDI.

See also

References

External links