Working with Files

The file is the basic unit of data that JWPce works with. Files contain text and formatting information, and can be stored, loaded, and manipulated in many ways.

  • Basic File Types
  • Japanese Encoding Systems
  • Changing the Current File
  • Creating a New File
  • Opening an Existing File
  • Duplicate Files
  • Common Difficulties Opening Files
  • Opening the Same File Again
  • Closing Files
  • The Exit Command
  • Saving Files
  • Backup Files
  • Temporary Files and System Failures
  • Deleting Files
  • JFC Files
  • Working with Projects

  • INDEX: Contents
  • PREV: Dictionary
  • NEXT: Printing

  • Basic File Types

    JWPce has two different classes of files. First are native word processor files (extensions .jce and .jwp).* These files can only be read by JWPce (or JWP), and they retain any formatting that you included with the file (including Page Layout settings). Second are Japanese text format files that contain text with only basic formatting. They can be used by most programs that understand Japanese text formats.**

    JWPce indicates the type of the current file on the status line.

    The following file types are supported:

    file typeextensiondescription
    Normal-JWPce.jceJWPce native file format
    Normal-JWP.jwpJWP native file format (versions 1.0-1.31)
    JFC.jfcJapanese Flash Card format
    untyped---File has not been saved so the type is not set
    ascii.txtASCII text file -- cannot contain any Japanese (import only)***
    EUC.eucExtended UNIX Code file
    Shift-JIS.sjsshift-JIS
    New-JIS.newNew JIS
    Old-JIS.oldOld JIS
    NEC-JIS.necNEC JIS
    UNICODE---UNICODE
    UTF-7.utf (.txt) UNICODE variant where non-ASCII characters are encoded as sequences of ASCII. This format does not use extended ASCII values.
    UTF-8.utf (.txt) UNICODE variant where non-ASCII characters are encoded as sequences of ASCII characters using extended ASCII codes.
    *** The only reason for using the ASCII file type is that you have a large file that you want to open (this suppresses the file type checks), allowing the file to open faster. This, however, is only a real advantage if you are opening a very large (Douglas Adams type large) file. The other case where this format can be useful is if you are loading a file and want to suppress the conversion of extended ASCII or escape characters within the file.

    What is saved with a JWPce File?

    In native file formats (.jce or .jwp), additional information is stored along with the text. The file also contains paragraph formatting and information about the page layout.

    Page layout information saved with a file includes the Margins (This File Settings only), Headers/Footers, and Summary pages from the Page Layout dialog box (Utilities/Page Layout... or Alt+L).

    Related Topics


    * For the current version of JWPce the, .jce and .jwp files are identical. Later, the .jce file type will include features not in the .jwp file type.

    ** Most, but not all Japanese text formats can be processed through programs that understand ASCII. In these cases the Japanese text will appear as garbled characters, but a Japanese program will display the Japanese correctly.


    Japanese Encoding Systems


    WARNING! The next short segment contains technical information about how Japanese text is stored in computers. If you are not interested skip this section.

    Computers almost always store English characters in a system called ASCII. Each character is assigned a code from 0 to 255, and the code is stored in a binary number referred to as a byte. Various ranges within this 256-character set have different interpretations:

    range (hex)interpretation
    00special null character (reserved)
    01-1Fcontrol characters (non-printing)
    20-7Eprintable characters
    7Fdel
    80-FFextended ASCII codes

    This encoding system allows for 94 printable characters without using the extended ASCII range, and works well for English, where there are very few characters. In Japanese, however, there are many more characters (around 7000 kana and kanji are supported by JWPce), and such a storage system can not be used. Early computers did not support Japanese at all, and the first systems for Japanese were designed to be compatible with existing English-based systems. This compatibility allows e-mail routing computers, printer software, and a host of other applications to process files containing Japanese without having to know anything about Japanese.

    The major encoding systems are JIS (Japanese Industrial Standard), EUC (Extended UNIX code), shift-JIS and UNICODE. (UTF-7 and UTF-8 are variations of the UNICODE system.) The following section discusses each encoding system:

    Related Topics


    Changing the Current File

    Your open files can be viewed as a stack of papers. You are working on the top paper and since it is on top of the stack, it covers the lower papers and is the only one you can see (SWMD interface). There are a number of ways to change the file you are working on.

    You can treat all the open files as a cyclical list. You can move from the current file to the next or previous file in the list, using the menu commands Window/Next File or Window/Previous File, or the keyboard commands:

    actionkeyboard command
    next fileCtrl+Tab or Ctrl+PageUp
    previous fileShift+Tab or Ctrl+PageDown

    The nine files closest to the top of the stack are shown in the bottom section of the Window menu. You can select the file you want to change to directly from the menu. The top file in the list is always the current file.

    If there are more than nine open files, and you want a file not shown in the Window menu, or you just like this method, you can choose the Window/Files... menu command (Alt+W), which opens a small dialog box listing all files currently open. The current file will be at the top of the dialog box. From this dialog box you can select the file you want to work with (double click, press Ok, or press Enter).

    Related Topics


    * Only the file name (not the directory) is shown. If you need path information, you can use the Window/Files... command to get a list of the paths to all the files.


    Creating a New File

    The menu command File/New (Alt+N) can be used to generate a new file. New files have the type untyped, and are given names such as "[Untitled 1]". When a new file is first saved its name and file type is assigned.

    Related Topics


    Opening an Existing File

    The menu command File/Open... (Alt+O) can be used to open a file. This brings up a standard Windows open file dialog. Multi-select is supported so you can open several files at once.*

    By default, all Japanese files types** are shown (extensions .jce, .jwp, .euc, .sjs, .jis, .old, .nec, and .utf). When you choose a file, JWPce examines the file to determine the encoding type based on the extension, and then decodes the file.

    Generally, the auto-detect ability works well on files, but in some cases you may need to specify the decoding method to use for the file. In these cases you specify a file type in the Files of type drop down list, and force JWPce to interpret the file as that type.

    If you want to load a file with an unusual extension, you can choose the file type Auto-Detect. This file type will show all files within the list box. When you choose a file(s) JWPce will examine the file(s) and attempt to determine the file type.

    Drag and Drop

    You can also load files by dragging them onto JWPce. This will load a file using the Auto-Detect feature.

    Recent Files

    You can also open files that you have used recently by choosing the menu command File/Recent Files. This leads to a sub-menu containing the nine most recently accessed files. Choose a file form this menu and JWPce will load it using the Auto-Detect feature.

    Reload Previous Files

    At startup, JWPce generally reloads all files that were loaded when you last exited the program. JWPce basically recreates your working environment when you start the program. This option can be controlled via the Reload Previous Files checkbox located on the General page of the Options dialog (Utilities/Options... or Ctrl+O).


    * Multi-Select is not supported by Windows CE and therefore is not available on Windows CE versions. ** Windows CE for PPC machines does not support multiple file types in a dialog box, so .jce files are selected as the default.


    Duplicate Files

    Normally you should not open a file in duplicate (i.e., open a file that is already open), because it can lead to problems. For example, when you change one version of the file the changes are not tracked in the other version.

    There are three options for what JWPce should do when you attempt to open a duplicate file. They are located in the Duplicate Files section of the File/Clipboard page of the Options dialog (Utilities/Options... or Ctrl+O). The choices are:


    Common Difficulties Opening Files

    Some common problems when opening files have to do with shift-JISand EUC formats. It is often not possible to correctly determine if a file is encoded in shift-JIS or EUC (since both encoding systems use the same values with different meanings). When JWPce cannot determine which file format to use, it will choose shift-JIS (because it is more common). If the resulting file does not look right, reload the file as an EUC file.

    Similar problems exist in dealing with UNICODE files. Depending on what is in the file, JWPce may not be able to distinguish the file from a shift-JIS or EUC file. JWPce always interprets files that begin with the UNICODE id (hex FFEF or EFFF) as UNICODE files. For files without an id, JWPce requires that all characters in the file be valid UNICODE characters. If JWPce cannot determine absolutely that the file is a UNICODE file, it will assume the type is shift-JIS or EUC.


    WARNING! Because UTF-7 format was designed to be indistinguishable from simple ASCII text, JWPce auto-detect cannot identify UTF-7 encoded files.

    Related Topics


    Opening the Same File Again

    The File/Revert command (Alt+R) will close the current file and then open it again. This can be used to undo all changes you have made to the file since you last saved it.

    This command can also be used to reload a file that has been modified by some other program since you last loaded it into JWPce. For example, if you want to read several web pages with JWPce, you could save one in your browser and read it in JWPce. Then, go back to your browser and save another under the same file name, and then return to JWPce and use the File/Revert command to load the new file.

    Related Topics


    Closing Files

    The File/Close (Alt+C) command will close the current file. You can also close the file by clicking the close gadget in the upper right corner of the window. The File/Close All command closes all open documents.*

    When you attempt to close files that have been changed, a warning dialog is generated that allows you to close without saving, save the file and then close it, or simply not close the file. (Information on saving files can be found above.)

    If you close the last open file, JWPce will normally ask if you want to exit the program. If you respond Yes, the program will terminate. If you respond No, a new blank file will be opened for you to work with. You can disable this question (that is, always exit JWPce) via the Confirm Exit on Last File check box in the General page of the Options dialog (Utilities/Options... or Ctrl+O).

    Related Topics


    * In this case all current documents are closed, and a new blank document is opened to prevent, JWPce from exiting (as it does when the last document is closed).


    The Exit Command

    The File/Exit (Alt+X) command will close all open files and exit the program. You can also close the files and exit the program by clicking the close button in the upper right corner of the window.

    When you attempt to close files that have been changed, a warning dialog is generated that allows you to close without saving, save the file then close it, or simply not close the file. (Information on saving files can be found above.)

    Related Topics


    Saving Files

    You can save a single file using the File/Save (Alt+S) command, or the File/Save As... command. You can also save all loaded files using the File/Save All (Alt+V) command.

    The File/Save (Alt+S) command saves a file under its current name (shown in the title bar) and file type (shown in the status bar). If a file does not have a name (that is, the name in the title bar is something like "[Untitled 2]"), the File/Save (Alt+S) command behaves like the File/Save As... (Alt+A) command described below.

    The File/Save As... (Alt+A) command opens a standard Windows save dialog box, from which you can set the file type and name of the file. If you do not specify a file extension, JWPce will add a default extension that indicates the file type (except for UNICODE files, which have no default extension).

    The File/Save All (Alt+V) command saves all files that have been changed, it is essentially the same as selecting File/Save (Alt+S) for every file that has been changed.


    Tip: Remember that the character between the JWPce version and the file name in the title bar indicates if the file has changed or not. The "*" character indicates the file has changed, and the "-" character indicates it has not.


    Backup Files

    By default, when saving files JWPce keeps the old version as a backup. (It renames the old version of the file). This allows you to recover the immediately preceding version.

    Backup files have the text "_BAK" appended to the end of the file name. For example, if you were editing the file "c:\Japanese\shukudai.jce", and saved the file again, JWPce would rename the older version to "c:\Japanese\shukudai.jce_BAK".

    The backup feature can be disabled via the Save Backup check box on the File/Clipboard page of the Options dialog (Utilities/Options... or Ctrl+O).


    Temporary Files and System Failures


    WARNING! The next section contains technical information about how JWPce manipulates files. This is useful in the event of a system crash, but you may want to skip this section.

    JWPce manipulates files very carefully, to improve recoverability from system crashes, disk full errors, and any number of other problems.

    The best way to see how the file manipulations are carried out is to follow an example. Thus we will consider the case of saving the file "c:\text.jce". The save procedure is as follows:

    1. Generate temporary file: First the information is saved to a temporary file. The name of this file is generated by appending the string "_@@##$$_" to the end of the file name ("c:\text.jce_@@##$$_").
    2. Delete old backup file: If there is an old backup file it is deleted ("c:\text.jce_BAK").
    3. Create new backup file: The existing file is renamed to make a new backup file ("c:\text.jce" is renamed "c:\text.jce_BAK").
    4. Temporary file is renamed: The temporary file is renamed to become the new file ("c:\text.jce_@@##$$_" is renamed "c:\text.jce").

    For this system to work, you must have enough disk space to store two copies of the file you are working on, because the old copy of the file is never deleted until the new copy has been successfully written to disk.

    In the unlikely event of a system crash during this procedure, you may be able to recover your work from the temporary file.

    Related Topics


    Deleting Files

    The File/Delete menu command (Alt+D) deletes the disk copy of the current file. This command was added primarily for use on Windows CE PPC systems, where there is no file manager to delete files. Due to menu space limitations, this command is not in the menu on Windows CE HPC machines, but the keyboard shortcut functions correctly.

    When you ask to delete the disk file, a dialog box will ask for confirmation before doing so. Additionally, the current file will be marked as changed, so that when you try to close the file you will be prompted to save the file. This provides double protection on deleting files.


    JFC Files

    JFC is a Japanese flash card program designed to work with JWPce (probably available from the same place you got JWPce). JFC files are stored in EUC or UTF-8 format. JWPce can read either format, but will normally only save in UTF-8 format. If you want to save in EUC format, you should save the file as EUC and change the file extension to .jfc.

    You cannot load JFC files into JWPce by double clicking on them. Instead, you must open them using the File/Open... command, right-clicking on them then selecting edit, or by dragging the file onto JWPce. This is because the .jfc extension is normally associated with JFC, not with JWPce.


    Working with Projects

    You can save the entire state of JWPce as a "project", and restore it at a later date. The information saved with the project includes all options and settings, page layout settings, the working directory, and open files.

    A project may be saved by selecting the File/Save As... command and selecting the file type JWPce Project (*.jcp). This does not save the current file itself, however.

    A project file can be loaded by opening the project file in any of the normal ways (using the File/Open..., drag and drop, from the recent files list). When opening a project file, JWPce will give you the choice of closing currently open files before opening the project, or allow you to add the project files to the currently open files.


    Next Chapter: Printing