Chirstmas Comes Early
for the

Fabulous filePro Fellowship

Free Word Wrapping Software for filePro


tia_chi.gif - 1445 Bytes 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.
What this means is that you have to have (or add) the number of fields you want to give the user to enter their notes into. They should all be defined as the same length.

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:


		...
		 22	 N1) Notes		 70		*
		 23	 N1)			 70		*
		 24	 N1)			 70		*
		 25	 N1)			 70		*
		 26	 N1)			 70		*
		 ...
 

(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).
(On UNIX, make sure that filePro is the owner of the ppww processing table.)

Now, modify your input processing code to call the PPWW routine whenever the user leaves any of the note fields.
Add the following line of code:


@WLFN1		If:
		Then:	CALL "ppww"; DISPLAY; END
				

Next, go into Define Processing on your file and select "Output Processing."
Choose the processing table: "ppww"
You will find the following code at the top of the PPWW Table:


'Poor Person's Word Wrap Routine for Associated Text Fields 'By Howard Wolowitz Copyright 1999 ALL RIGHTS RESERVED ' USER MODIFY TWO LINES BELOW '----------------------------------------------------------------- If: 'nf=number of fields in the associated note group Then NF(3,.0)="5" '5 fields in group If 'point array to the first field for # of fields Then: DIM LINE(5):22 '5 fields starting at field number 22 '----------------------------------------------------------------- ' END OF USER AREA:

Change the NF variable to contain the number of fields you have created.
Change the DIM LINE(x) : y So that x=number of fields (again) and y=starting field number.

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 it into the correct filePro directory and make the above changes.

      Download The Poor Person's Word Wrapper
       (less then 3K source, 815 bytes tokenized)

If nothing else, this code itself may someday be valuable. It's one of the very rare times that I used comments!

But remember ...
The best a comment can do is to tell the truth,
the worst it can do is to tell a lie.
The code never lies!

Happy word wrapping,

 

Howie and the Aljex Software Team.