Article View: comp.sys.mac.databases
Article #343"Programming with 4D" TOC
From: Craig Heilman
Date: Tue, 13 Oct 1992 15:42
Date: Tue, 13 Oct 1992 15:42
607 lines
17158 bytes
17158 bytes
I have had some expressed interest in the two volume set titled "Programming with 4th Dimension" by Mark Yelich. The set is published by: blackledge publishing, inc. 1126 E. Broadway Winona, MN 55987 1-800-424-4855 (507) 452-0023 Fax: (507) 452-0037 Here are the table's of contents for the two volumes as posted on Compuserve. Enjoy. Usual disclaimer's apply... VOLUME 1 TABLE OF CONTENTS Foreword I Acknowledgments III Introduction V CHAPTER 1 A Review of Program Planning 1 General comments about planning 3 Using a task oriented approach works best 3 Using flow charts and written specifications 3 Example flow charts 4 Example written specifications 5 Organizing the information to be stored 6 Working in small segments 6 Organizing the user interfaces 7 Sketching the user interfaces 8 Sketching the printed outputs 11 Maintaining a programming log 12 CHAPTER 2 A Review of Database Design Topics 15 A review of database structures 17 Database normalization 17 The one and many files 17 Establishing relations between files 18 Field types and their attributes 19 Using unique ID fields 20 Assigning the IDCompany number 21 Setting up file relations 21 Using subfiles 25 Where have we used subfiles? 27 Using a control file 27 About using subfiles in this case 28 CHAPTER 3 A Review of Code Writing Topics 33 Scope explained 35 Variables 35 Types of variables 35 Automatic variable typing 36 Declaring variable types yourself 36 Using Arrays 37 Creating pop-up menus 37 Creating selection tables 39 Another use for arrays 40 Using pointers 41 Complex uses of pointers 43 Cross-reference utilities 44 Functions versus procedures 44 Another example 45 Passing parameters 46 Controlling procedure flow 47 Looping control structures 47 Branching structures 50 Number of procedure call levels 52 Recursion, What is it? Why not? 54 An example of recursion 56 Same example without recursion 57 Naming conventions 58 Naming restrictions 59 Naming fields and variables 59 Naming procedures and functions 59 Labeling your procedures 60 Naming layouts and layout procedures 61 Keeping track of names 62 CHAPTER 4 A Review of the User Interface 65 About the user interface 67 Setting the default window style 67 Modal and Modeless windows 68 Modal windows 68 Modeless windows 69 Modal example 69 Monitor considerations 70 Dealing with various sizes 70 Using color in your layouts 73 Understanding how layouts can be used 73 Using layouts in dialogs 76 Good layout design practices 77 Working with buttons 78 Using buttons to control the display of dialogs 79 CHAPTER 5 A Review of 4DÕs File Structures 83 4DÕs file and record structures 85 File sizes 85 In summary 87 Number of files and size of records 87 About indexes 88 Using an index 90 Using more than one index 90 Using 4DÕs SETs 92 Another example using SETs 92 Invoice recall example 95 Using the SET ÒUserSetÓ 111 Recalling a selected invoice 112 Processing a selected group of invoices 113 Deleting a selected group of invoices 113 The last step 117 CHAPTER 6 A Review of 4DÕs Variables 119 Variable types 121 Standard types 121 Layout objects 121 Reserved variables 122 Arrays 123 Using arrays 123 Calculations with arrays 140 Using 2 dimension arrays 140 Declaring variables 144 CHAPTER 7 A Review of 4DÕs Menus 147 General comments about 4DÕs menus 149 4DÕs Runtime mode 149 Managing the menu system 151 Manipulating menus 152 Using the splash screens 153 Using pop-up menus 154 CHAPTER 8 A Review of 4DÕs Procedures 159 General comments about procedures 161 Global procedures 161 Layout procedures 163 About the execution cycle 164 Using the phases 165 A real world example 165 Using object scripts 168 The global procedure named Startup 171 CHAPTER 9 A Review of 4DÕs User Interface 173 Designing input and output layouts 175 Multi-page layouts 180 Using included layouts 182 Using automatic action buttons 188 Using radio buttons 190 About layout control lines and buttons 190 Using formatting and filters 192 Using the format dialogs 192 Using the SET FORMAT command 195 Using 4DÕs special DIALOGS 197 MESSAGE dialogs 197 ALERT dialogs 198 CONFIRM dialogs 199 Request dialogs 200 The ABOUT dialog 201 Blanking the window 203 My custom message dialog 205 CHAPTER 10 A Review of 4DÕs Printing Facilities 209 Printer considerations 211 Types of printers 211 About 4DÕs print commands 212 Using PRINT SELECTION 213 Positioning the layout control lines 213 Using the PRINT SELECTION command 215 About the print control dialogs 215 A more complicated example 217 About scripts and reports 221 Coordinating everything 221 About using the LEVEL command 221 Using included layouts with PRINT SELECTION 222 Using the PRINT LAYOUT command 226 About PRINT LAYOUT 226 An invoice example 227 Dividing the document into sections 228 A report example using PRINT LAYOUT 230 How this report works 235 About this example 236 CHAPTER 11 Other Important 4D Topics 239 Miscellaneous details 241 Math operator precedence 241 Using 4DÕs Lists 241 Lists, arrays and pop-up menus 243 Controlling 4DÕs progress messages 243 Programmatically controlling the messages 244 Using the EXECUTE command 245 An example 245 Using the SEND PACKET command 247 Commonly used 4D commands 248 CHAPTER 12 A Review of Multi-user Operation 251 Multi-user Considerations 253 About the .data_ file 253 About running duplicate copies of 4D 254 About running multiple copies of the modules 255 The right way to install the modules 257 Typical multi-user details 258 Assigning sequential numbers 258 Creating selection tables 259 Deleting records in multi-user mode 263 Deleting related records 264 Using 4DÕs Lists in multi-user 266 CHAPTER 13 Using 4D WRITE in a Program 269 About 4DÕs modules 271 Giving the user direct access 271 Running 4D WRITE programmatically 275 4D WRITEÕs commands 276 Thoughts on the other modules 276 4D CALC 276 4D DRAW 277 GRAPH 3D & 2D GRAPH 277 CHAPTER 14 A Review of the 4D COMPILER 279 Why compile? 281 Performance improvements 281 Debugging assistance 281 Protecting your source code 281 Creating a double-clickable application 282 Typing variables 282 Running the compiler 285 Debugging the program 287 Program size 293 CHAPTER 15 A Review of the 4D Utilities 295 General comments about the utilities 297 Using 4D Tools 297 Compacting the structure 298 Using 4D XREF 299 Using 4D MOVER 303 Using Customizer Plus 304 Using 4D External Mover 305 INDEX 309 VOLUME 2 TABLE OF CONTENTS Foreword I Acknowledgments III Introduction V Setting the scene VII The Needs To Be Satisfied VIII The Role of Planning IX Data Normalization IX The Tasks the Program Performs X The Segmentation Approach XI The Programming Style XI The Interface Style XII How This Volume is Organized XV CHAPTER 1 Getting Started, The First Few Steps 1 About this example 3 Written description of the major tasks 3 A high level flow chart 4 Program segment descriptions 4 Creating the program and data files 5 About File1, the first file in the database 6 Setting up for the Runtime mode 7 The main menuÕs splash screen 9 Controlling the programÕs startup 10 The procedure Startup 10 Setting up an ABOUT dialog 11 The last startup task 12 Some other preliminary details 13 Setting up a short menu 13 Providing window blanking 14 Providing a message dialog 15 Setting the programÕs preferences 17 Where are we now? 17 Testing this segment 18 Summary 18 CHAPTER 2 The Customer File Segment 21 Planning this segment 23 A written description of this segmentÕs tasks 23 Segment Flow chart 23 Planning the data files 24 Planning the look-up lists 25 Sketching the Input and output layouts 26 Planning for importing and exporting 29 Planning the printed outputs 29 Enough planning! 32 Programming this segment 32 Defining the data files. 32 Establishing the file relations 33 About problems in relating files 35 Many to one relations with more than one file 36 Designing the file maintenance section 36 The [Customers] output layout 37 The [Customers] input layout 37 The [Contacts] output layout 40 The [Contacts] input layout 40 The [ShipTos] output layout 41 The [ShipTos] input layout 42 Setting up the pop-up menus 42 The [SalesPeople] data file 43 The [BusinessCats] data file 47 Loading the pop-up menus 47 Designing the main procedures 50 The CFMaintCust procedure 50 The CustEntry input layout procedure 59 The [Contacts] Add button script 63 The [Contacts] input layout procedure 63 The [Contacts] Change button script 64 The [Contacts] Delete button script 65 The [ShipTos] button scripts 65 Summary 66 Designing the printouts section 67 An overview of CFCustLists 72 Selecting a group of [Customers] 72 Setting the search ranges 74 Searching the file 75 Sorting the selection 78 Printing Labels & Lists 79 The Export selections 85 Summary 88 Interfacing to the other segments 88 Capturing the selected customer or prospect 91 Summary 95 Testing this segment 95 Running the program 95 Using 4D XREF 96 Compiling 96 Backing up our work 96 CHAPTER 3 The Estimating Data Set-Up Segment 99 Planning this segment 101 A description of this segmentÕs tasks 101 Segment Flow chart 101 Data file definitions 102 Interface sketches 104 Programming this segment 106 Accessing this segmentÕs menu 106 The [Passwords] subfile 107 The Printout text 110 The estimating data files 111 How these procedures work 114 The input and output layouts 116 Designing the related file structures 118 The [ServicePrices] & [SvcQuanPrices] files 119 How the included records behave 120 The [CopierPrices] & [QuantityPrices] files 121 Printing the estimating data 123 Printing with included layouts 126 Loading the related records 128 Testing this segment 129 Running the program 129 Running 4D XREF 129 Compiling 129 Current program size 130 CHAPTER 4 The DTP Estimating Segment 131 Planning this segment 133 A description of this segmentÕs tasks 133 Segment Flow chart 134 Data file definitions 134 Interface sketches 135 Programming this segment 137 Initializing the estimating function 137 Selecting items 138 Calculating the prices 143 Making changes 148 Storing the estimate 151 Printing the estimate 155 The other buttons 158 Resetting between estimates 158 Testing this segment 159 Running the program 159 Running 4D XREF 159 Compiling 160 CHAPTER 5 The Copier Estimating Segment 161 Planning this segment 163 A description of this segmentÕs tasks 163 Segment Flow chart 164 Data file definitions 164 Interface sketches 167 Programming this segment 171 Setting up groups of arrays 171 Controlling the estimating process 173 Graphics work section 174 Finished size section 183 Quantity and copier section 185 The paper selection section 187 Bindery work section 192 About bindery work and pricing 195 How this procedure works 196 Sales tax section 198 Calculating the price for copying 198 How this procedure works 203 Looking up the copier rate 204 The estimate summary dialog 206 Making changes 209 Storing the estimate 211 Printing the estimate 215 Resetting between estimates 221 Creating a job ticket 224 Printing a job ticket 233 Clearing the job ticket details 236 Testing this segment 237 Running the program 237 Running 4D XREF 238 Compiling 238 Backing up the program 238 CHAPTER 6 The Invoicing Segment 239 Planning this segment 241 A description of this segmentÕs tasks 241 Segment Flow chart 241 Data file definitions 242 Interface sketches 244 Programming this segment 246 The invoicing featureÕs variables 246 Invoice data files 247 Creating a blank invoice 248 Creating an invoice manually 252 The controlling procedure 252 Assigning a customer 253 Entering the general details 254 Displaying the invoice dialog 257 Adding, changing and deleting lines 262 Distributing the itemÕs sales dollars 269 Creating invoice items from estimates 274 About invoice items 280 The userÕs formatting options 281 Sales distribution 283 Managing the description line length 284 Formatting the quantity and price columns 285 How INAddToInvoice works 285 Storing the invoice 294 Printing invoices 297 Testing this segment 303 Running the program 303 Running 4D XREF 303 Compiling 303 Backing up the program 303 CHAPTER 7 The Accounts Receivable Segment 305 Planning this segment 307 A description of this segmentÕs tasks 307 Segment Flow chart 309 Data file definitions 310 Interface sketches 312 Programming this segment 316 This segmentÕs variables and files 316 Receivables data files 317 The receivables menu 318 Entering charges manually 319 How this layout procedure works 322 Adding new charges 323 Changing existing records 323 Entering credit memos 324 Entering payments 327 How ARUpdateAge works 338 Posting charges from invoices 340 How ARPostToAcct works 343 Manipulating existing charges 344 How ARListChgs works 348 Manipulating existing payments 351 Customer maintenance 356 Printing statements 356 How ARStatement works 359 Journals and reports 365 Sales journal 366 How ARSlsJour works 370 Payments journal 372 Sales tax journal 375 Aging reports 377 Closing the month 381 How ARCloseMonth works 384 The historical files 384 Testing this segment 388 Running the program 388 Running 4D XREF 388 Compiling 389 Backing up the program 390 CHAPTER 8 The Job Recall and Reporting Segment 393 Planning this segment 395 A description of this segmentÕs tasks 395 Segment Flow charts 396 Data file definitions 398 Interface sketches 398 Programming this segment 401 This segmentÕs variables 401 Programming the Recall function 402 Recalling estimates 402 Recalling an estimate 413 Deleting selected estimates 419 Recalling job tickets 420 How HIListJob works 427 Recalling invoices 428 How HIListInv works 438 Processing invoices in a batch 444 Programming the reporting function 449 Estimate summary reports 450 Job schedule reports 465 Invoice summary reports 469 The simple format 472 The detailed format 474 Exporting the report 479 Sales reports 483 About optimizing these reports 487 Custom reports and labels 488 Testing this segment 492 Running the program 492 Running 4D XREF 492 Compiling 492 CHAPTER 9 The Sales Management Segment 495 Planning this segment 497 A written description of this segmentÕs tasks 497 Segment Flow chart 498 Planning the data files 499 Planning the look-up lists 500 Sketching the user interfaces 501 The Prospects portion 501 Planning the printed outputs 503 The Tracking system 503 The appointment calendar 505 Programming this segment 506 The Prospects file 506 Labels, Lists & Letters 512 Importing names 514 The appointment calendar system 517 How SMCalcCalendar works 526 Look-up lists 536 The Tracking system 548 Building in 4D WRITE 559 Testing this segment 562 Testing functions 562 Using 4D XREF 563 Compiling 563 Backing up our work 563 CHAPTER 10 Optimization, Additional features & Testing 565 Optimization 567 Performance 567 What to look for 570 Multi-user performance 572 An example 573 Program Size 576 Optimizing the READ/WRITE sections 576 Optimizing the pop-up menu sections 577 Ease of use 582 Additional features we may add 582 Final testing 583 CHAPTER 11 About The Optional Program Disk Set 585 Program disk contents 587 Loading the files onto your hard disk 587 Installing 4D WRITE 591 Using portions of this program 593 Finding your way around the program 593 Using the cross-reference database 595 Loading the database 598 Segmenting the text file 600 Loading from the XREF text file 601 Updating the database 601 Reading procedure names 601 How this script works 603 Reading variable names 606 How this script works 607 Reading the field names 608 How this script works 610 Reading the layout names 611 How this script works 613 Printing the cross-references 617 Summary 619 Using 4D MOVER 619 Keeping track of changes 620 INDEX 623 -- * * "I just found out that the brain is like a * * Craig A. Heilman * computer. If that's true, then there really * * craigh@cserver.plexus.com * aren't any stupid people. Just people * * * running DOS." - VH1's Stand Up Spotlight *
Technical Details
Message-ID:
<craigh.718990938@cserver>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!spool.mu.edu!cserver!craighShow Full Headers
Complete Article Headers
Newsgroups: comp.sys.mac.databases Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!spool.mu.edu!cserver!craigh From: craigh@cserver.plexus.com (Craig Heilman) Subject: "Programming with 4D" TOC Message-ID: <craigh.718990938@cserver> Sender: news@cserver.plexus.COM Nntp-Posting-Host: case2 Organization: Plexus Corp. -- Neenah Wisconsin Date: Tue, 13 Oct 1992 15:42:18 GMT Lines: 607