Have you ever needed a method to allow the user to enter simple free form notes onto a filePro record?
Maybe you don't need all the power of fPNotes with it's true word processing features, but wouldn't it be nice if filePro could just do simple "word wrapping" between fields? Well now it can! Help yourself to this Free PPWW Routine (Poor Persons Word Wrapping Routine) This, easy to implement routine, will do simple word wrapping between filePro's associated fields as the user is typing. And it's cute code to learn from. What it does: When the user types a word that spans the end of one line the word they are typing is moved to the next line, the contents of all following lines are adjusted as required (word wrapped) and the cursor is left at the end of the word the user was typing. It all happens so fast that the user doesn't have to stop and think, just type (which is exactly what they do anyway.) It does not require any additional variables or real fields so it is transparent to your existing programming. Here is how to get it up and running: First, the file that you want to attach the notes to has to have
multiple contiguous instances of an associated group to hold the note.
Let's say you wanted the user to use 5 fields of 70 characters each to hold the notes and that the first field is field number 22.. You would use Define Files to make them:
(Don't forget to put the fields on one of your data entry screens.)
Download the PPWW routine and copy it into the file's directory as"PPWW.PRC" (MSDOS) or "prc.ppww" (UNIX). Now, modify your input processing code to call the PPWW routine whenever
the user leaves any of the note fields.
Next, go into Define Processing on your file and select "Output
Processing."
Change the NF variable to contain the number of fields you have created. Make the changes to the above two lines and save and tokenize the
input and ppww processing tables, and that's it.
Since this is a "Called" routine, the dummy variables it uses can
not conflict with the ones in your Input processing table.
The eight variables that I am using in ppww CAN CONFLICT with variables declared in your Automatic table. If any
conflicts are found you will need to change the variable used by PPWW so as not
to cause the conflict.
Below is a link to the PPWW processing table: Internet explorer users can just click on it and choose "Save to Disk", Netscape users use Shift click and the save it to disk (thanks JP and Ken.) If you still have problems I will gladly email it to you.
Download The Poor Person's Word Wrapper If nothing else, this code itself may someday be valuable.
It's one of the very rare times that I used comments! Happy word wrapping,
Howie and the Aljex Software Team.
|