FROM 4D WRITE TO 4D WRITE PRO INTRODUCTION. Presented by: Achim W. Peschke

Similar documents
4D Write Pro Reference

HTML and CSS a further introduction

ADOBE DREAMWEAVER CS4 BASICS

Creating Web Pages with SeaMonkey Composer

ORB Education Quality Teaching Resources

User s guide to using the ForeTees TinyMCE online editor. Getting started with TinyMCE and basic things you need to know!

Introduction to Dreamweaver CS3

Independence Community College Independence, Kansas

CREATING ACCESSIBLE SPREADSHEETS IN MICROSOFT EXCEL 2010/13 (WINDOWS) & 2011 (MAC)

WINDEV 23 - WEBDEV 23 - WINDEV Mobile 23 Documentation version

4D Write. User Reference Mac OS and Windows Versions. 4D Write D SA/4D, Inc. All Rights reserved.

Do It Yourself Website Editing Training Guide

This Tutorial is for Word 2007 but 2003 instructions are included in [brackets] after of each step.

CounselLink Reporting. Designer

Welcome to AEM Part Six: Accessible Microsoft Office Word Document Design.

AGENT123. Full Q&A and Tutorials Table of Contents. Website IDX Agent Gallery Step-by-Step Tutorials

COMSC-031 Web Site Development- Part 2

How to lay out a web page with CSS

Microsoft Office Excel 2007: Basic. Course Overview. Course Length: 1 Day. Course Overview

APPLIED COMPUTING 1P01 Fluency with Technology

ECDL Module 6 REFERENCE MANUAL

DOING MORE WITH WORD: MICROSOFT OFFICE 2013

Creating Buttons and Pop-up Menus

Additional Support and Disability Advice Centre

Dreamweaver Basics Outline

Microsoft Office Excel 2010: Basic. Course Overview. Course Length: 1 Day. Course Overview

Quark XML Author October 2017 Update with Business Documents

OU EDUCATE TRAINING MANUAL

Page Layout Using Tables

Dreamweaver Handout. University of Connecticut Prof. Kent Golden

USER GUIDE. MADCAP FLARE 2017 r3. QR Codes

Using Microsoft Word. Working With Objects

Anleitungen für Word 2016 als Word-Dokument zum Ausdrucken und fürs Intranet

Title and Modify Page Properties

Microsoft Word 2007 on Windows

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links

Welcome Back! Without further delay, let s get started! First Things First. If you haven t done it already, download Turbo Lister from ebay.

P6 Professional Reporting Guide Version 18

DOING MORE WITH WORD: MICROSOFT OFFICE 2010

University of Sunderland. Microsoft Word 2007

Html basics Course Outline

Quick Start Guide - Contents. Opening Word Locating Big Lottery Fund Templates The Word 2013 Screen... 3

FRONTPAGE STEP BY STEP GUIDE

Accessible and Usable PDF Documents: Techniques for Document Authors Fourth Edition

Drupal Cloud Getting Started Guide Creating a Lab site with the MIT DLC Theme

3. What is the smallest and largest font size available in Font Size tool on formatting toolbar? A. 8 and 72 B. 8 and 68 C. 6 and 72 D.

INTRODUCTION... 1 LONG DOCUMENTS V SHORT DOCUMENTS... 2 SECTION BREAKS... 2

Styles, Style Sheets, the Box Model and Liquid Layout

Week - 01 Lecture - 04 Downloading and installing Python

Bixby Public Schools Course Essential Elements Grade: Desktop Publishing

How to Edit Your Website

Introduction to Microsoft Office 2007

How To Get Your Word Document. Ready For Your Editor

Code::Blocks Student Manual

Rich Text Editor Quick Reference

Working with the RTF Generator

Getting Started with Amicus Document Assembly

How to Edit Your Website

FirmSite Control. Tutorial

The New Office 2007 Interface and Shared Features

DOING MORE WITH WORD: MICROSOFT OFFICE 2007

Adobe Dreamweaver CS5 Tutorial

WORD XP/2002 USER GUIDE. Task- Formatting a Document in Word 2002

Content Author's Reference and Cookbook

How to lay out a web page with CSS

Microsoft Word Important Notice

Microsoft Excel 2007

Adobe Dreamweaver CC 17 Tutorial

Center for Faculty Development and Support Making Documents Accessible

Basic Concepts. Launching MultiAd Creator. To Create an Alias. file://c:\documents and Settings\Gary Horrie\Local Settings\Temp\~hh81F9.

Using Dreamweaver To Edit the Campus Template Version MX

ACA Dreamweaver Exam Notes

CS 200. Lecture 02 Structured Word Processing Styles. 02 Styles. CS 200 Spring Friday, May 9, 2014

CREATING A POWERPOINT PRESENTATION BASIC INSTRUCTIONS

Creating Accessible Word Documents

Chapter 1 Introduction to Dreamweaver CS3 1. About Dreamweaver CS3 Interface...4. Creating New Webpages...10

Understanding Word Processing

Best Practices for Using the Rich Text Editor

Microsoft Office Training Skills 2010

Oracle Eloqua s User Guide

By Ryan Stevenson. Guidebook #2 HTML

Using Microsoft Office 2003 Intermediate Word Handout INFORMATION TECHNOLOGY SERVICES California State University, Los Angeles Version 1.

Table Basics. The structure of an table

ABOUT THIS COURSE... 3 ABOUT THIS MANUAL... 4 LESSON 1: MANAGING LISTS... 5

Microsoft Office PowerPoint 2013 Courses 24 Hours

Karlen Communications Add Accessible PowerPoint Placeholders. Karen McCall, M.Ed.

OpenForms360 Validation User Guide Notable Solutions Inc.

The figure below shows the Dreamweaver Interface.

Content Author's Reference and Cookbook

Using Microsoft Word. Table of Contents

C1 CMS User Guide Orckestra, Europe Nygårdsvej 16 DK-2100 Copenhagen Phone

WAYNESBORO AREA SCHOOL DISTRICT COMPUTER APPLICATIONS

Documents, Templates, and Content Guide

CSS for Page Layout Robert K. Moniot 1

EDITOR GUIDE. Button Functions:...2 Inserting Text...4 Inserting Pictures...4 Inserting Tables...8 Inserting Styles...9

The New Office 2010 Interface and Shared Features

Authoring World Wide Web Pages with Dreamweaver

Ektron Advanced. Learning Objectives. Getting Started

Best Practices for Using the Rich Text Editor

Microsoft Word 2010 Lesson Plan

Transcription:

4 D S U M M I T 2 0 1 8 FROM 4D WRITE TO 4D WRITE PRO Presented by: Achim W. Peschke INTRODUCTION In this session we will talk to you about the new 4D Write Pro. I think in between everyone knows what 4D Write Pro is. Therefore, I do not want to waste time with a marketing talk. In this session we will not speak about new features. There are other sessions showing you new features in detail and explaining you the benefit for your daily work or for things, the users will be able to do. Here I will explain you the internals of 4D Write Pro. The ideas behind it. The way it works. 4D Write Pro follows a different concept than the old 4D Write. Only by knowing this concept, you will be able to get the most out of it in your daily work. In detail we will talk about: - 4D Write Pro as an area in your form and as a field in the structure - How to view the content e.g. in case of debugging - Bringing content into a 4D Write Pro area - 4D commands compatibility - Migrate old 4D Write programming to new 4D Write Pro - Working with off-screen areas - Conversion of old 4D Write documents - Using tab stops the right way - Bookmarks - Ranges - Different kinds of breaks - Clipping regions - Headers and Footers - Create 4D Write Pro documents from templates - Create 4D Write Pro documents dynamically from scratch - Access to 4D Write Pro areas using object notation Not all topics are handled in a separate chapter. Some are merged together when it makes sense. 1

4D WRITE PRO FORM AREA AND FIELD IN THE STRUCTURE 4D Write old was a plug-in. Or let me say an external program. It was loaded and running in the same memory as 4D did. But it was not really inside 4D and communication with 4D was done by using an API. Now a 4D Write Pro area is a native form object as you know from other form objects like other variables, as buttons or list boxes. It runs not only in the same memory as 4D does, it really runs inside 4D. This offers you full control by programming and through form events. It is a variable of type OBJECT and has to be declared as an object. Sample 1 WP_Area_and_field 1. Designmode, open project form WP_Form You can draw a 4D Write Pro area in a form as any other variable or form object in 4D. Give it a variable name or use the object name to access the area. Internally a 4D Write Pro area is an object type variable, with the ability, that its context can be rendered if displayed on screen. 2. Run method Start_WP_Variable Like any other object variable in 4D it has to be defined with a C_OBJECT compiler command. I do this in the form method. 3. Button Define 1 But defining the type is not enough. We have to create a new 4D Write Pro document. One way is to use the command WP New. For a new empty document no parameter is needed. But you can also hand over existing documents or 4D HTML sources as parameters. 4. Button Define 2 Because a 4D Write area is an object you can also use the command New object to create an empty 4D Write Pro area. This is no special 4D Write Pro command, we will come back on this later. 2

5. Button Load document To not write all your documents manually you can import existing documents with the command WP Import document. This can be old 4D Write documents to convert or new 4D Write Pro documents stored on disk. 6. Modify the text and press button Save settings You can modify the documents and save it again. 7. Open saved document with e.g. TextWrangler and scroll to the end And of course you can see the modification in the newly saved document. Also in other programs than 4D. Also if it is not easy to read the content. Not all programs can read all document formats. 8. Create or open a record for table [Documents] with any new text, save and reopen As you know it from the old 4D Write you can bind a 4D Write Pro area in a form directly to a field in a 4D table to store your documents easily. Modifications are saved as far as you save the record. 9. Open structure editor and property inspector of field WP The field in the table is of type object. 10. Open input form of the table [Documents] The 4D Write Pro area gets the field name as expression. This is similar to the old 4D Write where the field name had to be the same as the name of the 4D Write plug in in the form followed by an underscore. 3

DEBUG THE CONTENT OF 4D WRITE PRO After the basics of binding 4D Write Pro with fields and loading or saving documents we want to have a look how to debug the content to check if it contains what we think it should contain. Sample 1 WP_Area_and_field 1. Open the record again and enlarge the input form 2. Button Trace Let s open the debugger. To speed up I prepared some things in the watch pane. Normally you cannot read the content of a 4D object because it is stored in an internal proprietary format. But in the debugger the information is stringified to read it easily. The first thing we see is the object field with the 4D Write Pro document itself. For a better display we can enlarge the list to see all of the content. What we see here are the standard settings for the document information, borders, background and some things more. But where is the content? Normally not visible. Because the content might be big containing pictures and formatting, it makes no sense to display it in the debugger. But look at the line above. I already showed you that you can use normal 4D programming with 4D Write Pro. Like ST Get plain text from the styled text commands to show you the raw text. Or ST Get text to give you the text with the span tags to format the text. That s great because you have a huge set of commands to use with 4D Write Pro. Sure, not all commands of 4D are working with 4D Write Pro. But all the commands that make sense to be used. 3. 1 st line, replace author empty string assignment by any other value And also this is great. If activated, you can use the object notation syntax to read and write values in 4D Write Pro objects by programming directly. We will use this feature again later. 4. Close debugger Here you see an additional way of displaying some information from the 4D Write Pro object. You can display some information in a text field object. You still want more and you want content? 4

1. Menu File, command Start demo, button Load HTML Document In this case we load the content of an 4D HTML document into a text variable and give this variable as parameter to WP New to show the content in an 4D Write Pro area. But how can we see the tags or formatting instructions inside this more complex document? 2. Button Upload HTML Source We export the content as 4D HTML source into the text variable displayed below. Nice formatted for debugging reasons. 3. Scroll down the source We have the document info. Next the definition of CSS, cascading style sheets. Followed by the background picture base 64 encoded. At the end we see some 4D programming language references to display the current date and the current time. Why do I say 4D HTML? 4D does not support HTML coming from any source. There are programs or editors accepting HTML not always well-formed or not always valid because of missing close tags and so on. And we have special content to include 4D specifics like e.g. 4D expressions. Therefore, we decided not to support HTML from any source. But of course, you can check with appropriate tools if the HTML is valid or not. And you have to be sure that there is only content understood by 4D. But nevertheless, 4D Write Pro is no generic HTML editor. 4. Scroll up, modify the padding 28 -> 128, button Update 4D Write If, for debugging reasons, you want to modify some content, e.g. the padding, then you can check immediately the modification in the 4D Write Pro area. We simply overwrite the previous content by the new content. 5

BRINGING CONTENT INTO A 4D WRITE PRO AREA Now we have a 4D Write Pro area on the screen and have seen different ways to create a document by importing complete documents or source coming from a variable. What else is possible to build up content without writing it manually? You might have noticed that there are only some special 4D Write Pro commands compared to the old 4D Write with lots of special WR-commands to build up content of documents. How can we do this? While talking about debugging I told you that you can use all 4D commands in 4D Write Pro, that make sense to be used. 1. Menu File, command Start demo, tab Read Rich Text On the left we have a 4D text field with styled text. 2. Button Show references We want to have a look at what is contained in the multi style text area. The same code that can be used to switch a styled text field to display references can also be used for an 4D Write Pro area. And you can see references to a variable, a project method, to 4D commands and to a table field. 3. Button To 4D Write Pro Also a styled text field can be the source for creating a new 4D Write Pro document. You see that all 4D references remain intact. But there is a light modification. The command number is included, that in case of switching the command language the references keep working. 4. Button Show values Switching back to values with the ST command also works. There is a small difference how the URL-link is displayed in 4D Write Pro than it was in styled text fields. But all keeps working. Keep in mind, all ST commands also work with 4D Write Pro. 6

4D COMMANDS COMPATIBILITY Which other commands from 4D are also usable? Lots of 4D commands. As I told you, all commands, that make sense. With the next sample I will show you a subset of possible commands. Here we use some commands from the chapters styled text, string manipulation and entry control. 1. Tab 4D Commands compatibility 2. Button Insert references We start with a new 4D Write Pro area with some styled text in it. The text is formatted by ST commands. In the text we search for the word some to make additional formatting. Please note the use of the string commands here. Next we insert different database expressions for a variable, a method, an url, a 4D command, a table field and a so called user link. This is a link where you decide what to do if clicked. Finally the whole text is highlighted. Up to now we only use one 4D Write Pro command WP New, all other commands coming from 4D and work with 4D Write Pro. No new commands to learn, use of these commands should be familiar. 3. Buttons Show references/values The result is the same as for the import of the multi style text field. You can see that the references are still living references. 4. Buttons Freeze and then Show references/values And as you know from 4D Write old you can freeze the references to get a static document that can no more change after it was saved. 7

5. Button Set alignment Lots of the commands from the objects chapter for getting and setting options are available for use in 4D Write Pro. Here I set and get the alignment of the selected text. A complete list of all available object commands can be found in the manuals. 6. Button Spell check Configuring and using 4D s spell checker is also possible for 4D Write Pro. The English spell checker complains about the German address. MIGRATE OLD 4D WRITE PROGRAMMING TO NEW 4D WRITE PRO And what about your old 4D Write programming? Nothing. It does not work anymore. The commands are no longer available. 1. Button WR Find As you can see here, WR Find can be rewritten easily with a handful of 4D commands. Writing a wrapper made no sense, because there are different approaches to rewrite the old code, depending on new internal ways of working and depending on your needs. Therefore, we decided to not bind resources for this task. And honestly, nearly no one asked for it. But to make your live easier the knowledgebase provides some often used utility methods rewritten in 4D code. 8

WORKING WITH OFFSCREEN AREAS The old 4D Write had so called off-screen areas. Created by the command WR Offscreen area these areas only existed in main memory. No display and no time wasted for visible rendering. These areas were very important and often used to e.g. build complete documents step-by-step without being displayed. When the document was finally created, it was displayed once by copying from the off-screen area to an on-screen area. A second use was to create or simply load a document for printing, add the correct address and print it automatically without any user interaction. Or to create a document that is send by email without any user interaction. Customers called the hotline and said: I need off-screen areas urgently but did not find them. Nothing easier than that. But maybe not clear to see. 4D Write Pro is based on and stored in objects. This is your off-screen area, a variable of type object in main memory. 1. Tab Offscreen areas 2. Button Load via offscreen area Differently than in old 4D Write there is only 1 command to define or load an 4D Write Pro area on-screen or off-screen: WP New. And you can use the same parameters or even no parameter to initialize the offscreen area. Transferring the content from the off-screen area to the on-screen area or if needed between different off-screen areas is simply done by OB Copy from the theme Objects in Programming. The result is the same is if you would work directly with the on-screen area. This was very easy. Let us have a look how it really works. 3. Button Clear, then button Create via offscreen area Now we want to do some work on the document and then even print it. Again, we load the HTML-text into an off-screen area. Then we extract the raw text and replace the HTML-content in the off-screen area by the raw text. To simulate some modification we create a range as subset of the content. Applied on the range we do some font size and text color settings. But you can also access the complete content without creating a range first, we use this to set a background color. Then it is printed from the off-screen area. Finally, after all the modifications, we want to see the result on the screen. The result looks a bit different because the printable area is smaller than the screen area. 9

4. Button Object notation You might think, working with all these commands is great. But to access objects with the new object notation would be more modern, better readable and easier to write. Yes, you can access 4D Write Pro as off-screen or as on-screen area with the new object notation. Easy to write, easy to read, easy to understand. But be careful, because the attribute names are case-sensitive. To avoid the trap of case sensitivity, you can use the object notation with square brackets. In this case you simply use the 4D Write Pro constants inside the brackets. And you might think that this notation is strange and no true object notation? No. It is no dot notation but true object notation. Look at JavaScript. The bracket notation is often used. Only with brackets you can use variable names as placeholders for attribute names. This is the only way for generic programming in loops. A last thing. What does not work at all or not work for the moment, are all the new standard actions of 4D and 4D Write Pro that you can call by programming with INVOKE ACTION. This command needs an area visible and rendered on-screen and so it cannot be used with off-screen areas. But maybe one fine day, also standard actions with off-screen areas can be possible. CONVERSION OF OLD 4D WRITE DOCUMENTS An important issue for you and your users is the conversion of old 4D Write documents. This issue is also very important for us. We try to convert old documents as good as possible, without any loss. To achieve that, we asked you to give us big und complex documents, documents with lots of different references and also documents that fail when you try to convert them. So we could take into account all presented problems. Let us have a conversion example. 1. Tab Document conversion 2. Button Load old 4D Write We have a simple document with some dynamic references and a nice picture inserted in the text flow of the page. We also have a header and a footer. In the header we have a logo inserted directly into the page. 3. Button Convert old 4D Write The conversion is very easy, simply call to the command WP New. The.4w7 -document can come from a blob or it can be a document on disk. 10

4. Buttons Show references/values All objects or the complete content from the old 4D Write document is present also in 4D Write Pro. The header and the footer are still there. No loss of content or quality. And the references remain intact and are still working. Normally the conversion should be no problem. But there are some restrictions or some issues, when a conversion might fail: 1. It does not work if your documents are still in picture fields. In this case, it is time now to change it in old 4D Write before the conversion. 2. The documents might have been created with a pretty old version of 4D Write and could contain bugs. In this case they have to be converted and/or repaired first with a current version of the old 4D Write, that fixes these bugs. 3. They contain old fonts. Old OS 9 fonts that are not True Type or Open Type. Such documents might use other fonts as replacement and the content might look differently in terms of line width, breaks and so on. But this is not a problem of the conversion. 4. They can contain old QuickTime pictures. In this case the pictures have to be converted first in old 4D Write with a version of 4D and under an operating system that still supports QuickTime. If not, the pictures are simply missing. 5. Your old documents are corrupted. Maybe it is not possible to open them in the old 4D Write. Then they cannot be converted to 4D Write Pro. But this is a general problem with very old documents. No matter with which program they have been created. This might also happen to Word documents, PDFs or security copies on floppy disks. Nevertheless. If you or your customers have documents making trouble, contact us. Send us the documents as external file with frozen references or with a structure containing the references needed. We will check what we can do for you. 11

USING TAB STOPS THE RIGHT WAY Setting tab stops in 4D Write Pro is easy. If you do it manually by interface. Doing it by programming is also easy. But because you can set two different types of tabs with one single command and different parameters you have to know what you do to get the expected results. 1. Tab Tab stops 2. Button Load On the left we have a very simple 4D Write Pro document to set some tabs. 3. Place cursor before 1 st line and press button Tab 1 Use WP SET ATTRIBUTES to set tab stops. Possible parameters are the tab position or also named offset, the type (left, right and so on) and if you want to have certain leadings characters. If you set a tab this way as a single tab offset value, you always set a so-called default tab for the selected line. A default tab is repeated after the given offset value till the end of the line. And a default tab is never visible in the ruler. This is the same behaviour as in old 4D Write. 4. Place cursor before 2nd line and press button Tab 2 We do the same for the two other lines of text. 5. Place cursor before 3rd line and press button Tab 3 6. Place cursor before 1 st /2 nd /3 rd line and press tab For the 3 lines we have 3 different tabs. 7. Press button wp -> debug text Let s have a look at the 4D HTML code. Here we have the 3 tabs in the css definition area. Left aligned tabs is always the default setting, so there is no entry for that in the definition. Keep in mind that default tabs are never visible. But what to do to see tabs? Then you have to set your own none-defaults tabs. 12

8. Button Load, select all and press button Set visible tabs You set your own tabs using arrays as value parameter for WP SET ATTRIBUTES. E.g. if you want to set 3 own tabs, you have to define these tabs in the first 3 array elements. The 4 th or last element always contains the value for the default tabs which will follow your last own tab. If you omit this last element because you think it is not needed, your last own tab in element 3 gets the default tab and is no longer visible. 9. Press button wp -> debug text And you can check the tab settings in the HTML code again. BOOKMARKS 4D Write Pro supports bookmarks. As you know a bookmark from a browser, it is a named link to a certain HTML page. Similar in 4D Write Pro, here a bookmark is the name of a certain part in your document. And a bookmark cannot only be text, it can contain all possible objects in 4D Write Pro. Without any information about styles and so on, only saying the information starts with character a and ends at character b. Or let me say you can select a part of a 4D Write Pro document by its name, without knowing where it is. Such a bookmark never existed in old 4D Write. 1. Tab Bookmarks 2. Button Load text with bookmarks On the left there is some text with bookmarks. But you cannot see any bookmark because normally it is no visible identifier of a text. 3. Button debug and select the bookmarks In the meta data of the HTML code you can see the bookmarks with their character range. No style information and nothing else. Using this character range you can manage bookmarks. 4. Button Get bookmarks There are some commands to work with bookmarks. You can create bookmarks, get a list of all bookmarks in the document, get the bookmark range as an object or of course delete bookmarks. Here we display all bookmarks of the document in a list box. 13

5. Select a bookmark in the list box A bookmark knows its character range. Using WP Get bookmark range you get the complete content of a bookmark as an object and work with it. Here e.g. we highlight the content of a bookmark in the document. Some more things to know: 1. Bookmarks can be nested, this is also shown in the sample 2. Bookmarks can overlap each other, this means that a certain content of a bookmark can belong to two different bookmarks. 3. And bookmarks are dynamic. If you insert or delete content into the bookmark range, the bookmark range is automatically adapted. CREATING DOCUMENTS FROM TEMPLATES I think most of you know or use the feature to create 4D Write documents from templates. This can be a template for the complete document and the user might add some text. But you can also use several templates for certain parts of a document like header, footer, body part 1, body part 2, letter part, invoice part or much more. In each case you store the templates in external 4D Write documents on disk or more convenient to have 1 record for each template or template part. Then, creating a document consists of loading records or opening documents from disk, copy the content, insert it into your document. This is repeated until your document is ready. Of course, you can do the same with 4D Write Pro. With a lot of template records and query actions. Or with a lot of disk documents and opening actions. And with a lot of copy and paste actions using the clipboard. By the way, I hate using the clipboard by programming because you modify the user content in the clipboard. So you have to take care of the content, save it and restore it after you are done. I don t want to show you how to implement this old way in 4D Write Pro although it is possible. I will show you a new way of working. Based on the new concept of bookmarks. Using bookmarks, you can have all templates or template parts in only 1 record or 1 document on disk. Access the bookmarked templates by names. This is very fast because it is indexed internally. You do not have to do several queries or open several documents anymore. And you do not need the clipboard any longer. 1. Tab Docs by templates We have already seen how to work with off-screen areas. For a better visualization I do this on-screen now. 2. Buttons Load text with bookmarks, Get bookmarks, Init new document You already know this bookmarked document. 3. Click any bookmark in the list box This is the text that we want to put into our 4D Write Pro area on the right side. 14

4. Button Build document append As we have already seen, WP Get bookmark range returns the content of the range as an object. But this bookmark range object cannot be inserted into the new document directly. First, with WP New we have to create a new 4D Write Pro document from this range object. In the right 4D Write Pro area we create a new empty range at the cursor position and then we insert the template document using WP INSERT DOCUMENT. Sounds complicated? A new product has a new way of working. Let me say with a mixture of ranges and documents. Understanding and following this way the creation of a document from templates is very easy. 5. Button Build document append with a different template Doing this several times we can build up our new document step-by-step. 4D Write Pro always inserts a break at the end of a template before inserting the new template. 6. Buttons Init new document and Build document prepend We can also add templates at the beginning of the text by defining the new empty range accordingly. 7. Buttons Init new document and Build document cursor If the user shall insert templates at the current cursor position, also this works. With WP Get selection we ask for the current cursor position. Then we create a new empty range at the current position of the cursor. Please note the object syntax used here to speed up working without extracting values using additional variables. For me this new way of creating new 4D Write Pro objects via templates is much easier than it was before. 15

CREATING DOCUMENTS DYNAMICALLY FROM SCRATCH A last thing we want to talk about is how we can create 4D Write Pro documents completely from scratch. Without using templates. Completely dynamic through programming. But before doing this, I have to tell you some more internal things or explain you how it works. Ranges within a 4D Write Pro document Let us start again with a bookmark. As I told you, a bookmark is a name for a selection of elements in 4D Write Pro. And we have seen, if you want to work with the selection itself, to move it or to format it or what else, you have to create a range from this selection of elements. This resulting range is an 4D object type. This range object is used as parameter for the 4D Write Pro commands or you can also access it by the new object notation. 4D Write Pro creates ranges for you through different commands like WP Get range from bookmark or WP Create range and some more. Such a range object can be the cursor position in the easiest case. It can also be: - A selection of characters - A picture - A complete table or also table rows, columns or individual cells - Or a mix of different elements in 4D Write Pro document And remember what I told you before when speaking about bookmarks and templates. If you want to insert such a range object into another 4D Write Pro document, you have to make it a 4D Write Pro document first by calling the command WP New. Different kinds of breaks From old 4D Write you know breaks. Also, 4D Write Pro supports breaks. The smallest break is the line break. The line break separates the text of a line into 2 lines. But it remains the same paragraph for formatting reasons. This behavior is differently compared to a manually inserted carriage return. But this is only of interest, if you write your text by programming. In this case you can also add a carriage return by code, if needed. But you normally do not write text by programming. I think you will insert templates. In this case 4D Write Pro inserts breaks automatically and then it should really not be needed. The next break is the page break, also known from old 4D Write. A page break starts a new page within the document. A document with 5 pages has 4 page breaks, inserted manually, by programming with WP INSERT BREAK or automatically at the end of a page by 4D. A page can be formatted individually based on paragraphs, differently for each page. What was never possible in old 4D Write and what is new in 4D Write Pro are the so-called section breaks. Or you can imagine this kind of break also as a kind of chapter break. This is a big step forward in usability for document management. Without a section break the complete document is 1 section. Each section break breaks also the page. But unlike a page range, which is always one page, a section can span over more than one page. Sections can be renamed, e.g. Introduction, Chapter 1 or Conclusion. A section can have its own headers and footers and own formatting for the complete section. 16

Clipping regions Let us finally talk about clipping regions or inserting pictures. For the moment there are 3 ways to insert pictures: - With WP SET ATTRIBUTE as a true background picture - As inline picture as a character in the text flow using the commands WP INSERT PICTURE or ST INSERT PICTURE - As an anchored picture with the command WP Add picture The true background picture is quite a new concept in 4D Write Pro. You can place it by coordinates or much easier by assigning it to a certain box, e.g.: - Border box, this is the maximum usable text area inside the page - The padding box is the region between the border box and the start of the text if padded - Use the content box to only place it behind the real text content - Or use the complete page, this option is only usable for sections inside a document To place a picture behind or in front of text at certain coordinates was also possible in old 4D Write. New is that there are lots of new standard actions or constants to use in programming to place a picture without knowing the coordinates. E.g. you can simply say put into the header, or in the footer or so on. This makes positioning very easy and dynamic. Headers and footers Headers and footers are accessed the same way in 4D Write Pro, than in the old 4D Write. There was a command WR SET FRAME, now you have a command WP SET FRAME. Sounds easy. Before all pages could have the same header and footer. But you could define that the header and footer on the first page are different than on all other pages. Now with sections in a 4D Write Pro document things have changed. Each section can have its own headers. Also differently between the first page and all other pages in the section. This means, that now you can have different headers on each page very easy, if you declare a section for each page. One last thing to mention is, that as also in Word only headers and footers can contain page numbering. This was differently in the old 4D Write. If you did this and convert your existing documents now, be aware of this. The place holder for the page number is no longer evaluated if placed in the document body. Now let us have a look at the last sample. 1. Tab Docs completely dynamic 2. Button Create documents completely dynamic Let us first have a look at the result. We have not only a two page, but a two sections document. Starting with a Big header line, some text and some tables inserted. The tables have no data. The point was to show how to mix different objects in one page, not how to create nice tables as a new 4D Write Pro feature. This is not the topic of this session. And last but not least a picture in the page. After the section break we have a second section on page two. Containing a title, some dummy text and also a picture, this time as paper filling picture behind the text. 17

3. Design mode, form Form, OM of the button This is the first big method in this sample. But don t be afraid. Half of the lines are constants for better understanding. Let s take a closer look to compare, how document creation from scratch is done today with 4D Write Pro. As I told you before I always load in initial template for all my 4D Write Pro areas (4). The template has settings like: - Show ruler or not - Show invisible chars or not - Switch to page view - And what alse you might need So I save time and work to do all these initial settings again and again. Next I focus on the header and insert my page numbering (7 10). In all 3 frames the character counting always starts at position 1 when empty. Of course this could also be contained in the template. The same I do with the footer, only to show (13 16). This is followed by an initial ST COMPUTE EXPRESSION (19). This is needed always as let me say initial page counting start. If your page numbering should display wrong values, you forgot this. We set the focus to the body. With ST SET TEXT I insert the title text first (25). Then this text is defined as a new range in the document (28). As you might know from text processors the formatting is stored in the line break character and taken over for the next line. Therefore, I format the page title later, to let to following lines unaffected by any formatting. At the end of the range 2 line breaks are appended (31/32) and I insert the next text as table title (35). Now I format the title for the first page to bold (38). 18

Again, I adjust the range to contain all added text in the body range for the complete content (41), insert a new line break (44) followed by a first dummy table with some columns and rows (47) and again a line break (50). To get a bit more content for the first page I repeat all this for a second table (53-62). For a nicer layout I insert a picture from a picture field using WP Add picture (66). The picture is anchored in the first page (67), with a certain size (68/69) and horizontally and vertically centered (70/71). Followed by a section break (74), to not only have a new page but a range that can easily be formatted as 1 block of text, separately from page 2. Here I start again with a title text (77). This time I do the formatting a bit different. From the range object I read the start and end position of the page 2 title by object notation for later use by object notation (80/81). I define a new range for filling the second page (84), formatted again 2 line breaks (87/88), some more dummy text to fill the page (91) and then I format the title (94). I insert a picture, the same picture as before, but this time as a real background picture (98). Because I have defined 2 sections, I can now insert this picture to the paper box to have a full format picture without any visible frame (101/102). I size it to fill the whole paper width (104) and let it be drawn repeated to fill the page (106). The next is a bit tricky. You cannot see it but in fact the picture is inserted in the background of all pages in all sections. This is the way it works. To avoid this, I select section 1 on page 1 (109) and switch the picture off (111) by calling a standard action. As I told you, for the moment this only works when having the 4D Write Pro area visible in a form. Therefore I did it this way. And the last step is, printing quick and dirty. Without any programming to avoid dialogs. This is as easy as printing before with the old 4D Write with one single command (116). CONCLUSION I hope that you got a short but deep view into the new 4D Write Pro. Yes, the new way of working is different from the old 4D Write, but not completely strange or unknown. And yes, there is an effort of migrating your old code or your old way of working to the new product and the new internal way of working. But it is straight forward, easy to do and very powerful, because you can use a bunch of 4D commands with 4D Write Pro. I recommend that you start your conversion now. If you think that you miss some feature, ok. Nevertheless, start now. Conversion is not done within a day and enough features are available now to start. Don t wait with the replacement until the operation system forces you because 32 bit is abandoned. And yes, 4D Write Pro also works with 4D 32 bit, so you can use both in the same application while conversion. 19