                                                                  P. 1

                   FAKING A DATABASE ON THE PORTFOLIO



Why Fake It? 

------------ 

Personally, I would find a real Database more useful than a Spreadsheet 

on the Portfolio.  I mean a real Database with a selectable number of 

titled categories per record, sortable, and uploadable to another real 

Database on my Mac or even one of those other three-letter computers.  

Unfortunately, I haven't found one small enough to run in the PF, but I 

have found ways to fake it using the built-in Address Book and Worksheet 

applications. This at least has the advantage that it isn't eating up 

the precious little RAM available.



How: The General Idea 

---------------------  

* Use the Address book, and insert a set of category titles in every 

record.



* Use the Worksheet, and use the vertical columns for categories, with 

the category titles in the first row across the top. 



Which One? 

---------- 

Both methods are relatively easy to use and print, and both can be 

searched.  There are some advantages and disadvantages to each which may 

make one more suitable for a given use than the other.



Address Book "Database"              Worksheet "Database" 

----------------------------------   --------------------------------- 

-Searcheable                         -Search command not available



-Automatically sorts (but on first   -No built-in sort 

 category only)



-Easy to view all categories for a   -Easy to view one category for

 single record, but difficult to      several records, but more

 compare several records              difficult to see all categories

                                      for a single record



-Easy up/download from/to a "real"   -Upload to "real" database may be

 database                             easy, download from real database

                                      difficult



-Can create new database from        -Subset creation possible with 

 subset of original                   cut and paste, but tedious



-Category titles more complicated    -Category Titles very easy



-Category entries up to 255 char-    -Long category entries more 

 acters                               complicated to deal with.













                                                                  P. 2





                   Fake Database #1, The Address Book

                   ==================================



An example of a single Address Book DB file record might look like this-



LOT #: 104-2 

_________________________________________ 

SIZE: 150 Kg 

SHIP TO: Acme Paint and Color, Charlotte, 

SHIP DATE: 11/1/90 NOTES: First run with new filter and high 



Category Titles 

-------------- 

How do you get the category titles in there without having to type them 

every time you enter a new record?  Here's how.  First, be sure you have 

"Clipboard Save" ON  under Applications... in the Portfolio Setup 

application. Now create a text file with the editor that looks like 

this: (< is carriage return, CR)



LOT #:/< 

SIZE:< 

SHIP TO:< 

SHIP DATE:< 

NOTES:<



The "/" at the end of the first category title is important, as I will 

explain later (Trust Me, Read My Lips, etc.).  You can load this set of 

category titles onto the Clipboard, and paste them into as many records 

in the Address Book file as you think you will need.  Keep the text file 

around in case you have to create more blank records.



  - Put the cursor on the L in LOT #, Press Fn+3, and select Mark 

  - Move the cursor to the end of the NOTES: line. 

  - Press Fn+3, and select Store 

  - Exit (and save the file) from the Editor 

  - Open a new file in the Address Book 

  - Fn+3, select Paste to insert the category titles 

  - Press tab to create a new record, and repeat the Paste step above 

    as many times as desired



Now you can go back to your first record, press Fn + the right arrow key 

to go to the end of the category title, delete the "/" and enter your 

data.



The reason for the "/" now becomes apparent.  If it weren't there, the 

automatic sorting of records that Address Book performs would put all of 

your 

blank records at the beginning, which makes it inconvenient to get to 

the real data.  If you put in the "/", or almost any other punctuation 

or special character, all the blank records will be at the end of the 

list.







                                                                  P. 3

Upload/Download 

--------------- 

Uploading the "Database" to a real Database on a desktop computer is 

fairly easy (or is it downloading - I never know which way is up).  It 

is VERY easy if your real Database can import from a text file format 

where all categories are terminated with CRs, and you specify the number 

of categories per record.  Simply upload the Address Book file to your 

desktop computer as a text file, and import it into the desktop's 

Database.  In this case, the categories per record to specify is one 

more than the actual number, because the Address Book puts a blank line 

between records.  (This will give you a blank category in every record.)  

If you have a real neatness fetish, you can use the Replace function of 

a word processor (or even the Portfolio Editor) to strip out the 

category titles and extra blank lines from the Address Book file before 

importing it into the desktop's Database.



If your desktop's Database can only read the format where categories are 

terminated by tabs and each record is terminated by a CR, then you will 

have to do a little more work with a word processor to put the required 

characters in.  Another way to do it is to enter a TAB character (= 

control-I, generated by SHIFT+6 followed by I) at the end of every line 

as you are entering data into your fake Database.  You have to remember 

to do it on EVERY line, however.  A better way is probably to put a 

space and a TAB right in with the category titles when you create them, 

i.e.,



LOT #: ^I< 

SIZE: ^I< 

etc.



The ^I will not actually show up in the Editor file (but will in the 

Address Book file), and you can use the regular tab key to create it in 

the Editor, rather than the "SHIFT+6 I" method you have to use in the 

Address Book.



Downloading a file from a real Database to your fake Database on the 

Portfolio requires (1) creating a text file output from your data base, 

and (2) probably some massaging of the text file with a word processor 

to put it into the Portfolio Address Book format. (Every line terminated 

with a CR, one blank line between records.)  Inserting category titles 

is really a chore unless your word processor supports Macros that can 

automate the process to some extent.  This is a good reason to leave 

them in instead of removing them when uploading to a desktop database. 



                   Fake Data base #2 - The Worksheet

                   ================================= 

This is especially suitable for databases where entries in each category 

are short.  Such a setup might look like this-



  |-----A-----|----B----|-----C-----|--- 

1 |LOT #      |SIZE     |SHIP DATE  |SHI 

  |-----------|---------|-----------|--- 

2 |104-2      |150 Kg   |11/1/90    |Acm  

  |-----------|---------|-----------|---

3 |106-3      |137 Kg   |11/7/90    |Mei

                                                                  P. 4

				 

Category Titles 

--------------- 

Category titles are easy.  Move the cursor to the desired cell in row 1 

and just type them in. They will be entered in the cell left-justified. 

If the title starts with a number or other non-letter character, or you 

want different justification, type one of the special justification 

characters at the beginning.  An initial ' left-justifies the title, a ^ 

centers it, and " right-justifies it.



You can keep this row of category titles permanently at the top of the 

screen by using the "Titles" option in the Worksheet.



  - Put the cursor on cell A2 ("104-2") 

  - Press the Atari symbol key or Fn+1 

  - Select Worksheet... and press RETURN 

  - Titles will normally be OFF.  Select it and press RETURN to turn it

    ON.



Column Widths 

------------- 

You will have to adjust the column widths to accommodate the longest 

entry in each category.  



  - Place the cursor in the column whose width is to be changed 

  - Press the Atari symbol key or Fn+1 

  - Select Range..., then Width 

  - A box will appear around the current cell.  Just hit RETURN if you

    only want this column changed, or move the box left or right with 

    the arrow keys to include adjacent columns.



If you guess wrong at the beginning and a new entry in a category is 

longer than the width you have set, just change the width again.  The 

maximum column width is 34 characters. You can type in entries up to 240 

characters long, but usually you will only be able to see the first 34 

until you put the cursor on that cell.  You also will only be able to 

print or copy (to upload to a real database) the first 34 characters. To 

get around this problem, leave (or Insert from the Worksheet... submenu 

of the Fn+1 menu) one or more empty 34-character-wide columns to the 

right of the "long" entry. Long text will now continue into these empty 

cells.



Upload/Download 

--------------- 

Uploading to a real Database on a desktop computer can be fairly simple 

IF your desktop Database recognizes a certain input format.  Otherwise 

you are in for a lot of massaging with a word processor.  My Microsoft 

Works Database on my Macintosh (and presumably the PC version of MS 

Works as well) recognizes two or more consecutive spaces as a TAB.  If 

you make sure to set the width of your columns so that there are at 

least two spaces at end of every entry, you are all set.  Proceed as 

follows:









                                                                  P. 5

				 

  - Place the cursor on cell A2 (the first data-containing cell) 

  - Press Fn+3 (clipboard) 

  - Select Mark 

  - Move the cursor to the last data-containing cell (lower right of

    the worksheet 

  - Press Fn+3 

  - Select Store 

  - Exit the Worksheet (save it) 

  - Open a new Editor file 

  - Press Fn+3 

  - Select Paste (May have to Cut and Paste more than once if Worksheet

    is larger than the 8K capacity of the Clipboard) 

  - Exit and save the new text file



Now you can upload this text file to your desktop computer and import 

into your real Database.  Almost all Databases can import text files in 

the format in which each category is terminated with a TAB and each 

record by a CR.  If your desktop database doesn't recognize two or more 

consecutive spaces as a TAB, then you will have to open the text file 

with a word processor and insert TABS after each category (except the 

last, which has a CR).



Downloading from a desktop database to the Atari PF Worksheet is another 

story.  Apparently the only format that can be imported into the PF 

worksheet is Lotus 1,2,3.  I haven't yet figured out how to get data 

from my Macintosh databases into this format. It probably can be done 

with PC databases if you can copy your database data into a Lotus 1,2,3- 

compatible spreadsheet



Of course the simplest way to maintain upload/download compatibility 

with a desktop computer in the case of a fake DB in the Worksheet is to 

simply upload it and import it into a Lotus 1,2,3-compatible Spreadsheet 

on the desktop computer, rather than trying to put it into a Database.















































