Thread View: comp.sys.mac.databases
2 messages
2 total messages
Started by price carl wayne
Fri, 14 Aug 1992 21:49
4D problem
Author: price carl wayne
Date: Fri, 14 Aug 1992 21:49
Date: Fri, 14 Aug 1992 21:49
29 lines
2112 bytes
2112 bytes
I'm having a problem with 4D that I thought someone might have already solved. I want to print labels sorted by zip code, but the problem is the mailing address can come from one of two files. The only way I've been able to think of to do this would be with an array, but this tends to be very memory intensive for a large mailing list. Has anyone done this? If more info is needed (ie I'm not stating my problem clearly) mail me and I'll provide more info. On another note, I've finished writing a procedure to properly produce the ABC zip-code with framing bars so that USPS barcodes can be printed using the USPS barcode font available from Sumex (I haven't sent these through the post office yet, so I can't say if the font works on the Post Offices barcode readers, but the numbers come out according to the post office Regulations.) If you want the code so you can adapt it to your database, e-mail me and I'll either mail you a copy, or if there is enough intrest I will post it. Note: This code is not as clean as I would have liked, there are some things that could have been done more elagently in another language, but I couldn't find the commands in the 4D language. It does work however, so It is a good point to start on your own. You will have to adapt it for you application since it is written specificly for my app. --Carl -- Carl W. Price * * Work keeps us from three evils: * Computer Engineering Student * * boredom, vice, and need. * Oregon State University * * * pricec@prism.cs.orst.edu * * ---Voltaire *
Re: 4D problem
Author: Andrew Dent
Date: Mon, 17 Aug 1992 12:14
Date: Mon, 17 Aug 1992 12:14
48 lines
2306 bytes
2306 bytes
To create an "on-the-fly" link to two or more different databases,
the most elegant solution I know of is based on the use of pointers
and arrays.
Note, the following is being typed in from memory so minor syntax errors
may creep in...
Firstly, let's assume you have files [zip] and [addr1] or [addr2] used
as source for addresses, each with fields for Name, Address, City & Zip
(they DO NOT have to have the same names or be in the same position for
this technique to work)
Note: I'm going to use >> to indicate the 4D pointer (option-\) char.
Define an array to point to the relevant fields
ARRAY POINTER (addrFlds; 2; 4)
addrFlds{1}{1} = >>[addr1]Name
addrFlds{1}{2} = >>[addr1]Address
and so on...
addrFlds{2}{4} := >>[addr2]Zip
our [Zip] database has an integer field used to indicate which address
file is relevant (ie: it always contains 1 or 2).
To reference a given address, simply use
addrFlds{[Zip]whichAddr}{1}>>
addrFlds{[Zip]whichAddr}{2}>>
addrFlds{[Zip]whichAddr}{3}>>
addrFlds{[Zip]whichAddr}{4}>>
This technique has lots of other applications - I've just finished a
system for converting ArchiCad output files to a jobcosting file, which
is totally user-defined. They can define "factors" that describe how to
extract data, ask the user or perform a calculation. Using the above
technique I have one master [Factors] file and a number of "variant"
files. This is very much like object-oriented programming in that you
can add new Factor types without changing a bit of existing code!
If anyone's interested in more detail, I'll post again, enough dribbling
for now!
Andy Dent (A.D. Software - Mac & VAX programming)
94 Bermuda Dve, BALLAJURA Western Australia 6066
Phone/Fax: 09 249 2719 (local) +619 249 2719 (International)
Internet: dent@DIALix.oz.au Compuserve: 100033,3241
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads