 Introduction

Navigation: »No topics above this level«

Introduction

 Print this Topic Return to chapter overview

TAS Professional powered by CAS (Computer Accounting Solutions) is designed to be a complete application development tool for graphical operating systems. It provides application building tools for the programmer new to application development, as well as the seasoned developer demanding professional quality development tools designed to work together from the beginning. These powerful utilities and features include:

· Data Dictionary Manager
· Codebase & Btrieve databases direct access support
· Database maintenance programs
· IDE Summary
· Form Editor
· Report Editor with barcode support
· Source Code Editor
· Runtime Compiler
· Skins Editor
· Install Builder
· Auto Resize of forms
· over 50 Screen objects
· Spell Checking
· Skins over 50 pre built skins to choose from.
· MAPI Support. Send email from your applications using programs like Outlook© and Outlook express©.
· POP3 Support. Send and receive email in your TAS Professional applications.
· Shell Support with file association
· Serial port support
· FAX Support
· PDF file support. and many other formats.
· Automatic MDI (Multiple Document Interface)
· Plugin This allows you to add your favorrite program right to the TAS PRO IDE.
· Advanced Memory Management (as of version 7.2 build 4)
· SQL allows you to work with SQL databases like MYSQL,MS SQL Ect.. (As of 7.2 Build 4)

TAS Professional includes a very powerful IDE over 150 commands, each with many options, and over 230 functions that can be used in expressions. Many of the TAS Professional commands can be compared to macro functions found in other high level languages. In other words, a single TAS Professional command can often replace several entire lines in other languages. Add to this the ability to create User Defined Commands (UDCs) and User Defined Functions (UDFs), and you now have a very powerful development tool.

Currently, TAS Professional runs only on the Windows© operating system, however, in the future we plan to run on Linux systems and directly on the Internet. Due to the design of TAS Professional, any programs you create to run on Windows© will run, without change, on these other platforms also. You will be able to change database managers at will. You won't even need to recompile the programs! This means that from the same set of programs you can have some users running Windows© some running Linux©, maybe others on platforms to come, and all can be running the exact same set of programs accessing the same database.

What TAS Professional isn't? You're not going to write an operating system with TAS Professional. It isn't meant to replace programs like C++ or Delphi©. It was designed to give you the capabilities to easily and quickly develop general purpose business/financial programs with a graphical user interface (GUI). So, TAS Professional is also much easier to learn and use than C++ or Delphi©.

Programs compiled using TAS Professional require a runtime program (TASRUNTIME.EXE) to execute. This reduces compilation time to a fraction of what's required for those other languages and produce very small runtime programs. Instead of multi-megabyte executable's, you end up with a program that might be 50,000 bytes. It's this runtime program that gives you the ability to run the same program on multiple OSs, different platforms, eventually even totally different computer types with no changes required. Our term for this is: "Real write once/run anywhere." Truly, you'll only have to write it once, and you'll really be able to run it anywhere when have an appropriate runtime.

One of the reasons TAS Professional is so flexible and powerful is that it is built around a Data Dictionary. The Data Dictionary is a special TAS Professional data file that is used to keep track of every specification of every field in every record and file you create. This means that once you define a field you never have to worry about defining it again. Each time you want to use that field in a program, TAS Professional automatically looks up the specifications in the Data Dictionary. Storing the specifications in this way greatly increases the ease and speed with which you can create multi-file applications. By using similar fields with the same characteristics in different files, you can retrieve related records, such as finding all invoice records based on a given customer code.

TAS Professional uses Btrieve (copyright Pervasive Software) or Codebase (copyright Sequiter Software) to perform all data file I/O, record and file locking in a multi user system. A significant benefit of either of these is speed. With TAS Professional you can typically find any record in a data file in one second or less. With smaller databases, finding a record can be almost instantaneous. Saving or updating records is equally fast. In addition, the speed is consistent regardless of the file size. It takes virtually the same amount of time to save a record in a file with 100,000 records as it does in a file with 1000 records. Even more important, you aren't forced to have a dedicated server with expensive software. In fact, if you have 5 users or less you don't need a dedicated server at all, unless you choose to. We hope in the future add more databases for the programmer to use like MYSQL, Firebird, interbase, Access and others. This will add even more to the flexibility and power.

TAS Professional allows up to 24 different sorts (keys) to be maintained on-line for each data file. With TAS Professional, you never have to re-sort a data file just to find a record.

Since June of 2003 Computer Accounting Solutions (CAS) purchased the right to copy (Copyright) license to TAS Professional and Advanced Accounting. Portions ©1984-2003 MGM Holding, Inc.

We have taken up where the creator of TAS Professional (Phil Mickelson) left off. Phil decided after 20 years of writing software he would retire from software development. We at CAS wish him well and thank him for his dedicated work over the past 20 years on this software. We hope we can keep TAS Professional alive and growing. For all of us that have used and grown to depend on this software to serve the end users of our programs. Also for future programmer's that want a fast easy to use tool to build professional database solutions.

We hope to continue this work for many years to come and make TAS Professional powered by CAS an ongoing development project. We hope to be adding more features to this programming tool for many years to come. If after purchasing and using TAS PRO you have any recommendations for the product we look forward to hearing from you. If needed TAS professional powered by CAS can be customized to fit your needs.

You can email us at support@cassoftware.com We also have a free email support system setup for your use where you can talk to other TAS Professional programmers around the world. Even advertise your services or products as long as they have something to do with TAS Professional powered by CAS.

Here is the link to our email group Button

We look forward to working with you.

The Staff at Computer Accounting Solutions


File name changes Ver 6 to Ver 7

Navigation: Whats New >

File name changes Ver 6 to Ver 7

 Print this Topic Return to chapter overview

TAS Professional Powered by CAS. Since version 6 released from BTI has many new features as well as stabilization of the entire system. Most of these changes are internal in nature but on the outside we have made some program name changes you as the programmer need to be aware of.

Name Changes after release if TAS Professional powered by CAS as of version 7.1 Build 9.

TAS professional 6 filename NEW TAS professional 7 filename

TAS IDE/Compiler TAS6.EXE TASPRO7.EXE When you run this program in a folder it will re-name the TAS7.ini to taspro.ini.

TAS Runtime TP6RUNTIME.EXE TASRUNTIME.EXE When you run this program in a folder it will re-name the TAS7.ini to taspro.ini.

Developer Setup TP6SETUP.EXE TP7SETUP.EXE

Runtime Setup TP6RTSETUP.EXE TP7RTSETUP.EXE

TASEXECUTER TPEXECUTE.EXE TASEXECUTE.EXE Note: use this program to run TASPRO on multiple projects so for development you only need one copy of TAS Professional on your system.

TASPRO INI file TAS7.INI TASPRO.INI when using the IDE/COMPILER the runtime or the TAS Executer the program will upgrade your TAS7.ini file to the new name TASPRO.INI you have in your systems.

Documentation

HTML HELP N/A TAS7DOCS.CHM New help format as of version

TASPRO HELP TP6DOCS.HLP TAS7DOCS.HLP
Help CNT TP6DOCS.CNT TAS7DOCS.CNT
PDF Manual TP6DOCS.PDF TAS7DOCS.PDF

Report painter RBDsgnr.exe RBDsgnr.exe no change

CodeBase reindex TP6RNDXCB.EXE TASRNDXCB.EXE

Btrieve re index TP6RNDXBTRV.EXE TASRNDXBTRV.EXE

There are no database or dictionary changes in this upgrade. We have tried to make these filename changes and programs so they will do automatic upgrade to the new taspro.ini file for you. If you have any questions please feel free to email your questions to us at support@cassoftware.com All other features and functions added to the system are documented in this publication.


 What's New in TAS Professional Powered by CAS

Navigation: »No topics above this level«

What's New in TAS Professional Powered by CAS

 Print this Topic Return to chapter overview

New Features added to TAS Professional 7.7.2 Powered by CAS. have been done after we started releasing version 6.16 released 07/01/03 - current.

The program is now Shareware! So please share your experience with others to help promote the use of this programming tool. We have introduced this program into the user supported sector of shareware. The software is not free. Thru annual support and unlimited no-nonsense runtime distribution. We hope this will make our program more attractive to new programmers and our long time supporters of the program.

NEW pricing TAS Professional powered by CAS developer is a user supported program.

Annual support to help keep TAS professional development on a forward moving basis is still $200 per year. Without your continued support TAS Professional can not grow so please support us so we can support you. This $200 annual support fee also includes a single company runtime and more single runtime's can be purchased for $99 each.

Unlimited runtime available for only $399.00. With this licence you can deploy your TAS PRO powered by CAS programs to your end users with no more royalties. Note : Annual support for TAS is still $200 per year.

Program History

Fixed Round function to use simple rounding. 7.7.2

Made more changes to error/Warning messages to help the programer find there problem. this is an on going effort 7.7.2

made changes to Openv to allow strange file names like myfilename.xxx.txt 7.7.2

made changes to Openv to better support B type files. 7.7.2

Made changes to TasDataDataGrid added AltColorRows 7.7.2

Made other changes to TasDataGrid to make it a better tool for data entry.7.7.2

Made a change to IfDup and record looking problem 7.7.2

Made more changes to correct for Zorder problems. seams this is an ongoing project. 7.7.2

Updated TAS IDE screens for windows 7 Both EXE and RWN programs.

Updated all TAS utility programs to use correct screen whne using dule monitors hope we got hten all. 7.7.2

The dreaded Zorder problem when using the Chain NEWRUNTIME has Finally been fixed. as of version 7.7.1

The Report preview screen can now be controlled in the taspro.ini 7.7.1

More example code in the Help system. Extensive work in the areas to help all levels of programmers. 7.7.1

More speed in execution.

Better Error messages to help the programmer find there problem in the programs.

NEW !!! AUTOINC field (type U) (New since version 7.6)

1000's of changes in the last Five years to both the IDE and runtime to make TAS Professional Powered by CAS the most stable and powerful public release of the program to date.

New Graph Support using new TAS2EXCEL.DLL and TAS2XLS.DLL from Aura Soft at Button with this set of DLL's you can update data in excel worksheet to produce graphs and other reports from excel sheets. This is an add on to TAS Professional to extend There is a demo of this on our website.

New Support for HTML Help system we now support both (.HLP) and (.CHM) See the command. As of version 7.4. We did this because Microsoft is no longer supporting (.HLP) files.

Choice of Data dictionaries options added to TASPRO as of version 7.4 see TASPRO.INI Explained.

As of version 7.4 the can be used to copy information from this screen into the current source code editor. Just double click on the file, Field or key and it will be copied into your current source making this feature a powerful lookup tool for your programming.

ADO / ODBC Support – Need to access live data that isn't stored one of the two supported database formats in TAS Professional format? Not a problem. With ADO and ODBC you can now use TAS Professional to view, edit, and modify data in virtually any format. Connect to MySQL, Oracle or MS Access databases and tables. Even MS Excel spreadsheets can be used as a live data source. See the new SQL example included and the SQL() function. More you can now use up to 10 datbase sources.

Complete documentation of new features in .PDF and .CHM systems and full current up to date DOCS on our website. All TAS programs TASPRO7.EXE, TASRUNTIME.EXE and TAS Exicute now use TP7DOCS.CHM file. We are abandoning the .HLP format since Microsoft is no longer supporting the .HLP format in the new Vista Op systems. You can still use the .hlp format if needed in your programs.

NEW Automatic MDI (Multiple Document interface) after ver 7.2

Better control of windows using a main menu. and Child relationship.

NEW Plug in feature - add your own programs to your TAS Professional IDE.

New Display format feature and a new object called TppDBCalc in the report painter.

Legacy fix for focus on dates has been fixed.

NEW CREATE_Btrv Function This new function is like the old tas3 init file. with this new function you do not need to use the wtasinit program to init your files.

Fixed read only property in TTASdatagrid this will now allow you to better use grid to enter data direct into grid. as of ver 7.6. New header.click event.

New sample programs folder

We have added a new folder in the installation of TAS PRO in here you will find example programs to show you show to use some of the features in TASPRO. Email test and Spelling are now in this folder. More will be added.

new program to demonstrate new objects in TAS Professional powered by CAS.

New Program installer TASPRO now comes with a free program installer called GP-Install this is the same program we use to deploy our programs so now TASPRO is an even a better all in one package for the software developer.

New Bitmaps

We have added 250+ .BMP files to help you in programming your applications. Files are located in the new folder called bmp.

Skins

You can now use in dependant skins to set your applications apart from other programs. There is a new folder called skins where we have put some 50 new looks your programs can use.

Skin Builder

With this program and a graphics editor you can customize your own skins. With one function call you can change the entire look of your program.

Spelling

Spell checking has now been added to both the IDE and also available for you in your compiled TAS Professional programs. Dictionary support many languages we are very proud of this feature. Dictionaries Configure Spell Check Spell_Checking

Program editor and Screen Painter now support ^S = Save ^O = Open

Dynamically print pictures in your reports

NEW Auto Resize forms after 7.1 Build 7

When this new feature is used on a form when the user resize's the form all objects on the form will scale to the correct size making TAS Professional powered by CAS forms can be resolution independent.

New Graphic file format support for Forms and Reports.

Here is a list of supported image formats.

· TIFF images (*.tif; *.tiff), extended base line implementation
· 1..16 bits per sample
· indexed, grayscale, RGB(A), CMYK, L*a*b*
· uncompressed, packed bits, LZW, CCITT T.4, Thunder scan, Deflate, new style JPEG
· GFI fax images (*.fax), uses TTIFFGraphic to read
· SGI images (*.bw, *.rgb, *.rgba, *.sgi)
· 1..16 bits per sample
· indexed, grayscale, RGB(A)
· uncompressed, RLE
· Autodesk images files (*.cel; *.pic) old style only
· 8 bits per sample, indexed and uncompressed
· Truevision images (*.tga; *.vst; *.icb; *.vda; *.win), write support included
· 5 and 8 bits per sample
· grayscale, indexed, 15 bits RGB (555), 24 bits RGB(A)(888)
· uncompressed, RLE
· ZSoft Paintbrush images (*.pcx, *.pcc; *.scr)
· 1..8 bits per sample
· grayscale, indexed, RGB
· uncompressed, RLE
· Kodak Photo-CD images (*.pcd)
· 8 bits per sample in YCbCr in any resolution (192 x 128 up to 6144 x 4096)
· Portable pixel/gray map images (*.ppm, *.pgm, *.pbm)
· 1 and 8 bits per sample
· grayscale, indexed, RGB uncompressed
· Dr. Halo images (*.cut, *.pal)
· 8 bits per sample indexed, RLE compressed
· CompuServe images (*.gif)
· 1, 4, 8 bits per sample indexed, LZW compressed
· SGI Alias/Wavefront images (*.rla, *.rpf)
· 8 bits per sample RGB(A), RLE compressed
· Standard Windows bitmap images (*.bmp, *.rle, *.dib)
· Photoshop images (*.psd, *.pdd)
· 1, 8, 16 bits per sample
· indexed, RGB, CMYK, CIE L*a*b*
· uncompressed and packed bits
· Paintshop Pro images (*.psp)
· 1, 4, 8 bits per sample
· indexed, grayscale, RGB
· uncompressed, RLE and LZ77
· single-layered files only!
· Portable network graphic images (*.png)
· 1, 2, 4, 8, 16 bits per sample
· indexed, grayscale alpha, RGB(A), LZ77 compressed

New Captions

Editor for spell check.

New Items property

editor for spell check.

New Lines property

Editor for spell check.

New Hints Property

Editor for spell check.

IMAP

(internet mail application protocol) has now been added to the program This allows you to use the default email program on each users computer like outlook and outlook express or any email program the client may have that supports this protocol.

Shell commands now supported in the EXEC command.

This allows you not only load windows program but you can do things like this. There is also a wait and check wait option. With full windows file association.

button1.click:

exec 'mailto:rick@cassoftware.com'

ret

Some of the new Commands and functions

NEW File_Attrib() function

NEW Dir_Exists() function

NEW Is_Leap_year() function

NEW INC_MONTH() function

NEW Days_in_Month() function

NEW HashFile() function

NEW ENCRYPTSTR() function

NEW DECRYPTSTR() function

NEW RANDOMIZE command

NEW Wait command

NEW Create_Btrieve() Function

NEW Edit_RTM command With a register runtime you can call the TASPRO report builder from the runtime.

NEW Change_skins() Function

NEW LockedUser() Function

NEW X_Charge() Function New Credit Card Processing Using the X Charge Interface.

NEW WTREE Command

Program Install Builder

With this program when your ready to deploy your TAS programs. You can use this program to build professional looking program installs.

25 New Objects

Analog meter

Angle label

Animate

Color Button

Control bar

Date Label

Form fill

Gradient Panel

Percent Progress Bar

Running label

RX Label

RX switch

Speed button

Spin Edit

Split Panel

Scroll box

Calc Edit

RTF MEMO

TTASZIP

TTASUNZIP

TTASWEB

TTASTREEVIEW

TTASTREENODETEMPLATE

TTASFRAMPANEL

TAS Professional powered by CAS is an on going work and we will be adding new feature to this all ready powerful programming tool. However this development costs our development team time and money and we would like you to do your part by supporting us with our annual Support program. It's only $200 per year and is a small price to pay for on going development of the TAS Professional powered by CAS project.

With your help we know TAS will keep growing thank you all for your continued support.

TAS Professional powered by CAS development team.


Product Support

Navigation: »No topics above this level«

Product Support

 Print this Topic Return to chapter overview

Computer Accounting Solutions. has provided you with complete documentation to assist you with the operation of the product. However, if you have questions, unexpected problems, update requirements, or a product return, you must initially contact the place of purchase. Please review the following support policies and procedures before requesting assistance.

Before contacting product support we recomend you do the following.

1) We recomend you first try our free email based mail list. to logon and get accesss to help from not only CAS but from other programmers just like you. log onto our web site and sign up for the taspro user group. There is a link to this free service on our web site at www.cassoftware.com.

2) Review your manuals thoroughly.

3) Have your product serial number ready (the number can be located on your original diskettes or in the about button).

4) Have your invoice number and date of purchase available.

5) Designate a single point of contact for dealing with product support. If that's you, please be located in front of your computer, with the computer on and the software loaded, if possible. You need to be ready to work with the software.

6) Have your manuals within reach.

Basic Support Program

Source: Computer Accounting Solutions

Fee: No Charge

Length

of Agreement: 30 days (from date of purchase) or a maximum of 2 calls.

Purpose: To assist in the installation of TAS Professional powered by CAS.

Enrollment: Automatic

Support Hot lines: 9:00 am - 5:00 p.m. PST or PDST

Monday through Friday

(928)257-1236 or via email at support@cassoftware.com anytime. We aslo use skype for phone calls you call is for free get skype at http://skype.com our skype address is rickatcas.

Regular Support Program

Regular support is provided via email at support@cassoftware.com. We do our best to answer all questions as quickly as possible. And, if someone is available after normal business hours or on the weekends, we will do our best to answer any and all questions. This also includes all updates and new features that have been released for the basic product.

Source: Computer Accounting Solutions.

Fee: No Charge

Purpose: To assist in the ongoing use of CAS products.

Enrollment: Registered User

Support Hot lines: 24 hours a day, 7 days a week

email: support@cassoftware.com

Annual Support Renewal

Your initial purchase includes Basic and Regular support for the first year. Thereafter, you may renew the Regular Support Program for $200 per year. This includes unlimited email support as above and all updates and enhancements that have been made to the base product (see Update Procedures below). Rather than charge for upgrades, this fee covers both the support costs and upgrade fees you would normally pay once a year or every couple of years.

Your license for TAS Professional powered by CAS never expires. Once you have purchased a copy of TAS Professional powered by CAS, you will be able to continue to use it as long as you are in compliance with the license agreement. However, if you don't renew your support you will not be able to get support via email or updates/enhancements to the product.

Update Procedures

Updates and enhancements are always available on-line for TAS Professional powered by CAS. As long as your license is in renewal you will be able to update your programs anytime you wish. This link will take you directly our web site www.cassoftware.com . Follow the instructions once you get there.

The updates provided will have their own install routine. The updates will be accumulated for an entire year. So, at any time, you should be able to download the updates and have the latest version with a minimum of effort.

Premium Support Program

If you'd like the security of being able to call and talk directly to technical support, this is the program for you.

Source: Computer Accounting Solutions.

Fees: Per Call - $2/minute - 15 minute minimums - no maximum

Pre-paid blocks:

90 minutes/18 months, no minimums . . . . . $ 150.00

3 hours/3 years, no minimums . . . . . . . . . $ 270.00

10 hours, must use in same year period . . $ 750.00

Method of Payment: VISA, M/C, PayPal or Check (pre-paid).

Purpose: To assist in the ongoing use of CAS products.

Enrollment: Registered User

Support Hot lines: 9:00 am - 5:00 pm PST

928-257-1236

For more information please contact Computer Accounting Solutions directly. Computer Accounting Solutions is also available for modifications to TAS Professional powered by CAS.

Product Returns

Once the product is license (a license has been delivered via email) the product can no longer be returned.)

If you have purchased this product from a dealer (not directly from Computer Accounting Solutions.) you must make any returns to that dealer. No returns will be accepted more than 30 days after date of purchase.


SOFTWARE LICENSE

Navigation: »No topics above this level«

SOFTWARE LICENSE

 Print this Topic Return to chapter overview

SOFTWARE LICENSE AGREEMENT

YOU HAVE NOT PURCHASED THIS PRODUCT. WE ARE OFFERING YOU A LICENSE TO USE IT. THIS PAGE CONTAINS OUR PROPOSED LICENSE AGREEMENT, AND YOUR ACT OF INSTALLING THE PRODUCT IS YOUR ACCEPTANCE OF ITS TERMS.

Products: Software, by which we mean the computer program and documentation that are part of this installation file, including any updates to it which we may later provide to you, any backup copies made, and other materials included in the file.

Terms: This license agreement is effective on the effective date which shall be the day you install the software, and shall terminate if and when you breach any term of this agreement, if you return the products to Computer Accounting Solutions, or upon the passage of fifty (50) years following the effective date.

The license screen that is displayed when the product starts contains a Renewal Date. Until the end of that date you will be provided with unlimited support via email with CAS. You will have the option of signing up for a support listbot or communicating direct, or both. At the end of that date you will be provided with the opportunity to renew your license for a fee to be determined at that time. If you don't choose to renew you will no longer be able to get support via email and you will no longer be able to update your current product. However, you will still be able to continue using the product you have for the full length of the term as stated above.

Computer Accounting Solutions' Rights: Although you are being given the right to use these materials by this license, you acknowledge the validity and ownership of the trademarks, tradenames, copyrights and other proprietary rights of Computer Accounting Solutions, as such exist under the laws of the United States. If source code is included in this package, you acknowledge that it is the confidential information of Computer Accounting Solutions and you agree to protect it as such and not to disclose it to anyone in either

whole or part.

Support: As long as your license is active you can get email support direct from CAS. Phone support is also available at an additional fee. All updates and upgrades to the Software are included as long as your license is active.

Your Rights: Computer Accounting Solutions grants you a non-exclusive license only to use the Software within a single company, on the computers owned by that company only, and to copy the Software into machine readable form for back-up purposes only. You may not otherwise copy or use the materials in either whole or part. You may not lend, lease, rent, sub-license or otherwise transfer the materials or your rights under this license. You may not translate, decompile, disassemble or convert the Software into another programming language, or produce derivatives of the Software or other included materials. If you are going to resell your programs you must ombtain a copy of TAS Professional powered by CAS or purchase end user runtimes for CAS.

There is no limit to the number of computers or programmers that may use a single license as long as all those computers are owned by the same company and all of the programmers work for that same company. If you own multiple companies and plan to do development in each of those companies, you must have a separate copy/license for each company.

That company is the one named in the license screen that is displayed when the product starts.

Limited Warranty and Liability: No dealer, distributor, company or person has been authorized to changed or add to the terms of this agreement, and Computer Accounting Solutions will not be bound by any representation to the contrary.

COMPUTER ACCOUNTING SOLUTIONS LICENSES THIS PRODUCT TO YOU "AS IS" AND DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE PROGRAM WILL MEET YOUR REQUIREMENTS, OR THAT THE OPERATION OF THE PRODUCT WILL BE ERROR FREE.

Computer Accounting Solutions does warrant that if provided the diskette and printed materials are not defective in workmanship or material for a period of 60 days from the effective date of this agreement. Computer Accounting Solutions will replace any defective product returned during such limited warranty period.

THE WARRANTIES AND REMEDIES SET FORTH IN THIS SECTION ARE EXCLUSIVE AND IN LIEU OF ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, BY OPERATION OF LAW OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE AND IN NO EVENT SHALL COMPUTER ACCOUNTING SOLUTIONS BE LIABLE FOR ANY LOSS, DAMAGE, OR INJURY OF ANY NATURE, WHETHER DIRECT OR CONSEQUENTIAL, EVEN IF CAUSED BY COMPUTER ACCOUNTING SOLUTIONS NEGLIGENCE OR FOR ANY CLAIM OR DEMAND AGAINST LICENSEE BY ANY PARTY IN CONNECTION WITH OR RESULTING FROM THE LICENSING OR USE OF THE PRODUCTS. COMPUTER ACCOUNTING SOLUTIONS LIABILITY FOR DAMAGES REGARDLESS OF THE FORM OF ACTION SHALL NOT EXCEED THE PURCHASE PRICE OF THIS LICENSE.

Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages so the above exclusion and limitation may not apply to you.

Governing Law: This agreement shall be construed under and governed by the laws of the State of California and the United States of America.

Severability: In the event that any one or more of the provisions or parts of any provisions contained in this Agreement shall for any reason be held to be invalid, illegal, void or otherwise unenforceable in any respect by a court of competent jurisdiction, the same shall not invalidate or otherwise affect any other provision hereof, and this Agreement shall be construed as if such

invalid, illegal, void or unenforceable provisions had never been contained herein.

ONCE THE PRODUCT IS REGISTERED TO YOU, YOU WILL NOT BE ABLE TO RETURN IT TO CAS (OR YOUR DEALER) FOR A REFUND.

Copyright (C) Computer Accounting Solutions 2003 - 2009 All Rights Reserved.

Portions (C) Copyright MGM Holdings Inc. 1984-2003 All Rights reserved.


Please Register

Navigation: SOFTWARE LICENSE >

Please Register

 Print this Topic Return to chapter overview

You should register! or update your annual support.

Only through your support can we continue to provide high-quality software and support at reasonable prices.

Your Support helps the continued development of TAS Professional powered by CAS and helps us to continue to improve and enhance and support this already powerful set of programming tools.

If you registration is up to date. You will not see this stupid screen.

So please support the developers of TAS Professional powered by CAS and please pay the annual registration fee.

Thanks for your support.

How to register

To register TAS professional powered by CAS or you can call us at 1-800-358-4222 International at 1(928)257-1236. You can also register on our online store at www.cassoftware.com

Our office hours are 9:00AM - 5:00 PM Arizona Time M-F.

Or Email us at support@cassoftware.com

Annual registration and support is $200 per year. This entitles you to one personal runtime and all updates and upgrades to the program for one year to be used by one company. If you need more of these Licences you can purchase single runtime's for $99 each.

You can purchase an unlimited runtime for $399.00 this will allow you to distribute as many TAS Professional powered by CAS runtime's to your customers as you need this is a one time fee. Support / updates and upgrades are still $200 per year.

After you register

CAS will send you your registration code by email. To register start the TAS Professional IDE click on menu item help -> register. You will see the following screens.

Enter the access code and your company or personal information by using copy and paste from the email we send you.

If you have trouble feel free to email us at support@cassoftware.com and we will help you if needed.

Note: this is your registration code you need to save this incase you have to reinstall TAS Professional.

Thank you in advance for your support.

The TAS Professional powered by CAS development team.


Sizes and Numbers

Navigation: System Specifications >

Sizes and Numbers

 Print this Topic Return to chapter overview

Maximums (all sizes in bytes/characters unless otherwise given):

Single field size (string, A type): 4gb

Number of array elements in any one array: 4gb

(all arrays are single dimension)

Record size: 64k (Btrieve)

2gb (CodeBase)***

Number of keys per record: 24 (Btrieve)

47 (CodeBase)*

File size: 4gb (Btrieve)

8gb (CodeBase)

Number of fields per record: 255**

(an array field counts as one field)

Number of files opened per program: 255

Number of fields per program: 65,535

(an array field counts as one field)

Size of DEFINEd data per program: 4gb

Size of single source code module: 4gb

Size of compiled constant section: 4gb

Size of compiled code section: 4gb

Length of a single source code line: 64k

Number of nested structures: 20

(each type separately)

Maximum number of nested CHAINed programs: Limited by Memory

*Even though the number of keys is more in CodeBase your programs are still limited to 24 in this version. Once a transition is complete from Btrieve to CodeBase many new features will be added that only apply to CodeBase.

**The maximum number of fields in CodeBase is 2046, however, each array element is considered a discrete field.

***The current maximum record size is 64k for both Btrieve and CodeBase.


Mathematical Operators

Navigation: System Specifications >

Mathematical Operators

 Print this Topic Return to chapter overview

The symbolic math operators allowed in order of precedence are:

^ Exponentiation
* Multiplication
/ Division
+ Addition
- Subtraction

You can alter the order of evaluation by nesting expressions in parentheses.

Mathematical operators for strings (A type fields):

+ Concatenate two strings together.
* Will trim the trailing spaces of the first field before concatenating the strings together.
<< Will Concatenate a number and a string(A type fields) and trim the leading spaces of the second field. (New since ver 7.2 build 1)

EXAMPLES

3 ^ 2 = 9

3 * 2 = 6

4 / 2 = 2

3 + 2 = 5

3 - 2 = 1

3 + 2 * 1 + 4 = 9

(3 + 2) * (1 + 4) = 25

'ABCD ' + 'EFG' = 'ABCD EFG'

'ABCD ' * 'EFG' = 'ABCDEFG'

'This is a number '+100 <<' End of Comment' = 'This is a number 100 End of Comment'


Boolean Operators

Navigation: System Specifications >

Boolean Operators

 Print this Topic Return to chapter overview

These are used in logical expressions and can only affect the logical values, .TRUE. or .FALSE. All Boolean values start and end with a period. There must always be a space before and after the operator in any expression. Here are the Boolean operators in order of precedence:

.NOT.

.AND.

.OR.

The .NOT. operator basically inverts the truth value. For example, .NOT. .TRUE. is equivalent to false (or .FALSE.). The .AND. operator only returns true if both arguments are true (.TRUE.). Thus .TRUE. .AND. .TRUE. would return .TRUE. The .OR. operator returns true if either argument is true. More examples are given below. Please note that you can alter the order of evaluation using parentheses; nest the operators in parentheses if you want to be completely certain.

COMMENTS

The operators/values .T., .F., .N., .A. and .O. can also be used instead of .True., .False., .Not., .And. and .Or.

NOTE: You can use True and False without the leading and trailing periods also, but just for those two Boolean values.

EXAMPLES

.FALSE. .OR. .FALSE. = .FALSE.

.FALSE. .AND. .FALSE. = .FALSE.

.NOT. .FALSE. = .TRUE.

.FALSE. .OR. .TRUE. = .TRUE.

.FALSE. .AND. .TRUE. = .FALSE.

.NOT. .TRUE. = .FALSE.

.TRUE. .OR. .FALSE. = .TRUE.

.TRUE. .AND. .FALSE. = .FALSE.

.TRUE. .OR. .TRUE. = .TRUE.

.TRUE. .AND. .TRUE. = .TRUE.


Comparison Operators

Navigation: System Specifications >

Comparison Operators

 Print this Topic Return to chapter overview

These are used for comparing one value to another. The result from any comparison will be .TRUE. if the comparison is correct, or .FALSE. if it isn't. As with math operators and logical operators, you can alter the order of evaluation using parentheses.

The operators are:

= equal to (don't confuse with the equals value command)
< less than
<= less than or equal to
> greater than
>= greater than or equal to
<> not equal to
$ contained within (only works with strings - A type fields)

EXAMPLES

1 = 2 (.FALSE.)

1 < 2 (.TRUE.)

1 <= 2 (.TRUE.)

1 >= 2 (.FALSE.)

1 <> 2 (.TRUE.)

'ABC' = 'DEF' (.FALSE.)

'ABC' < 'DEF' (.TRUE.)

'ABC' <= 'DEF' (.TRUE.)

'ABC' >= 'DEF' (.FALSE.)

'ABC' <> 'DEF' (.TRUE.)

'ABC' $ 'DEF' (.FALSE.)

'ABC' $ 'XXXABCXXX' (.TRUE.)

NOTE: You need to be careful in setting up your comparisons to make sure you will get the results desired. For example, the expression given below combines comparison operators and a logical operator and looks perfectly harmless until you realize that the expression ALWAYS evaluates to .TRUE.

(x <> 3) .O. (x <> 4)

If you used this expression as part of an IF/ENDIF structure, the commands within the structure would ALWAYS be executed.


Field Names

Navigation: System Specifications >

Field Names

 Print this Topic Return to chapter overview

A field name may consist of up to 15 characters. The first character must be alpha (A-Z). You cannot include spaces, or other math or comparison operators within the name. All other characters are acceptable, including numbers as long as they aren't the first character. The compiler sees no difference between upper and lower case characters. This applies to fields within files/records or those created within the program using the DEFINE command.

NOTE: The maximum field name size in DBF files is 10 characters. Also, you cannot include any characters other than A-Z and 0-9 and _ (underscore). When you add a new field in WTASDMGR a short field name will be automatically created. You can then adjust it as desired. In any TAS program you write you will access the field by the 'normal' 15 character name. However, if you are using CodeBase as a database manager, and you access the files with non-TAS programs, you will need to refer to the fields by the special 10 character names.

EXAMPLES

The following are legal field names:

abc

Customer_code

INVOICE.NUM

The following are not legal:

2abc first character must be A-Z

+customer_code first character must be A-Z and can't use math operator

invoice-num can't use math operator.


Field Types

Navigation: System Specifications >

Field Types

 Print this Topic Return to chapter overview

TAS Professional has a very rich group of field types. These types give you much flexibility and power. Since you can call external programs and pass values to them, some of these types, especially the p-pointer (type P), are even more important. See Internal Specifications for more information about what these fields look like in the program. (All sizes are in bytes/characters.)

TAS Professional Field Types

Type | Name | Internal Size | Display | Dec | Acceptable characters
A | Alpha | 1-4gb | 1-4gb | N/A | All displayable chrs
N | Numeric | 8 | 1-20 | 0-9 | +,- and . (local decimal char)
B | Byte | 1 | 1-3 | N/A | 0-9
L | Logical | 1 | 3 | N/A | .True., .Y., .False., .N.
I | Integer | 2 | 1-5 | N/A | 0-9
R | Record | 4 | 1-10 | N/A | 0-9
D | Date | 4 | 5,7,8,10 | N/A |
T | Time | 4 | 5,7,8,10,11,13 | N/A |
F | F-Pointer | 5 | 7 | N/A | no entry allowed (internal pointer)
P | P-Pointer | 14 | 26 | N/A | no entry allowed (standard flat pointer)
V | Overlay | 1-4gb | 1-4gb | N/A | N/A
U | Unique Auto Increment | 4 | 10 | N/A | No entry Allowed

NOTE: Internally, V type fields are treated like A type fields. This was the standard way of creating compound indexes in previous versions of TAS Professional. However, in TAS Professional this is not necessary and should no longer be used. VERY IMPORTANT: If you are accessing CodeBase type files (Type C) this will no longer work and will probably give you an error at best. You should use the standard multi-segment index approach that is now a part of Maintain Data Dictionary.

NOTE: Even though the maximum size of an A or V type field is 4gb (4,294,967,295 bytes ) the maximum size of any record in a Btrieve file is 64k (65,535 bytes).

NOTE: Integer type B (Byte) field have only positive values.


Internal Specifications

Navigation: System Specifications >

Internal Specifications

 Print this Topic Return to chapter overview

The alphanumeric type (A) is straightforward: for each character the program maintains a byte of storage. There are no extra bytes at the beginning or end. The size of the field is determined by the program from a DEFINE command or from the data dictionary.

A numeric field (type N) is in the standard IEEE floating point format and is contained in 8 bytes of storage independent of the display size of the field.

A byte field (type B) can have a value from 0 through 255.

A logical field (type L) can have only two values, .TRUE. or .FALSE. Internally .TRUE. is 1 and .FALSE. is 0 and uses 1 byte of memory.

An integer field (type I) can have a value from -32768 through 32767. It is maintained in standard IEEE low byte low format and uses 2 bytes of memory. This is know as a Short integer. Signed 16-bit.

A record field (type R) can have a value from -2,147,483,648 through 2,147,483,647 . It is maintained in standard IEEE format and uses 4 bytes of memory. This field can also be thought of as being a long or double integer and can be used in that manner. This is known as a Long Integer. Signed 32-bit.

An AUTOINC field (type U) (New since version 7.6)

NOTE : Requires database version 6.15 or above if your databases are using version 5.10 this will not work!! This is a Btrieve or pervasive SQL type field. You should not use this type field in a codebase file.

In an attempt to modernize our programming Language we have added the AUTOINC field (type U) to TAS Professional so that you can use pure SQL calls using the SQL() in TAS Professional and to also make it so you can use other programming tools like C##, Access, Java and others to work with your data. Not that we want you to use these tools sometimes it just good to say you can.

The AUTOINC key type is a signed Intel integer that can be either two or four bytes long. Internally, AUTOINC keys are stored in Intel binary integer format, with the high-order and low-order bytes reversed within a word. The MicroKernel sorts AUTOINC keys by their absolute (positive) values, comparing the values stored in different records a word at a time from right to left. AUTOINC keys may be used to automatically assign the next highest value when a record is inserted into a file. Because the values are sorted by absolute value, the number of possible records is roughly half what you would expect given that the data type is signed.

Values that have been deleted from the file are not re-used automatically. If you indicate that you want the database engine to assign the next value by entering a zero (0) value in an insert or update, the database simply finds the highest number, adds 1, and inserts the resulting value.

You can initialize the value of a field in all or some records to zero and later add an index of type AUTOINC. This feature allows you to prepare for an AUTOINC key without actually building the index until it is needed.

When you add the index, the MicroKernel changes the zero values in each field appropriately, beginning its numbering with a value equal to the greatest value currently defined in the field, plus one. If nonzero values exist in the field, the MicroKernel does not alter them. However, the MicroKernel returns an error status code if nonzero duplicate values exist in the field.

The MicroKernel maintains the highest previously used auto-increment value associated with each open file containing an AUTOINC key. This value is established and increments only when an INSERT operation occurs for a record with ASCII zeros in the AUTOINC field. The value is used by all clients so that concurrent changes can take place, taking advantage of Key Page Concurrency.

The next AUTOINC value for a file is raised whenever any INSERT occurs that uses the previous AUTOINC value. This happens whether or not the INSERT is in a transaction or the change is committed.

However, this value may be lowered during an INSERT if all of the following are true:

The highest AUTOINC value found in the key is lower than the next AUTOINC value for the file

No other client has a pending transaction affecting the page that contains the highest AUTOINC value

The key page containing the highest AUTOINC value is not already pending by the client doing the INSERT.

In other words, only the first INSERT within a transaction can lower the next available AUTOINC value. After that, the next available AUTOINC value just keeps increasing.

An example helps clarify how an AUTOINC value may be lowered. Assume an autoincrement file exists with records 1, 2, 3 and 4. The next available AUTOINC value is 5.

Client1 begins a transaction and inserts two new records, raising the next available AUTOINC value to 7. (Client1 gets values 5 and 6). Client2 begins a transaction and also inserts two new records. This raises the next available AUTOINC value to 9. (Client 2 gets values 7 and 8).

Client1 the deletes records 4, 5, and 6. The next AUTOINC value remains the same since it is adjusted only on INSERTS. Client1 then commits. The committed version of the file now contains records 1, 2, and 3.

For Client2, the file contains records 1, 2, 3, 7, and 8 (7 and 8 are not yet committed). Client2 then inserts another record, which becomes record 9. The next available AUTOINC value is raised to 10. Client2 deletes records 3, 7, 8, and 9. For Client2, the file now contains only the committed records 1 and 2.

Next Client2 inserts another record, which becomes record 10. The next available AUTOINC value is raised to 11. The next autoincrement value is not lowered to 3 since the page containing the change has other changes pending on it.

Client2 then aborts the transaction. The committed version of the file now contains records 1, 2, and 3, but the next available AUTOINC value is still 11.

If either client inserts another record, whether in a transaction or not, the next available AUTOINC value will be lowered to 4. This occurs because all of the conditions required for lowering the value are true.

If a resulting auto-increment value is out of range, a Status Code 5 results. The database engine does not attempt to “wrap” the values and start again from zero. You may, however, insert unused values directly if you know of gaps in the autoincrement sequence where a previously inserted value has been deleted.

AUTOINC Restrictions

The following restrictions apply to AUTOINC keys:

· The key must be defined as unique.
· The key cannot be segmented. However, an AUTOINC key can be included as an integer segment of another key, as long as the AUTOINC key has been defined as a separate, single key first, and the AUTOINC key number is lower than the segmented key number.
· The key cannot overlap another key.
· All keys must be ascending.

The MicroKernel treats AUTOINC key values as follows when you insert records into a file:

k

If you specify a value of binary 0 for the AUTOINC key, the MicroKernel assigns a value to the key based on the following criteria:

If you are inserting the first record in the file, the MicroKernel assigns the value of 1 to the AUTOINC key.

If records already exist in the file, the MicroKernel assigns the key a value that is one number higher than the highest existing absolute value in the file.

If you specify a positive, nonzero value for the AUTOINC key, the MicroKernel inserts the record into the file and uses the specified value as the key value. If a record containing that value already exists in the file, the MicroKernel returns an error status code, and does not insert the record.

A date field (type D) is kept in a special format that corresponds to that used by Btrieve. This format is low byte day value, next byte month value and high word year value, total 4 bytes memory used. All values are kept in binary format.

A time field (type T) is kept in a special format that corresponds to that used by Btrieve. This format is low byte hundredths of seconds, next byte seconds, next byte minutes, and high byte hours, total 4 bytes memory used. All values are kept in binary format.

An F-Pointer field (type F) is a compound field. The low byte contains the type of the field being pointed to; F - standard field, C - constant, or X - expression. The high double-word is the location of the field specification within the field list segment within the program being run, for a total of 5 bytes memory used. This field type is not usable outside of TAS Professional. However, it has great use within a program and is the smallest pointer value.

A P-Pointer field (type P) is a compound field. This field is closer to the standard far pointers in C. The low double-word is the location value, the next byte is the field type (a single alpha character as listed above), next byte is the number of decimal characters, the next double-word is the internal size in bytes, and the final double-word is the display size in characters, for a total of 14 bytes memory used. The reason for the complexity of this field is so that you can pass this value to an external program (non-TAS) and know everything necessary about the field. The location value points to the actual field value in memory, not at the field list. You can add and subtract values to/from a P-Pointer field location using integers. However, all other parts of the field cannot be changed.


Constants

Navigation: System Specifications >

Constants

 Print this Topic Return to chapter overview

String or alphanumeric constants (type A) are surrounded by quote marks; it doesn't matter whether you use single ('') or double ("") quotes as long as the same type is used at the beginning and end. For example:

'ABC'

'123'

'01/01/90'

"should've done it" When using a single quote as an apostrophe surround the constant in double quotes.

'abc123" This is not legal since it starts with a single quote and ends with a double.

Numeric (type N) constants must have a decimal chr (period or comma, as applicable) followed by at least 1 numeric character. For example:

100.0

234.5678

0.25

1,950.25 This is not legal since commas cannot be included (unless it takes the place of the decimal character.)

Byte (type B) constants are followed by a B or b. No decimal characters are allowed. For example:

10b

1b

99,999B This is not legal since commas are not allowed and the maximum Byte value is 255.

Integer (type I) constants can be followed by a ! for clarity. These constants have a numeric value less than 65,536 and no decimal characters or commas are allowed. For example:

10

1!

99,999! This is not legal since commas are not allowed and the maximum Integer value is 65535.

Record (type R) constants are followed by an R. No decimal characters or commas are allowed. For example:

100r

192543R

192,543r This is not legal since commas are not allowed.

Logical (type L) constants are T or F surrounded by periods, i.e., .TRUE. and .FALSE. You can also use .Y. for .TRUE. and .N. for .FALSE. These are the only options available for logical constants. You must leave at least one space before and after the constant.

There are no special Date (type D) or Time (type T) constants. You can set a date or time field equal to an alpha field directly.

time_field = '10:10:00' Can use seconds or not as desired.

time_field = '10:10'

date_field = '10/10/90' Can use any type of separator between dates and
date_field = '10 10 90' can use the full year or just 2 digits.
date_field = '10 10 1990' Don't forget, month, day, and year must be in the proper order as you have them specified in the setup.

There are no P-Pointer (type P) or F-Pointer (type F) constants.

COMPILERCONSTANTS.TXT

This file is used while compiling programs. It allows you to specify alpha constants that will be replaced during compilation. The structure is:

constant=actual

For example, we supply a whole group of color constants. In your program you might use clRed but during compilation the program will insert 255. This can be used to replace any value in your program with another. You can add your own constants to this file with a standard text editor (e.g., Notepad).

As released version 7.4.2

COMPILERCONSTANTS.TXT

{NOTE: All constants must be in the form of name=value}

{ there can be no spaces around the = sign}

{rf_strings}

stCount=101

stGetLine=102

stGetText=103

stSetLine=104

stSetText=105

stClear=106

stAddLine=107

stDelLine=108

stInsLine=109

stLoad=110

stSave=111

stSort=112

stFind=113

stLocate=114

{color constants}

clScrollBar=-2147483648

clBackground=-2147483647

clActiveCaption=-2147483646

clInactiveCaption=-2147483645

clMenu=-2147483644

clWindow=-2147483643

clWindowFrame=-2147483642

clMenuText=-2147483641

clWindowText=-2147483640

clCaptionText=-2147483639

clActiveBorder=-2147483638

clInactiveBorder=-2147483637

clAppWorkSpace=-2147483636

clHighlight=-2147483635

clHighlightText=-2147483634

clBtnFace=-2147483633

clBtnShadow=-2147483632

clGrayText=-2147483631

clBtnText=-2147483630

clInactiveCaptionText=-2147483629

clBtnHighlight=-2147483628

clBlack=0

clMaroon=128

clGreen=32768

clOlive=32896

clNavy=8388608

clPurple=8388736

clTeal=8421376

clGray=8421504

clSilver=12632256

clRed=255

clLime=65280

clYellow=65535

clBlue=16711680

clFuchsia=16711935

clAqua=16776960

clLtGray=12632256

clDkGray=8421504

clWhite=16777215

{alignment - TTASDGColTemplate}

taLeftJustify=0

taRightJustify=1

taCenter=2

{character case - TTASDGColTemplate}

ecNormal=0

ecUpperCase=1

ecLowerCase=2

{editor - TTASDGColTemplate}

edDefault=0

edSpinEdit=1

edComboEdit=2

edComboList=3

edEditBtn=4

edCheckBox=5

edDateEdit=6

edTimeEdit=7

edInteger=8

edNumeric=9

edPassword=10

{WindowState - TTASForm}

wsNormal=0

wsMinimized=1

wsMaximized=2

{modal result constants}

mrNone=0

mrOk=1

mrCancel=2

mrAbort=3

mrRetry=4

mrIgnore=5

mrYes=6

mrNo=7

mrAll=8

mrNoToAll=9

MrYesToAll=10

{registry edit constants}

regOpen=0

regReadInt=1

regReadStr=2

regReadBool=3

regWriteInt=4

regWriteStr=5

regWriteBool=6

regDelete=7

regClose=8

rtRegistry=0

rtFile=1

{cursor options}

crDefault=0

crNone=-1

crArrow=-2

crCross=-3

crIBeam=-4

crSizeNESW=-6

crSizeNS=-7

crSizeNWSE=-8

crSizeWE=-9

crUpArrow=-10

crHourGlass=-11

crDrag=-12

crNoDrop=-13

crHSplit=-14

crVSplit=-15

crMultiDrag=-16

crSQLWait=-17

crNo=-18

crAppStart=-19

crHelp=-20

crHandPoint=-21

crSizeAll=-22

{font pitch constants}

fpDefault=0

fpVariable=1

fpFixed=2

{border style}

bsNone=0

bsSingle=1

{check box}

cbUnchecked=0

cbChecked=1

{glyph kind}

bkCustom=0

bkOK=1

bkCancel=2

bkHelp=3

bkYes=4

bkNo=5

bkClose=6

bkAbort=7

bkRetry=8

bkIgnore=9

bkAll=10

{brush styles}

bsSolid=0

bsClear=1

bsHorizontal=2

bsVertical=3

bsFDiagonal=4

bsBDiagonal=5

bsCross=6

bsDiagCross=7

{pen styles}

psSolid=0

psDash=1

psDot=2

psDashDot=3

psDashDotDot=4

psClear=5

psInsideFrame=6

{pen modes}

pmBlack=0

pmWhite=1

pmNop=2

pmNot=3

pmCopy=4

pmNotCopy=5

pmMergePenNot=6

pmMaskPenNot=7

pmMergeNotPen=8

pmMaskNotPen=9

pmMerge=10

pmNotMerge=11

pmMask=12

pmNotMask=13

pmXor=14

pmNotXor=15

{shapes}

stRectangle=0

stSquare=1

stRoundRect=2

stRoundSquare=3

stEllipse=4

stCircle=5

{ParseFile}

pfPath=1

pfName=2

pfExt=3

{commands/functions that have changed names}

win_color=WCOLOR

win_menu=WMENU

win_help=WHELP

win_print=PRINT_REPORT

get_win_color=GET_WCOLOR

win_mount=WMOUNT

win_laser_prt=WLASER_PRT

{FastSearchTypes}

fsNum=0

fsRec=1

fsInt=2

fsByte=3

{TTASNavigator Buttons}

nbFirst=0

nbPrior=1

nbNext=2

nbLast=3

nbInsert=4

nbDelete=5

nbEdit=6

nbPost=7

nbCancel=8

nbRefresh=9

{EMail constants}

emlRecvSignOn=0

emlRecvSignOff=1

emlRecvMsgList=2

emlRecvMsg=3

emlRecvMsgBody=4

emlRecvMsgAttach=5

emlRecvMsgCC=6

emlRecvMsgCount=7

emlRecvMsgDel=8

emlSendMsg=9

emlRecvMsgListSL=10

emlSendIMap=11

{print to file constants}

ptfRTF=1

ptfPDF=2

ptfCSS2=3

ptfHTML=4

ptfJPG=5

ptfExcel=6

ptfQuattro=7

ptfLotus=8

ptfRETF=9

ptfText=10

ptfBMP=11

ptfTiff=12

{compile source options}

compFile=1

compInt=2

{get license info function}

liSerialNum=1

liUserType=2

liMultiUserCode=3

{Year digits for TTASDateEdit}

dyDefault=0

dyFour=1

dyTwo=2

{Rec_Lock options}

recLock=0

recUnlock=1

recAnyLocked=2

{click nav buttons}

cnbCancel=0

cnbDelete=1

cnbFirst=2

cnbLast=3

cnbPrior=4

cnbNext=5

cnbPost=6

cnbEdit=7

{file store options}

fsImport=0

fsExport=1

fsCopy=2

{serial port options}

spActivate=0

spClose=1

spRead=2

spWrite=3

{serial port settings}

{baud rate}

br110=0

br300=1

br600=2

br1200=3

br2400=4

br4800=5

br9600=6

br14400=7

br19200=8

br38400=9

br56000=10

br57600=11

br115200=12

br128000=14

br256000=15

{data bits}

db5=0

db6=1

db7=2

db8=3

{hardware flow control}

hwfcOff=0

hwfcRTSOn=1

hwfcBothOn=2

{Parity}

parNone=0

parOdd=1

parEven=2

parMark=3

parSpace=4

{software flow control}

swfcOff=0

swfcOn=1

{stop bits}

sb1=0

sb1.5=1

sb2=2

{File_attrib options}

faSet=1

FaGet=0

{registry options}

reg

{SQL Options}

SQLOpenConnection=1

SQLQuery=2

SQLGetRecordCount=3

SQLExecute=4

SQLCloseRecordset=5

SQLMoveNext=6

SQLMovePrevious=7

SQLCloseConnection=8

SQLGetData=9

SQLMoveFirst=10

SQLMoveLast=11

SQLQueryForward=12

SQLGetFieldname=13

SQLGetFieldCount=14

SQLExecuteScalar=15

SQLBind=16

SQLGETTableNames=17

SQLGETTableCount=18

SQLGETFieldsize=19

SQLGETFieldType=20

sqlGetErrorCount=21

sqlGetError=22

sqlGetNativeError=23

SQLBeginTrans=24

SQLCommitTrans=25

SQLRollBackTrans=26

SQLInTrans=27

SQLGetIsolation=28

SQLSetIsolation=29

#SQL Isolation Constances

ilUnspecified=1

ilChaos=2

ilReadUncommitted=3

ilBrowse=4

ilCursorStability=5

ilReadCommitted=6

ilRepeatableRead=7

ilSerializable=8

ilIsolated=9

{SQL Field Types}

;Unknown or undetermined

ftUnknown=0

;Character or string field

ftString=1

;16-bit integer field

ftSmallint=2

;32-bit integer field

ftInteger=3

;16-bit unsigned integer field

ftWord=4

;Boolean field

ftBoolean=5

;Floating-point numeric field

ftFloat=6

;Money field

ftCurrency=7

;Binary-Coded Decimal field that can be converted to Currency type without a loss of precision.

ftBCD=8

;Date field

ftDate=9

;Time field

ftTime=10

;Date and time field

ftDateTime=11

;Fixed number of bytes (binary storage)

ftBytes=12

;Variable number of bytes (binary storage)

ftVarBytes=13

;Auto-incrementing 32-bit integer counter field

ftAutoInc=14

;Binary Large OBject field

ftBlob=15

;Text memo field

ftMemo=16

;Bitmap field

ftGraphic=17

;Formatted text memo field

ftFmtMemo=18

;Paradox OLE field

ftParadoxOle=19

;dBASE OLE field

ftDBaseOle=20

;Typed binary field

ftTypedBinary=21

;Output cursor from an Oracle stored procedure (TParam only)

ftCursor=22

;Fixed character field

ftFixedChar=23

;Wide string field

ftWideString=24

;Large integer field

ftLargeint=25

;Abstract Data Type field

ftADT=26

;Array field

ftArray=27

;REF field

ftReference=28

;DataSet field

ftDataSet=29

;BLOB fields in Oracle 8 tables

ftOraBlob=30

;CLOB fields in Oracle 8 tables

ftOraClob=31

;Data of unknown or undetermined type

ftVariant=32

;References to interfaces (IUnknown)

ftInterface=33

;References to IDispatch interfaces

ftIDispatch=34

;globally unique identifier (GUID) values

ftGuid=35

;Date and time field accessed through dbExpress

ftTimeStamp=36

;Binary-Coded Decimal field that is too large for ftBCD.

ftFMTBcd=37

;X-charge Constance

Xnowait=1

xSetup=1

xSubmitCC=2

xResponce=3

XSubmitDebit=4

XVoidCC=5

XCreditReturn=6

XVoidReturn=7

XForceSale=8

XPreAuth=9

XDebitReturn=10

XGuarDL=11

XGuarMirc=12

XReport=13

PPInitalize=14

PPConfig=15

PPPrompt=16

PPClose=17

PPDisplaytext=18

PPDisplayLogo=19

PPPromptSignature=20

; Hash file

GetMD5=0

GetSHA1=1

VERIFYMD5=2

VERIFYSHA1=3

;String encrypt/Decrypt

SETWOFISH=0

SEBLOWFISH=1

SEDES=2

SERC2=3


Array Specifications

Navigation: System Specifications >

Array Specifications

 Print this Topic Return to chapter overview

Any field may be defined as being an array. This means that each field is actually a multiple field. Each array element is of the same type and size, and may be accessed using the same field name and just changing the element number. The array element specifier is a numeric field, constant, or expression surrounded by squared brackets [] and immediately following (without any space separating) the field name. TAS Professional allows only single dimensioned arrays; however, since the element number may be an expression you can create one that will treat the array as though it was multi-dimensioned. The maximum number of elements in any one array is 4.3 billion (4gb); the first element in any array is 1.

EXAMPLE

SALES[12]

SALES[MONTH[CNTR]]

COST_OF_GOODS[month(date())]

//The function month(date()) will return the month number from the current system date.

ARRAY[(cntr2-1)*24+cntr1]

(*The example above shows how a multi-dimensioned array might be handled. The example assumes that cntr1 is the first dimension value and cntr2 is the second dimension counter and that there are 24 elements in each first dimension. The limit of the second dimension is related to the total number of elements in the array only.*)


Expressions

Navigation: System Specifications >

Expressions

 Print this Topic Return to chapter overview

An expression might almost be considered a compound value. All of the parts of the expression are resolved (each math operator or function is executed) into a single value. Internally each expression is broken down into a series of expressions each involving only two elements. For example:

1+2+3

In the above case the program calculates 1+2 first and then the result (or 3) +3 to get the answer 6. However, in the case of:

1+2*3

The program calculates 2*3 first (since multiplication has a higher precedence than addition) and then adds that to 1 for a total of 7. If you have any doubts as to the order of calculation you should surround values that you want to be evaluated in a certain order with parentheses. In the above example, if you wanted 1 to be added to 2 first, and then multiplied by 3 your expression would look like:

(1+2)*3

The result would then be 9, or 1+2 to get 3 and then 3*3 to get 9.

The different elements (field or value) of the expression need not be of the same type. The program will automatically convert the second part of the expression to the same type as the first. For example:

"Today's date is: "+date()

The result of the expression above would be the current date (derived from the date() function) converted to an alpha field since the first part of the expression is an alpha field and the date value was automatically converted. Again, if you have any doubts over whether or not a value is being converted properly you can also use the full range of conversion functions provided in TAS Professional.

An expression might be very simple. For example:

1+1

Or it might get very complex:

size_hldr + iif(dict_array_ele <> 0,dict_array_ele*int_size,int_size)

Expressions may resolve to a value or may be a logical expression and use comparison operators also. These type of expressions resolve to .TRUE. or .FALSE. For example:

1 = 1

This resolves to .TRUE. Another example might be:

x = 100 .OR. (y = 50! .AND. z = 'ABC')

And they might be made up of both:

x = (size*num_array_ele) .OR. field_name=('TEST'+date())

The only limit to the length of an expression is the maximum character limit per line. Any legal function, including user defined functions (UDF), may be a part of an expression.


Indirect Field References

Navigation: System Specifications >

Indirect Field References

 Print this Topic Return to chapter overview

A very powerful feature of TAS Professional is the ability to refer to a field indirectly through the use of pointers. A pointer is a value that literally 'points to' the field. In TAS Professional there are two different types of pointers. One points to the field specification within the field list in a program; the other points to the actual location of the field value. This second pointer is more typical of that used in languages such as C. In fact, we have set up this type of pointer ('P' pointer) so that you can pass it to non-TAS programs and access your TAS data directly!

To set the value of a pointer (either F or P) use the pointer command:

pointer_fld -> field_name

The command automatically determines which type of pointer you are using and returns the correct value. To refer to a field through the use of the pointer precede the pointer name with the redirector symbol ('&'). In all cases where you need a field name in a command you can use this method of referring to it. For example, your code may look like:

fptr_fld -> test

x = &fptr_fld

This is the same as:

x = test

You can set a pointer to an element in an array by specifying the array field and the element, i.e.:

pptr_fld -> test[cntr] //where cntr is the array element number

The array element number can be either a constant or a variable. The pointer field can also be an array, i.e:

fptr_fld[x] -> test[cntr]

y = &fptr_fld[x]

In this example the xth element of the F type pointer array fptr_fld now points to the element in test as determined by the value of cntr. The field names used in this example are arbitrary. You don't have to name P type pointer pptr or F type pointer fptr; however, in the documentation we refer to them in that manner. The array specifier [x] in this case means the xth element in fptr_fld.

NOTE: The above applies only to Btrieve and Defined fields. If you are referencing a field from a CodeBase file you must point to the field only (even if it's an array). You will still be able to refer to the field as shown below.

You can also refer to an array element in a field being pointed to through the use of the array pointer redirector. For example:

fptr_fld -> test

x = @fptr_fld[1]

y = @fptr_fld[2]

...

z = @fptr_fld[10]

where test is a 10 element array. TAS Professional uses the array element specifier to determine the correct element in the array field being pointed to and not the pointer field. In the example above, each equal command will apply to the appropriate element in the field test. You need not use a constant as an array specifier; it is used here only as an example.

Through the use of this facility in TAS Professional you have the power to access data without ever knowing what the data is you're going to work with when you write the program.

There is also a specialized case where you use the & indirect reference character. This is in connection with A type (alpha) fields or the result of the COMPILE_EXPR() function. In the first instance, the alpha field is treated like an expression and is compiled first. The the result is evaluated the same as a standard expression. In the second case, the compilation process is skipped since it has already been accomplished with the function and just the evaluation process is done. So, for example, if you allow the user to enter an expression into the field UserExpr you might use something like the following:

define x type a size 100

x = &UserExpr

msg x

If the user enters "A"+"B"+"C" the result in the MSG will be: ABC. You could have just as well used:

x = &'"A"+"B"+"C"'

and have received the same results.

The downside to this method is that each time you execute the command with the & space is used up in memory. So, if you are going to execute the compilation process hundreds, or thousands of times, such as in a FOR option in a SCAN command, you might want to use the COMPILE_EXPR instead, and then evaluate the result of that. In this case, the space is only used once. This also allows you to create multiple pre-compiled expressions that can be used again and again. For example, say the user is entering a filter value to be used in searching for records in a file. Then you might use something like this:

define Filter type f

Filter = compile_expr(UserExpr)

scan @file_hndl key @key_num for &filter

...

ends

As long as the UserExpr evaluates to True or False this will control which records are used in the SCAN loop. For example, in a customer file the user might enter BKAR.CUSTZIP>='98000' .and. BKAR.CUSTZIP<'99000'. This would limit records with a zip code from 98000 up to 99000. Notice that the expression is exactly the same as you would use it in your code directly. The only difference is that you're going to evaluate it at runtime and allow the user to change it as desired.

A good example of this is in Maintain Database. If you press the CTL_F keys once the file has been displayed, you can enter the filter value.


General Information

Navigation: Set Configuration >

General Information: Set Configuration

 Print this Topic Return to chapter overview

Run the Set Configuration (TP7SETUP.EXE) program to define the basic system options. TASPRO7.EXE or TASRUNTIME.EXE should not be active while you're running the TP7SETUP.EXE program.

The following picture represents the buttons at the bottom of the Set Configuration program:

Set Dev Path You can create multiple development paths by clicking on this button and defining a new location. For each location the program will place a copy of TASPRO.INI in the path. All information concerning that development path will be saved in this INI file. A single entry is saved in the registry in:

\HKEY_CURRENT_USER\Software\Computer Accounting Solutions\TAS Pro\DevLoc

The current development path will be saved. Then each time you load TAS Professional it will set the current subdirectory to this path. You can still load screen/report forms and source files in other subdirectories. However, the data dictionary used will be whatever you set in the General page.

When you click this button the following dialog box will be displayed:

Enter the appropriate path name or click on the [image] icon to display available paths. After you've chosen a path click on the OK button to save this to the registry.

If this is a new development path the following dialog will be displayed:

If you answer Yes (click on the Yes button or press the ENTER key), the TASPRO.INI file will be created in your new development path. In most cases this is what you want to happen. However, you can also create a single TASPRO.INI file that will be saved in your Windows System path (\WINDOWS\SYSTEM for Win95,98,ME or \WINNT\SYSTEM\ for NT/Win2000). The downside to this is that you will be able to specify a single data dictionary location for all development paths.

NOTE: If you create a new development path and the create dialog above DOES NOT APPEAR, you have a TASPRO.INI file in your system subdirectory. This would also be the case if you think you're changing your data dictionary path and it doesn't. Go to that subdirectory (as appropriate for Win95-ME or WinNT) and delete the TASPRO.INI file. Then run this Set Configuration program again.

If a data dictionary doesn't exist in the new development path the following dialog will be displayed:

If you answer Yes to this question a basic data dictionary (just the basic FD entries), will be created in the new development path. If you answer No to this you must either copy a data dictionary to this path (the files in the \Datadict subdirectory) or set the Data Dictionary Path in the General page to an existing data dictionary.

Setup Icons During the installation process the program will ask if you want to put icons on your desktop. If you answered no and now want them, or you have moved TAS Professional to another computer and didn't re-install, you can create icons by clicking this button.

OK If you have made changes to any of the data on the Set Configuration pages you can save those changes and exit the program by clicking on this button.

Apply If you have made changes to any of the data on the Set Configuration pages this button will become active. If you click on the button the changes will be saved, however, the program will not exit.

Cancel If you click this button any changes you have made to the data on the Set Configuration pages will be ignored and the program will exit.

Note: Here is a list of the dictionary files that will be copied from the folder in TAS7 named UPGRADE

ERRMSG.DBF

ERRMSG.MDX

FILEDBF.B

FILEDBF.DBF

FILEDBF.MDX

FILEDES.DBF

FILEDES.MDX

FILEDFLD.DBF

FILEDFLD.MDX

FILEDICT.DBF

FILEDICT.MDX

FILEKEY.DBF

FILEKEY.MDX

FILEKNUM.DBF

FILEKNUM.mdx

FILELOC.DBF

FILELOC.MDX

updatedbf.dbf

updatedbf.mdx

WTASFMGR.DBF

WTASFMGR.dbt

WTASFMGR.mdx


TASPRO.INI Explained

Navigation: Set Configuration > General Information >

TASPRO.INI Explained

 Print this Topic Return to chapter overview

The File that control a lot of the behaviors in TAS Professional is in every system that you will create the file name is TASPRO.INI. This file is a text file that is read when ever you run TASPRO7.EXE (IDE) TASRUNTIME.EXE We will try to explain this very important file and what all the settings are in case you may need to edit this file.

Programmers note: You can also use this file store and information about your application.

Note : Most the options in this file are controlled and edited with the TP7SETUP.EXE or the TP7RTSETUP.EXE If your not used to editing .INI type files we recommend you email product support before making changes to this file.

This Chapter will attempt to document all possible switches and setting for this file. Most of these setting are controlled by several parts of the Professional powered by CAS development system.

This sections is called setup this section of the INI files sets up where your application paths are the default company code you want to start the program with

[Setup]

Caption=your caption here This will change the caption of your runtime on the program bar.

DataDictPath=.\ This is the path to the projects data dictionary we recommend you use .\ here.

DefaultPath=.\ The default path of where all programs are these files have extensions of .run .src .rtm .dfm

DfltCompanyCode=B The default Company code to use.

DfltRunPrg=.\tas_menu This is normally your menu program.

MultiUser=1 0=Off 1=On

MainMenu=0 0=Off 1=On If this is the main menu.

FullSetup=1 0=Off 1=On This used internally by tp7setup.exe

DfltSkin=skins\macos.skn This is a new feature released by CAS with this in your .INI and the proper skins file name and path the user or programmer can change the entire look of there programs for more information search for skins.

BtrieveDictionary=0 0=Off 1=On. In version 7.4 and above the programmer can choose the database dictionaries types to use the standard codebase type files or the optional Pervasive(btrieve) files as the data dictionaries. We recommend that you use Codebase files unless you find a need to limit the use codebase databases. If this line is left out of the taspro.ini file TASPRO will use the default codebase type files. All programs in TASPRO IDE and rutime have been adjusted to use this feature. Also to use this feature you will have to run the wtascnvtbtrv.rwn program to write your codebase dictionaries to btreive. This program will not make any changes to your codebase dictionaries files.
TPath= Use to Define the Path in for the TPath() Function.

This will allow you to control how the print preview will look to the user.

[Report Preview]

WindowState=wsNormal

;WindowState=wsMaximized

Height=700

width=950

These are setting to make TASPRO7 more compatible with TP5WIN.EXE 16bit windows version most of these settings are setup in the TP7SETUP.EXE

[TP5WIN]

Use Old Reports=1 0=Off 1 = On When Converting from tas5 programs to tas7 windows it was not possible to preserve the old text reports programs With this you can

Esc Close=1 0=Off 1 = On New feature after 6.16R if this is set to 1 when the user click on the X at the top of the screen the program will act like the user pressed the ESC key. This is only for 5.1 programs program with the extention of .run Again this feature is exclusive of the CAS version of Tas Professional.

NormalBkg=clBtnFace

NormalText=clBtnText

BoxBkg=clWindow

BoxText=clWindowText

EnterBkg=clWindow

EnterText=clBlack

DisplayBkg=clWindow

DisplayText=clBlack

MsgBkg=clWindow

Video Rows=42

Video Cols=100

Font Size Reg=15

Font Size Input=15

Row Pixels=12

Col Pixels=8

Font Size Text=9

Reduce Scrn Wdth=0

Shadow Width=2

Underscore Menu Chr=1

Allow Gray=1

Init Window Caption=

View Form Size=0

Remove Vert Box Chr=1

Form Bkg Color=12632256

Form Font Color=0

Disp Bkg Color=16777215

Disp Font Color=0

Entry Bkg Color=65535

Entry Font Color=0

Menu Main Bkg Color=16777215

Menu Main Text Color=0

Menu Selection Bkg Color=255

Menu Selection Text Color=0

Window Bkg Color=16777215

Window Text Color=0

Window Selection Bkg Color=255

Window Selection Text Color=0

Index Disp Bkg Color=12600000 //These next settings are a new feature in TAS7 powered by CAS

Index Disp Font Color=0 // that allows the colors to change if a filed is an index field.

Index Entry Bkg Color=10002256 // Used in Old 5.1 Screens if these are in your INI file then you can edit these settings

Index Entry Font Color=16777215 // from the Skins tab in the TP7SETUP.EXE.

These next 5 settings control how the old 5.1 programs screen will be drawn these setting are controled in the tp5setup.exe and TP7SETUP.EXE These were added to the system by CAS and are may only be available to TAS PRO powered by CAS.

Remove All Box Chr=0

No3d=0

Remove Box Corners=1

Convert Box Chr=1

UseTerminalFont=0

Use Old Reports=1 //This will allow TAS runtime to use tas5 type reports.

The internally used names for deferent objects. Using the CL type names will allow the user to change there look in there program using windows themes.

[Color]

MsgText=clBlack

WindowBkg=clWindow

WindowText=clBlack

MenuBkg=clWindow

MenuText=clBlack

ButtonBkg=clBtnFace

ButtonText=clBtnText

ChoiceBkg=clHighlight

ChoiceText=clHighlightText

EcolorBkg=clYellow

EcolorText=clBlack

ShadowBkg=clWindowFrame

ShadowText=clWindowText

[Misc]

UnderScoreMenuChr=1

AllowGray=0

InitCaption=

These are settings for TAS Professional 5.0 Compatibility.

[TAS50]

AM Specifier=A

PM Specifier=P

Time Separator=:

Date Type=MDY

Date Separator=/

Dollar Chr=$

Printer Dollar Chr=$

Comma Chr=,

Decimal Chr=.

Default Printer Num=1

Dflt Prtr CTL Name=GENERIC.CTL

Upper Left Corner=218

Upper Right Corner=183

Lower Left Corner=212

Lower Right Corner=188

Left Vertical=179

Right Vertical=186

Upper Horizontal=196

Lower Horizontal=205

MU Num Retries=2

MU Retry Delay=2

Extra Mem Area Size=60

Pro 6 Path= Out moded by the TPath in the Setup header.

Yes=Y

No=N

WeekStart=0

These settings are controlled and set in the TASPRO7.EXE (IDE) in the Compile screen.

[Compiler Settings]

Run Code Size=600

Compiled Code Size=600

Constant Buff Size=600

Screen Buff Lines=1000

Number of Fields=1000

Number of Labels=1000

Lib Directory=.\

Include Warning Errors=1

Compile in Debug Mode=0

These settings are used to control both codebase and Btrieve settings they are setup in the TP7SETUP.EXE program

[FileManager]

UseCodeBase=0

ServerName=

ServerUserName=PUBLIC

UseBtrvMemos=0

UseFileMgr=0

CBTransProcActive=0

undocumented at this time

[Default New Form]

FormFontName=Arial

FormFontSize=10

Default setting for the user.

[User Options]

MultiRT = 0 // if set to 1 this allows runtime to run Multi - runtimes from same folder

AskYesNo=1

AMString=AM

PMString=PM

Msg Size Chg=0

CS Server Name=

CS User Name=

CS Password=

CS Silent=0

Setting for Email interface built into TASPRO7.EXE, TASRUNTIME.EXE

[EMail Settings]

SMTP Server=NONE

User EMail Address=

User Name=

POP3 Server=NONE

POP3 Pswd=

POP3 User Name=

Encoding Type=MIME

Character Set=US-ASCII

Time Out=60

SMTP Pswd=

SMTP User Name=

Settings to allow TASPRO to use MAPI to send email using programs like outlook and outlook express.

[IMAP]

USE=1

DIALOG=1

Last 9 Source files edited in system using TASPRO7.EXE (IDE)

[Source File History]

Setting for the Screen Painter

[Screen Editor Settings]

ObjInspColWidth=146

NewFormFontName=Arial

NewFormFontSize=10

DfltTASObjHeight=24

ScreenGridX=8

ScreenGridY=8

ScreenGridSnapOn=1

[Compiler Settings]

Run Code Size=3000

Compiled Code Size=3000

Constant Buff Size=3000

Screen Buff Lines=10000

Number of Fields=10000

Number of Labels=10000

Lib Directory=K:\adv60

Include Warning Errors=1

Compile in Debug Mode=1

Setting that Control the SRC editor in TASPRO7.EXE

[Source Editor Settings]

MarginLine=1

KeyMap=Default

CBXIndex=0

ReservedFontColor=0

ReservedFontBold=1

ReservedFontItalics=0

OptionFontColor=255

OptionFontBold=1

OptionFontItalics=0

FunctionFontColor=32768

FunctionFontBold=1

FunctionFontItalics=0

CommentFontColor=16711680

CommentFontBold=0

CommentFontItalics=1

StringFontColor=128

StringFontBold=1

StringFontItalics=0


TAS Execute

Navigation: Set Configuration >

TAS Execute

 Print this Topic Return to chapter overview

Purpose of Program

Use the TASExecute.exe program to manage your TAS professional projects.

By using this program you can change from project to project using one copy of the TAS professional development system.

In this program there are 3 buttons that are used to work with your projects. and a field to enter the path of your projects. Aslo the file menu is used to keep a list up to 10 of your most recent projects.

When you enter a path and click one of these buttons you can start TAS Pro IDE/Compiler (TASPRO7.EXE) using the correct path of your project. Also start the runtime (TASRUNTIME.EXE) without the IDE. Or run the TAS PRO setup program (TP7SETUP.EXE) to make changes to the TASPRO.INI file

There are also three menu option.

File Menu Options.

Reindex Btrieve/Pervasive

Use this Option to re index Btrieve/Pervasive Tables in your project without opening the TAS Professional IDE or TASRUNTIME. Since the TAS professional IDE or Runtime opens some of the Data Dictionaries tables. this could prevent you from re indexing these tables. this option will allow you to even re index these tables.

Reindex Codebase

Use this Option to re index Codebase Tables in your project without opening the TAS Professional IDE or TASRUNTIME. Since the TAS professional IDE or Runtime opens some of the Data Dictionaries tables. this could prevent you from re indexing these tables. this option will allow you to even re index these tables.

See also Maintain dictionary for more information in the two re indexing tools.

Exit

Close the TASEXECUTE.EXE program


General

Navigation: Set Configuration >

General

 Print this Topic Return to chapter overview

The General Page will be displayed automatically when you execute the TP7SETUP.EXE program.

Default Path

This is where the programs you want to run are located. In most cases, this will be the same path as the data dictionary, but that's not always the case. This becomes the "default path" within the program. So, when ever you see an open file type dialog it will always start in this path. If you don't put any value here it will default to the Data Dictionary Path value automatically.

Data Dictionary Path

Enter the location of the data dictionary. If you are in the process of creating a new Development Path and you have copied a default data dictionary to the new path, this will default to that new path.

Initial Program Name

If you want the runtime to start with a specific program then enter that name here. You can click the [image] icon to get a list of RWN programs from which you can choose. If you don't enter a file name here the runtime will start with the default menu.

Initial Program is Main Menu

If you enter a program in the Initial Program Name field you will also be able to specify whether this is a Main Menu by checking this box. If this is checked the first program run replaces the default runtime menu. This program will act just like the default menu. This means that if you exit from this program, and other programs are still active, the runtime will attempt to close those first, and then exit from the main menu. Generally this will be a program that CHAINs to other programs, however, the CHAIN command works differently, check the command for more information. NOTE: When this is set this make this program the main menu and sets TAS Professional to use this as the main form in an MDI (Multiple Document interface) all TAS Professional programs chained from this menu program will become child programs. This new feature was introduced in version 7.2.

Startup Company

The company code for the data files that are opened. This would be the default value that can be overridden in your program.

MultiUser If multiple people/computers will be accessing the same data files you must check this box. This will make sure that only one user at a time can have the same record active.

NOTE: If your license is for single-user only (the second character in the License Type is "S") then this will have no effect.

Use CodeBase If you're using the CodeBase data manager (DBF files) instead of Btrieve then check this option.

NOTE: If you are converting your Btrieve data dictionary to CodeBase be sure this is NOT checked.

Use Btrieve Memos

If you are going to use Btrieve files primarily and want to be able to keep M type fields (memo) in those records also, you must have this box checked. This will automatically open the WBTRVMEMO.B file when TAS Pro loads. All Btrieve memo records are kept in this file. Please make sure the file exists before you check this box. If it doesn't you can get the XFR files to create this file from Computer Accounting Solutions and merge the FD into the data dictionary before you check this box.

Use File Manager

If you store your programs, screens, report formats, etc., in the File Manager then this flag must be checked.

TP Active for CB

If you are using CodeBase to access your data files and you are also using Transaction Processing commands then you must check this box before any programs are run. If you don't you will not open the CB log file and the Transaction Processing commands will not execute.

Btrieve Dictionaries

Since version 7.4 The programmer has the option to use btrieve/pervasive databases as the systems data dictionaries before you can use this feature you will have to run the wtascnvtbtrv.rwn program. This program will read the existing codebase data dictionaries into btrieve type dictionaries for use wit this option..

Note: If BtrieveDictionary=0 or BtrieveDictionary=1 is not entered into the TASPRO.INI file this will not be shown on on this screen.


User Options

Navigation: Set Configuration >

User Options

 Print this Topic Return to chapter overview

The User Options Page will contain variables that can be customized for each development path.

Ask Button Captions

When the ASK command executes a dialog box is displayed with two buttons. You can set the caption on those buttons to Yes (returns .TRUE. to the ASK() function) and No (returns .FALSE. to the Ask() function) or OK (.TRUE.) and Cancel (.False.).

Time AM/PM string

These are the two character maximum strings that will represent morning (AM) or evening (PM). They are used in the TTASTimeEnter, TTASDGItem and TTASDGColTemplate objects when you are displaying actual (not elapsed) times.

Increase Msg/Ask Box Size

This will allow you to increase the size of the messages that display during the MSG and ASK commands and general errors when running a program (either RUN or RWN).

C/S Logon Parameters

These are the values required to log on to the client/server file manager. If you check the Silent Logon box the program will log on to the c/s file manager automatically when TAS Pro or the runtime is loaded. If you don't, the log on screen will be display and the values you've entered here, if any, will appear in the log on screen.

NOTE: This box will appear ONLY if the c/s version of CodeBase is active.

NOTE: This information is encrypted when it is saved to the TASPRO.INI file.

RUN Form Display Size

When running RUN type program (non-GUI forms), you can preset the forms to display in three different sizes; Small, Medium and Large. The resolution of your monitor will determine which of these options you wish to use. On a monitor running at 1600x1200 the Small option will display very small. The choice you make depends on what you might like. The resolutions displayed next to the size options are the minimum resolution you should be running if you choose that size. It has nothing to do with the size of the form when it's displayed.

NOTE: If TAS Pro is running when you make this change you will have to exit out and restart before it takes effect.


Email Settings

Navigation: Set Configuration >

Email Settings

 Print this Topic Return to chapter overview

The Email Settings page must be filled in before you are able to send and receive email messages using TAS Pro.

POP3 Server The address of the POP3 server you use to receive email. This may be something like: pop3server@yourmail.com.

POP3 Password The password you use to receive mail at this server.

POP3 UserName This might also be known as your account code or name.

SMTP Server The address of the SMTP server you use to send email. This may be something like: SMTPserver@yourmail.com

SMTP Password Some mail servers require a password and user name to send email. In that case enter the send password here. This can be the same as the POP3 Password or may be different. Check with your email admnistrator for more information.

SMTP UserName Some mail servers require a password and user name to send email. In that case enter the send UserName here. This can be the same as the POP3 UserName or may be different. Check with your email admnistrator for more information.

EMail Address This is the address that will appear on any email you send as the Sender or From value. This would be something like me@yourmail.com

Name This is the "normal" name you want to appear on any email you send as the Sender or From value. This would be something like Tom Jones, etc.

Encoding How does your email system expect attachments to be encoded. Normally this would be MIME, the default value.

Character Set What character set are you using for messages. Normally this would be US-ASCII, the default value.

Time Out The number of seconds the email routine will try to send or receive an email before it fails. The default value is 60 seconds.

NOTE: This information is encrypted when it is saved to the TASPRO.INI file.


Source Code Editor

Navigation: Set Configuration >

Source Code Editor

 Print this Topic Return to chapter overview

The source code editor can display different parts of your program in different colors. This will allow you to quickly pick out different parts of a command, comments, etc. This page allows you to set those values.

Editor Color Options

Each of these options can have a different color assigned. You accomplish this by clicking on the appropriate radio button and then clicking on the color box. You can also display the item in Bold and/or Italics by clicking on those check boxes.

Margin Line On In the source editor a thin grey line can be displayed on the source editor at column 80. If this is distracting to you then uncheck this box. It has no effect on your source file.


Screen Editor

Navigation: Set Configuration >

Screen Editor

 Print this Topic Return to chapter overview

On this page you can specify a default font and object height to be used when creating new screen forms.

Font Name The name of the font you want to use when creating a new screen form.

Font Size The size of the font you want to use when creating a new screen form.

Default TAS Obj Height The starting height of all TAS entry objects that you place on the form.

Snap Grid Height: The height (or x value) in pixels for the snap to grid on the form you are editing. Default value is 8.

Snap Grid Width: The width (or y value) in pixels for the snap to grid on the form you are editing. Default value is 8.

Snap To Grid: To turn off the snap to grid completely, uncheck this value. Default value is checked.


TAS 5.1

Navigation: Set Configuration >

TAS 5.1

 Print this Topic Return to chapter overview

The fields on this page are for running TAS Professional 5.1 (RUN) programs and have no effect when running GUI (RWN) programs.

All of these setting only efect 5.1 programs compiled under TAS6 or if you are using TAS6EVO.

Underscore Menu Chr

Used with the NMENU command. If this is checked, and you have a & before a character in the menu line, the & will be removed and an underscore ( _ ) will be put under the character immediately to the right of the &.

Allow Gray If this is checked then inactive windows will be "grayed out" unless the command GRAY OFF has been executed.

Reduce Screen Width

Sometimes you can only display 79 columns due to monitor capabilities. However, screens are designed at 80 columns. In that case you need to check this box so that the screen will be reduced in size.

Initial Window Caption

This is the caption that will appear in the caption block at the top of the default form.

Video Rows Number of rows in base form.

Row Pixels The height of a single row in pixels. You may have to experiment with this number to get the screen to display properly on your monitor.

Video Cols Number of columns in bas form.

Col Pixels The width of a single column in pixels. You may have to experiment with this number to get the screen to display properly on your monitor.

Font Sz Reg Regular display (non-entry mode) font size. Must be 9, 16 or 18.

Font Sze Input Entry mode (during ENTER command) font size. Must be 9, 16 or 18.

Text Size All other text that displays on your form. Must be 9, 16 or 18.

Shadow Width Size in pixels of the raised border around windows and menus.

Dflt Printer Num This is the number of the LPT port to use as the default printer. You can use 1, 2 or 3.

Dflt Printer CTL Name

This is the name of the printer driver to be loaded at runtime.

Remove Vertical Box LInes

When box characters are displayed in TAS Pro (ver 1.09 and newer) the vertical lines may have spaces between the rows. To eliminate the vertical lines completely check this box. The top and bottom horizontal lines will still be displayed along with the corners.

Remove Box Corners

To eliminate the box corners completely check this box.

No 3D entry fields

If checked this will remove the 3D efect in your entry fields.

Remove all box lines

If checked this will remove all box characters fron the screen

Convert to single lines

This will convert all double line box characters to a single line this may display your old tas5.1 screens.

Terminal font

If this is clicked the font used in your entry boxes will use the old 5.1 terminal font.


TAS 5.1 Colors

Navigation: Set Configuration >

TAS 5.1 Colors

 Print this Topic Return to chapter overview

The color settings on this page will effect only the non-GUI forms in TAS Professional 5.1 programs.

Underscore Menu Chr

Used with the NMENU command. If this is checked, and you have a & before a character in the menu line, the & will be removed and an underscore ( _ ) will be put under the character immediately to the right of the &.

Base Form Colors

These are the basic screen colors. Everything other than windows, entry fields and menus. You can specify both background and text colors.

Field Objects on the Form

These are the actual entry fields. You can define both background (generally white) and text colors for both display and input modes. By changing the Entry and Display colors (Background, Text or both), you can quickly tell what the current entry field is.

Menu Colors These are the colors for menus that are displayed. The Selection Background and Text are for the actual selection bar.

Windows These are the colors for the windows that are opened on the screen. The Selection Background and Text apply only to the lists (such as the line items in SO-A).

NOTE: Make sure you don't choose the same color for Text and Background for any group. If you do it will appear that the text has disappeared when it hasn't.


Skins

Navigation: Set Configuration >

Skins

 Print this Topic Return to chapter overview

TAS professional powered by CAS supports a feature called Skins.

Description

Skins are a defined set of graphics and rules on how a windows screen and its objects look to the user. These skins are stored in files with the extension of *.skn. You can find a lot of the predefined skins in the skins folder in the \program files\tas7 folder. With Skins all you need to do is set the value for a valid skins file in the TASPRO.INI file or place it in the tp7setup program. You can also do this in your code by using the Change_skin() function.

This is what the TP7SETUP.EXE program will look when the user clicked on the apply button and a valid skin file name is placed in the default skin. When you execute your TAS Professional programs all of your programs will use this default skin. at the current time of writing there are over 50 skins files in TAS Professional powered by CAS to choose from.


XP Theme Support

Navigation: Set Configuration >

XP Theme Support

 Print this Topic Return to chapter overview

XP Theme

In TAS Professional powered by CAS. The programmer has the choice to support XP themes or not.

When we included this support in our application runtime and the IDE we ran into some problems when using skins. So what we have done is to let you the programmer use or not use this support. In the Install folder inside your Tas development there is a folder named XP Theme contains the XP theme support files for TAS professional Powered by CAS.

To use the files simply copy the file you want to use.

Example

If you want the runtime to use XP themes copy the TASRUNTIME.EXE.manifest file to the development folder you are working on and XP themes will start working.

Filenames are as follows.

TASRUNTIME.EXE.manifest This is the runtime theme support file.

TASPRO7.EXE.manifest This file is for the IDE

rbbuilder.exe.manifest This is the report builder support file.

TP7SETUP.EXE.manifest

TASEXECUTE.EXE.manifest This is for the TAS Exicute program.

Note: If you do have any problems using this interface just delete the XP Theme support file and the program will no longer use xp themes this may or may not be needed if you are using the skins feature in the system.

Note: Also in our testing of this feature we found that there were a lot of problems running the old TAS 5.1 type programs problems noted were the nmenu command would give your menu a transparent look. and there were a few other things we found so this is why we decided to let you the programmer decide to use this feature or not.

The install program is not setup to turn this feature on. You the program have to copy the manifest files into the application you want to use XP Themes.

One source of new updated skins for your computer is window blind's


General Information

Navigation: Reference >

General Information: Reference Section

 Print this Topic Return to chapter overview

Screen Painter Overview

More Information about how to use the screen painter.

Report Painter Overview

More Information about how to use the report painter.

Source Code Editor Overview

More Information about how to use the source code editor.

Form Objects

These are visual and non-visual objects that you would place on the screens/forms with the Screen Editor.

Report Objects

These are visual and non-visual objects that you would place on the report/forms with the Report Editor.

Commands

These make up most of the actual TAS Professional programs and are used to manipulate data, display information for the user and control which forms are displayed and which programs are run.

Functions

Similar to commands they are sometimes included as part of a command option or can stand alone.

Structure Commands

More information about the commands that makeup the different structures that are available.


Screen Painter Overview

Navigation: Reference >

Screen Painter Overview

 Print this Topic Return to chapter overview

MENU ACCESS

Program -> Screen Editor or Tool bar Button -> Screen

From the Main Menu click on the Screen icon. A blank screen will be displayed under the menu bar. However, if you look at the status bar at the bottom of the screen you will see Screen Painter in the first section. You can always refer to this section to make sure you're at the right place.

Now click on the New icon (it's the first one in the menu bar). Something similar to the screen below will be displayed. The actual layout will depend on your screen size settings. Part of the image below has been cropped to fit on the page.

NOTE: You can run the screen editor in as little as 800 x 600, however, we don't recommend it. Your minimum resolution should be at least 1024 x 768. The higher the resolution the more you'll see without having to move things around.

The screen displayed above is basically a blank canvas. You can put anything you want on it. Above the screen is what is called an object pallet.

Object Inspector

On the left side of the screen editor is the Object Inspector. Each object has properties. These properties can generally be set either at design time (what you're doing now) or runtime (when the user is running the program). To set them at design time you enter or change the value in the field next to the property name. Each property has been defined in the help file (documentation) for this object. To display that information click on the Help menu option at the top of the screen, click again on TAS Pro Help. A standard Windows help box will be displayed. By entering the name above, the appropriate help screen will appear.

The Object Inspector will always display the information for the current object. The name of the active object, and its type, will be displayed at the top of the Object Inspector (or OI for short).

The properties in the OI are logically divided into sections. So, for example, in the Position section are items like Top, Left, Height and Width. In the TAS Pro section are properties that involve connection to the program (FieldName, Events, etc).

Adding/Moving Objects on the Form

To place an object on the screen form you click on the icon and then click at the appropriate location on the form. A default version of the object will be displayed. You can then change the size by clicking on one of the sizer (or grabber) blocks that surround the object and, while holding the left mouse button down, move the mouse as appropriate.

You can also move the object anywhere on the form by clicking anywhere inside the object and, while holding the left mouse button down, move the object where you want it. As you're moving the object an outline shape of the object will move with the mouse. When you release the mouse button the object will 'move' to the new location.

Another way to move or resize the object is to change the property values that apply. These are Top, Left, Height and Width. All values are in pixels with the top left of the screen form position Top=0 and Left=0.

Multiple Screen Forms

You can have more than one form open at a time. Each form that is opened, or created when you click on the New button, will be on their own tab. The name of the form is on the appropriate tab. To move between forms all you have to do is click on the appropriate tab.

You can also copy and paste object from one screen format to the other.

Saving/Closing Screen Forms

To save an open screen form click the Save button. If this is a new screen a standard save file dialog will be displayed and you will be able to specify a form name and path. You can also save an existing form to a new name by clicking on the File->Save As menu option. Again, the save file dialog will be displayed and you can enter a different name, and possibly a new path, for the form. This allows you to easily reuse current screen forms and create new ones with minor or major differences.

You can also close the screen form without saving it by clicking on the Close button. If the form has been changed you will be given the chance to save the screen form before it is closed. The same applies if you exit TAS Professional completely and there are forms open that have been modified.

Object Pallet

There are five different tabs that make up this Tas Professional object pallet. They are: TASWin – all of the objects that are unique to TAS Professional ; Standard – objects that might be typically part of a standard screen; Additional – these are objects that you would use occasionally. More Objects in the Enhanced and Enhanced2 tabs. Each of these is described below:

TASWin Page

TASEnter - Use this object to enter any type A (alpha - string) field. There are other objects to enter numbers, dates and times. However, you can use this object to enter any value in your program.
TASNumEnter - Use this object to enter any numeric (N, B, I or R) type field. There are other objects to enter strings, dates and times.
TASDataGrid - This may be the most important object available. This will display a list of records or array field values on the form in a certain order in columns. You can allow the user to delete rows (records or array elements), insert rows (array elements only), add new rows to the end of the grid, and, through the use of the DATA_GRID command, add columns, remove columns, shift them around, etc.
TASComboBox - This object is similar to the TASEnter with a few extra options. You can create a list of values that the user can choose from if the click on the drop down button or as they are typing.
TASCheckBox - Use this object to replace a standard Y/N question. If the user checks the box the value returned to the field attached to the object will be Y; if unchecked, it will return N. You can also make the attached field a type L (logical). In that case the object will return .True. (clicked) or .False. (unclicked) as would be expected.
TASRadioButton - Use this object to replace a standard Y/N question. If the user checks the box the value returned to the field attached to the object will be Y; if unchecked, it will return N. You can also make the attached field a type L (logical). In that case the object will return .True. (clicked) or .False. (unclicked). The major difference between this object and the TASCheckBox is in usage. Generally, you would put two or more TASRadioButton objects on a TGroupBox. The group box allows only one radio button to be chosen at a time. Using this, you can give the user multiple choices with the knowledge that they can only choose one.
TASPageControl - This can be used to create a standard multi-page notebook on your form. You can place objects (including another TASPageControl) in the panel below the tabs and the objects will be seen only when the user chooses the appropriate tab.
TASTimeEdit - Use this object to enter/edit time values. You can also include a check box as part of this object. NOTE: The TASTimeEnter object is recommended for usage instead of this. The TASTimeEdit was retained strictly for compatibility with early versions.
TASComboEnter - This is a special version of the standard TASEnter object. Using this object you can allow the user to enter a value 'normally', and/or by chaining to a program routine when the user clicks on the button.
TASDGColTemplate - This is a duplicate of the TASDGItem (Columns) in a TASDataGrid object. Through the use of this object you can add to or update an existing grid through the use of the DATA_GRID command. This is a non-visible object.
TASNavigator - This is a special object that provides the user with a group of buttons that can be accessed by the user to scroll through the records in a file, delete a record, save a changed record or refresh a record from the file even after changes have been made. Use the NAVIGATOR command to link this object to a file and key. This is required before this command will have any effect.
TASStrList - This object can be used specifically to create a string list. To manipulate the list you can either use the appropriate property editor or the STRINGS() function. This is a non-visible object.

TASDateEdit - Use this object to enter any type D (date) field. There are other objects to enter numbers, strings and times.

TASTimeEnter – A newer version of the TASTimeEdit object. It allows for more flexibility in entering time and hours and is the recommended object to use.
TASMemo – This object is used in CodeBase files where you have included a Memo field as part of the FD. It acts as a small word processor and allows you to add and change memos directly to a file.

Standard Page

MainMenu - This object creates the menu that appears at the top of the form. The items that make up the menu are actually MenuItem objects. You create those by using the MenuItemEditor.
PopUpMenu - This object creates a menu that appears when the user right clicks on an object (you must specify the Popupmenu object name as the PopupMenu property). The items that make up the menu are actually MenuItem objects. You create those by using the MenuItemEditor.
Label - This object will allow you to put a fixed string on the form. It is the simplest of all objects that you will use and, along with TASEnter, probably one of the most used.
Memo - Use this object to put a mini-word processor on your form. If you want to allow your user to enter messages or notes, etc. you would use this object in connection with the STRINGS() function. This is different from the TASMemo above in that it cannot be connected to a field.
Button - This will display the standard Windows button on the form. The user will be able to 'click' on this button (press the left mouse button while the arrow is over the object) and have this execute an Event that will call a routine in your program. This is a common object and will probably be used often on your forms.
GroupBox - This object is used in connection with TASRadioButtons. When multiple radio buttons are placed on a single group box the user will be able to set only one of the options active at a time.
Panel - This object is similar to the Bevel in that it can put a border around other objects but it has other uses also. The types of styles available are greater than with a bevel and it 'owns' the objects placed on it. This means that if you set the Visible property of the panel to .False. all object that are on the panel, automatically become invisible also. The same applies to the Enabled property. This can be very useful when you know you want to effect a group of objects all the same way at the same time.

NOTE: The Panel object can also be used as a button since it has a CLICK event just like a button. This is very helpful when creating forms where you want to use buttons that have a different background color than a standard button. You can also place both an image and text (Label) on the panel object.

GlyphBtn - This will display a slightly different Windows button on the form. In this case the button can have a glyph (.bmp graphic) that is part of the button along with the caption. If you don't include the graphic this is identical to the standard Button object. The user will be able to 'click' on this button (press the left mouse button while the arrow is over the object) and have this execute an Event that will call a routine in your program.

Color Button

Additional Page

Image - Use this object to display an image on the form.

Shape - This object will allow you to draw a simple shape on the form. It can be used in the same manner as the Bevel, to put a box around an object or group of objects. Other than that, it has no other purpose.
Bevel - Use this object to put a bevel around entry objects or other screen objects. Even though this is a visible object there is no interface with the user other than beautifying your form.
StatusBar - This object is generally used to display information to the user at the bottom of the form. You can split up the bar into panels, each of which can be individually modified. The panels that make up the menu are actually StatusPanel objects. You create those by using the Status Bar Panel Editor.
ToolBar - This object creates a tool button bar that appears at the top of the form. The items that make up the bar are actually ToolButton objects.
DualListDialog - This is a non-visual object at design time that can display a very useful dialog at runtime. To execute this dialog you will use the DUAL_LIST_EXEC() function. Refer to this for an image of what the dialog will look like to the user. You will also use the STRINGS() function to determine what options the user has chosen, and perhaps, to set the options (strings) the user has to choose from.
AlarmClock - This object will place a clock on your form. It can be either digital or analog in shape and can be used to set an alarm that will call a routine in your program. If you want to execute an event at a regular interval you should use the RtnTimer instead of this object.
RtnTimer - It won't appear on your form at runtime, however, it can call a routine in your program at a semi-regular interval. If you want to execute an event only once a day at a specific time your should use the AlarmClock instead of this object. This is a non-visual object.

Enhanced page

Analog meter

Angle label

Animate

Date Label

Form fill

Gradient Panel

Percent Progress Bar

Running label

RX Label

RX switch

Speed button

Spin Edit

Split Panel

Scroll box

Enhanced 2 page

Calc Edit

RTF MEMO

NOTE: All objects start with the letter T, it has been removed in the examples above for clarity. However, the TASEnter object is really TTASEnter, Label is TLabel, etc. This is how they are referred to in the documentation.

See Also : Tutorial Part 3 - Creating a TAS Professonal sales program


Report Painter Overview

Navigation: Reference >

Report Painter Overview

 Print this Topic Return to chapter overview

MENU ACCESS

Program -> Report Editor or Tool bar Button -> Report

The Report Painter

The Report painter is your key to productivity when creating reports in TAS Professional. The TAS Professional engineers have made every effort to ensure that the Report painter interface is consistent with other Windows programs you've used before. The major areas of the Designer are listed below.

Component Palette Toolbars

These toolbars are used to create new components. To create a component, click on the icon and then click in the white space

of a band. There are three component toolbars: Standard, Data, and Advanced.

Use the Standard components to create text, lines, shapes, memos, richtext, etc.

Use the Data components when you want to display the data from a database.

Use the Advanced components when you need to create more complex reports using subreports, regions, or crosstabs.

Object Inspector

The object inspector allows you to set the most important property for a given component. For example, when a Label component is selected, an edit box appears that allows you to set the Caption. When a DBText component is selected, two drop-down lists appear that allow you to set the DataField.

Format Toolbar

This toolbar appears to the right of the Edit toolbar. It's used to configure the font of textual components and to control component layering via the Bring to Front and Send to Back commands.

Standard Toolbar

This tool bar is used to save, cut,copy, paste,print and other file operations

Rulers

The horizontal ruler allows you to determine a component's position on the page. The vertical ruler for each band allows you to determine a component's position relative to the starting print position of the band.

All Bands

Notice the gray rectangular area below the white space of each band. This area is draggable, and it allows you to redefine the height of the band.

Status Bar

The Status Bar shows messages and object positions.

Working with the Report Painter

Overview

The Report painter Designer is actually a sophisticated component editor for the report component (other examples of component editors in TAS Professional are the Menu Editor of the TMenu component.

The Report painter enables you to quickly and easily lay out complex reports in much the same way as the TAS Professional Form painter.

In TAS Professional.

Some tips to help you get the most out

of Report painter:

• Maximize the Report Designer window and use the speed menus as much as possible.

• To resize the bands using the mouse, position the mouse over the gray rectangular area below the white space of the band, press the left mouse button, and drag.

• To make a particular band appear as the selected object in the Object Inspector, position your mouse cursor anywhere over the open white space of the band (not over a component in the band) and click the left mouse button.

• You can cut, copy, and paste one or more report components at a time either in the same report or between different reports.

The Report Tree

You can display the Report Tree by selecting the View | Toolbars | Report Tree menu option. The report tree shows all of the bands and components in the report. The components for each band are listed in layered order (the order established via the Bring to Front and Send to Back commands). The bottommost component is listed first; the topmost component is listed last. You can use the Report Tree to see exactly what components are contained in the report and to select individual components.

You can turn on the Report Outline by right-clicking over the Report Tree. The Report Outline is useful when you have subreports in your report. You can select any subreport in the Report Outline and the bands and components for that subreport will appear in the Report Tree. (The subreport will also be displayed in the Report painter.)

Report Components

Overview

The Report painter Report object Library provides a powerful, robust set of report objects that have been designed and optimized specifically for the reporting environment in TAS Proffesional. The library includes over 20 components that enable you to put all types of data in your reports: Lines, Shapes,Text, Memos, RichText, Images, Charts, and BarCodes. Advanced components such as Regions, SubReports, and CrossTabs can be used to elegantly model complex reports.

Memo

Used to print multiple lines of plain text in a report. To set the value, assign a string list to the Lines property. To dynamically resize the memo during printing, set the Stretch property to True. Use the ShiftRelativeTo property to define dynamic relationships with other stretchable objects.

RichText (Not implemented in TAS pro yet)

Used to print formatted text. To set the value, assign the RichText property.

Label

Used to display text. Assign the Caption property to control the text value. To resize the label automatically so it fits a changing caption, set the Auto-Size property to True.

LoadFromFile or LoadFromRTFStream methods. Use the ShiftRelativeTo property to define dynamic relationships with other stretchable

objects. At design-time you can use Report-painters built-in RTF Editor to load, modify, and save rich text data stored in files.

SystemVariable

Used to display common report information such as page number, page count, print date and time, date, time, etc. The type of information displayed is controlled by the VarType property. The format is controlled by the DisplayFormat property.

Image

Used to display bitmaps and windows metafiles in reports. Assign the Picture property of this component in order to place an image in your report. Use the Report Designer's built-in picture dialog to load images at design-time.

Shape

Use this component to print various shapes (squares, rectangles, circles, ellipses). Set the Shape property to select a type of shape. Use the Brush and Pen properties to control the color and border respectively.

TeeChart (Not inplemented)

Used to display standard (non-data-aware) Tee-Charts. This component enables you to use Tee-Chart inside the Report Designer. You can access the TeeChart editor via a popup menu.

BarCode

Used to render barcodes. The string value assigned to the Data property is encoded based on the Bar-CodeType. If the data to be encoded is in a database, use DBBarCode. The following symbologies are supported: Codabar, Code 128, Code 39, EAN-13, EAN-8, FIM A,B,C, Interleaved 2 of 5, Post-Net, UPC-A, UPC-E.

CheckBox (Not implemented)

Displays a checkbox using the WingDings font.

DBText

Used for displaying values from all types of database fields. Use the DisplayFormat property to format the value.

DBMemo

Used to print plain text from a memo field of a database table. This control will automatically word-wrap the text. Set the Stretch property to True and the component will dynamically resize to print all of the text. Use the ShiftRelativeTo property to define dynamic relationships with other stretchable objects.

DBRichText (Not implemented)

Used to print formatted text from a memo or BLOB field of a database table. This control will automatically word-wrap the text. Set the Stretch property to True and the component will dynamically resize to print all of the text. Use the ShiftRelativeTo property to define dynamic relationships with other stretchable objects.

DBCalc

Used for simple database calculations (Sum, Min, Max, Count and Average). The value can be reset when a group breaks using the ResetGroup property.

DBImage

Used to print bitmaps or windows metafiles, which are stored in a database filenales or BLOB field. (Blob fileds have not yet been implemented)

DBBarCode

Used to render barcodes based on the BarCode-Type and the value supplied via the DataField property. The following symbologies are supported: Codabar, Code 128, Code 39, EAN-13, EAN-8, FIM A,B,C, Interleaved 2 of 5, PostNet, UPC-A, UPC-E.

DBTeeChart (not implemented)

Allows data-aware TeeCharts to be placed within a report.

DBCheckBox(Not implemented)

Displays a checkbox based on the value of the field specified in the DataField property. Can be used with a Boolean field (or any other type of field via the BooleanTrue, BooleanFalse properties).

Region

Used to logically group components together. Use the ShiftRelativeTo property to move the region in relation to another dynamically resizing component (such as Memo, RichText, or child-type Sub-Report).

SubReport

Used to handle multiple master details, create sideby-side reporting effects, and hook reports together as one. If you need a report to print within the context of a band, use a child-type subreport. If you need to hook reports together, use a section type subreport. The PrintBehavior property determines the subreport type.

CrossTab (Not implemented)

Used to present summarized data in a grid format.


Source Code Editor Overview

Navigation: Reference >

Source Code Editor Overview

 Print this Topic Return to chapter overview

MENU ACCESS

Program -> Program Editor or Tool bar Button -> Program

When you click on one of these options the following screen will be displayed.

On the right side of the screen you will see a tree listing of all the commands and functions for TAS Professional. As with a standard tree structure, some of the items (commands only) have a plus (+) sign to the left of the entry. If you click on this symbol the options for the command will be displayed.

If you double click on a command (or option, function, etc.) it will be inserted in your code at the current cursor location. If you double click on a command name that has sub-options, the entire command, including all the sub-options, will be inserted into your source file. You can then remove the items that you don't need.

The source editing form is very similar to a standard Windows® editor, except that the lines don't wrap when you get to a certain line length. Most of the features you would expect are part of this editor, including cut, copy and paste; drag and drop, etc. There are a couple of other options that are unique to a source code editor that you may not be familiar with, these are:

Goto Line: Each line in your source file has a line number. The numbering starts from 1 and the lines are numbered sequentially, including all blank lines, etc. The current line and column location are displayed in the left column immediately after the source editing area. To go to a specific line press the CTRL+G keys. A dialog box will be displayed and you can enter a line number.

Bookmarks: You can put up to 10 different bookmarks in the source file. These are not saved with the source file, but, are active as long as the file is being edited. What they allow you to do is mark a specific line. Then you can return to that line by pressing the appropriate keys or choosing the bookmark from the Bookmark menu option at the top of the screen When you set a bookmark on a line a small block with the appropriate number (0-9) is placed in the gutter (space to the left of the editing area).

To set a bookmark from the keyboard, press the CTRL+K+number keys where number must be 0-9. To return to the bookmarked line press the CTRL+Q+number key. To turn off a bookmark press the same CTRL+K+number keys you used to set it. Also, you can 'move' a bookmark to another line by doing the same on a different line than it was originally set.

Undo/Redo:If you make changes to the source file that you find you really don't want the easiest way to get rid of them is through the Undo feature. This option (along with Redo) is on the Edit menu. To undo changes from the keyboard enter the CTRL+Z keys, to redo (reverse the undo) enter the SHIFT+CTRL+Z keys. This is a very valuable feature and one you'll probably use often.

Find: Standard Windows® find option. This is on the Edit menu. From the keyboard use the CTRL+F keys.

Replace: Standard Windows® find and replace option. This is on the Edit menu. From the keyboard use the CTRL+R keys.

Lookup: An option unique to TAS Professional is the ability to search for field names using the same lookup routine you first saw in the screen editor. This option is also on the Editor menu or you can enter the CTRL+L keys. The field lookup dialog is displayed. If you choose a field (double click on the field name or press the OK button) it will be inserted into the code at the cursor location.

Convert Remarks: Remarks are messages to the future that you, or someone who might follow you, will refer to when trying to figure out what you were doing in a piece of program code. The more remarks you put the easier it will be to maintain or modify the program in the future. In TAS Professional there are two 'normal' ways of specifying remarks. If the remark is going to be short, a single line or less, you would use "//" (two forward slashes). Everything after the remark, on that same line, will be ignored when the program is compiled.

The second option is when you're going to have a remark that is going to take multiple lines. You can use the // remark at the beginning of each line or you can start the remark with "(*" (parenthesis + asterisk) and will continue over as many lines as you wish, until you put the closing characters which are the "*)" (asterisk + closing parenthesis).

In previous versions of TAS Professional the semi-colon (;) was the remark character, and that will still work in the compiler. However, the source editor doesn't recognize that as a remark. So, if you choose this option – on the Edit menu, the editor will change all of the old remarks (;) to new (//).

CTRL + A Select all text

CTRL + F Will bring up the find & replace option dialog.

CTRL + G Goto Line number.

CTRL + O Open Souce code dialog.

CTRL + P Print Dialog.

CTRL + R Replace dialog.

CTRL + S Save to disk.

CTRL + Z Goto end.

Right Click Options Menu

If you use your right click button on your mouse the following poupmenu will be displayed.

Help F1 From this menu you can get help on any TAS professional Command or function.

Spell Check If you have highlighted text in the editor use the Spell Check option.

Line Numbers By default the editor will not display line numbers if you click on this option a list of line numbers will display.

Cut Ctl+X If you have Highlighted text you want to Cut and palce in the windows clipboard click on this option.

Copy Ctrl+C If you have Highlighted text in the program editor this option will copy that text into the windows clipboard.

Paste Ctrl+V If you have cut or copied information into the windows clipboard place this option to paste that information into your source code.

The Behavior and colors used in this source code editor can be customized using the TP7Setup.exe program. or by making changes to the TASPRO.INI file.

CTRL+L Lookup a data dictionary field this can be a database field name or an field that has been defined in your program.

You can use the Data Dictionary window in the editor.

Click the data dict This will display a three grid display. The first is the file names in FILELOC.DBF. The second is this list of fields in the FD for that file. And the third is the key names for that FD. Click on any file name and the FD information will change. Since ver 7.4 we have added a feature to use this display to copy table/filenames field names and key names into the source code edior. doubleclick on the information you want to copy into the editor and it will be copied at current cursor position.


TAS Professional code tips

Navigation: Reference > Source Code Editor Overview >

TAS Professional code tips

 Print this Topic Return to chapter overview

In this short explanation we will try to explain sone of the undocumented features in the code editor/Compiler so lets get started.

In Earlier versions of TAS Version 4 and 5 you could truncate a line by using the '|' character In tas 6 and 7 we had to change this to a '||'

Example of using '||'

field1 = field2

field3 = field4

or

field1 = field2 || field3 = field4

will do the same thing.

Example of Set_Object

set_object 'button1' property 'caption' value 'My Button Caption'

or

'@button1.caption' = 'My Button Caption'

Long Message using the +\

msg "The maximum number of columns has been chosen. "+\

"Do not choose to print the Account Codes and "+\

"Calculated Percentages. There is not enough room on this 132 column report "+\

"for all the options you can choose here. You may choose one or the other, however."

You can also control CRLF in a message or Ask

ask "******************** CAUTION ********************"+crlf(2)+\

"This program will clear all 'yearly' data fields. "+\

"Please refer to your documentation for more details. "+\

"Also, be sure you have obtained back-ups for all data. "+crlf(2)+\

"More instructions follow// you may exit at any time. "+\

"Do you wish to continue?"

Breaking long command lines with the \ Char

scan @dict_hndl key dict_overlay while dict_buff_name = loc_buff_name start loc_buff_name,0! for (dict_type<>'V' .and. dict_type<>'O' .a. dict_type<> 'M') .a. dict_size<>0 scope N 1490

OR

scan @dict_hndl key dict_overlay while dict_buff_name = loc_buff_name \

start loc_buff_name,0! for (dict_type<>'V' .and. dict_type<>'O' .a. dict_type<> 'M') .a. dict_size<>0 \

scope N 1490


General Information

Navigation: Reference > Form Objects >

General Information: Form Objects

 Print this Topic Return to chapter overview

Form objects are just that, objects that you can place on forms. They will control almost all of the interaction your user will have with your program. For those of you familiar with Windows programming we have removed many of the properties that are available in these objects. Some we have added that are specific to TAS Professional. The ones we have removed you won't miss. If you want the kind of control you get with some esoteric property you might you once and never again, you should be writing applications in a different language. If you want to be able to create applications quickly and easily, something not normally associated with graphical interfaces such as Windows, you've come to the right place.

Properties are features of objects that effect how they look, how they operate, and the information they return to you. In general, all of these properties can be modified at both design and runtime. There is a list of some properties that are common to many of the objects; what they are, what they're used for, their type, etc. These are defined in separate sections under Common Properties rather than over and over again each object.

All properties have some sort of editor connected to them. Some allow a string of characters to be entered, some a list of strings, and some as simple as a check mark. In the Property Editor section we explain each of those that involve more than just an entry of a string, integer, or True/False choice.

If the property can be accessed at runtime using the SET_OBJECT command the property is listed as being modifiable at runtime. Properties that can be modified can also be read through the use of the GET_OBJ_PROP() function.

For each object you will see the appropriate icon on the object palate, a description of what the object is used for, a list of properties that are unique to that object (or haven't been previously defined in Common Properties) and any Events that apply to that object.

Most every object (at least those that allow user interaction) have what we call Events. These are slightly different than what you might be used to if you've programmed in Delphi or VB or a similar language. These Events are closely linked with the code that you will create in the source code editor and are used to execute sections of code. Information on how to correctly program the event call is part of each appropriate object.

For more information about how objects are placed on a form, moved around, or removed please refer to the tutorial, specifically PART 3 - CREATING A NEW SALES PROGRAM. or Screen Painter Overview

NOTE: All objects have properties that have check marks as the value. These are actually True/False properties and can be set at runtime by setting the property to .True. to make it checked or .False. to clear the check mark.

NOTE: In objects such as buttons, menus, etc., you are able to specify a caption that appears to the user and can be 'clicked' using the mouse. When specifying the caption you can include in the string an ampersand (&) symbol, for example, &Help. When the caption is displayed the H in Help will be underlined. The user can press the ALT+H keys and this will have the same effect as if they had clicked the item with the mouse. A good example of where this is commonly used is in the main menu for a form (appears at the top of the form). The first option is almost always File and the F has been marked so that the user can press the ALT+F key to display the options for that menu. Sub menus are slightly different in that once the menu is displayed you no longer have to press the ALT key also. The ampersand can be anywhere in the string, however, you want to make sure that there are no duplicates or the program won't know which one to pick.


TAlarmClock

Navigation: Reference > Form Objects >

TAlarmClock

 Print this Topic Return to chapter overview

This object will place a clock on your form. It can be either digital or analog in shape and can be used to set an alarm that will call a routine in your program. If you want to execute an event at a regular interval you should use the TRtnTimer instead of this object.

The icon for this object is on the Additional page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Color

Ctl3D

Cursor

ParentColor

Behavior

Enabled

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

AlarmEnabled If this property is checked (True) then the alarm, as set in AlarmHour, AlarmMinute, AlarmSecond is active. If this is not checked (False) then regardless of the values in the following three properties, the alarm event will not fire. If this is checked and a time value is entered in the following three properties, then the .RING event (see below) will fire when the time on your computer matches. If the form containing this object is loaded after the time specified the alarm event won't fire until it reaches the time again.

AlarmHour This is the hour value for the alarm.

AlarmMinute This is the minute value for the alarm.

AlarmSecond This is the second value for the alarm.

Anchors

BevelInner This will effect the look of the panel. The options are: bvLowered, bvNone (the default value), bvRaised and bvSpace.

BevelOuter This will also effect the look of the panel. The options are: bvLowered, bvNone, bvRaised (the default value) and bvSpace.

BevelWidth This is how wide the bevel is in pixels. The default value is 1.

BorderStyle By manipulating all four of these properties (BevelInner, BevelOuter, BevelWidth and BorderStyle) you can completely change the look of the panel.

BorderWidth

Constraints

LeadingZero

ParentCtl3D

ShowMode scDigital will show the clock in standard digital form, as shown above. scAnalog will display a round clock face with hour, minute, and, if ShowSecond property is checked, a second hand.

ShowSecond If this property is checked (True) the seconds value will be displayed on the clock, analog or digital.

TwelveHour If this property is checked (True) the clock with display with an AM or PM designator if the clock is in digital mode. Otherwise it will use twenty-four hour or military time.

Position

Align

AutoSize

Height

Left

Top

Width

COMMENTS

You can still use the alarm capabilities of the object and not display the clock on your form by unchecking the Visible property (set to False).

EVENTS

This object has a single event that is called if you have checked the AlarmEnabled property and set the AlarmHour, AlarmMinute and AlarmSecond property values. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Ring). The full event name would be ObjectName.Ring:. You would not return a value from the program, just a simple RET is all that is required. So, if the alarm "rings" and if the event label exists, the routine is called, you return from the routine, and the user has control again.


TAnalogSensor

Navigation: Reference > Form Objects >

TAnalogSensor

 Print this Topic Return to chapter overview

This object can give the user a visible analog graph. The icon for this object is on the Enhanced page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment In this object the default is taCenter

Caption This is the text that is displayed on the on the object. The default is the name of the object.

Color

Ctl3D

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

AnalogKind There are three kinds of display of this object akAnalog, akHorizontal, akVertical

Anchors

BevelInner This will effect the look of the panel. The options are: bvLowered, bvNone (the default value), bvRaised and bvSpace.

BevelOuter This will also effect the look of the panel. The options are :bvLowered, bvNone, bvRaised (the default value) and bvSpace.

BevelWidth This is how wide the bevel is in pixels. The default value is 1.

BorderStyle By manipulating all four of these properties (BevelInner, BevelOuter, BevelWidth and BorderStyle) you can completely change the look of the panel.

BorderWidth

ColorBack This is the back ground color.

ColorFour This is the fore color or progress color.

ColorRed This is the color for your redline.

ColorYellow This is the color for your yellow or caution line.

Constraints

ParentBackground

ParentCtl3D

ShowLevel If you want to show the value set this to true.

ShowText Set this to true to show the caption value.

Value This the value displayed.

ValueMax This is a threshold or Maximum value.

ValueMin This is the minimum value.

ValueRed This is the value for your redline.

ValueYellow This is the value for your yellowline.

Position

Align

Height

Left

Top

Width

EVENTS

This object has a single event that is called if your user clicks the button. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks the button, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple buttons call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.


TAnimate

Navigation: Reference > Form Objects >

TAnimate

 Print this Topic Return to chapter overview

Use this object to display a Windows animation on the form. An animation control is a window that silently displays an Audio Video Interleaved (AVI) clip. An AVI clip is a series of bitmap frames like a movie. Although AVI clips can have sound, you cannot use such clips with animation controls. You can use only silent AVI clips. Note:The common animation style displayed is dependant on your version of windows. The icon for this object is on the Enhanced page.

PALETTE ICON & SAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Color

Cursor

Transparent

Behavior

Visible

Hint

Hint

ParentShowHint

ShowHint

Misc

Name

Tag

Other

Active Set the animation on or off values are .true. or .false.

Anchors

Center Use this to center the AVI in the space you have drawn. This can be done at runtime.

CommonAvi Sets the animation to be used, valid options are aviNone, aviFindfolder, aviFindfile, aviFindcomputer, aviCopyfiles, aviCopyfile, aviRecyclefile, aviEmptyrecycle, aviDeletefile.

Constraints

FileName Setting FileName causes the control to load the animation from the specified file. FileName must refer to a Windows AVI file. The sound track, if present, is ignored. Note: Setting FileName automatically sets the CommonAVI property to aviNone.

Repetitions Specifies how many times to repeat the animation, integer value. A value of zero repeats forever.

StartFrame Set StartFrame to specify the first frame shown when the Active property is set to true. When StartFrame is 1, the clip is played from the very beginning, when StartFrame is 2, the clip begins with the second frame, and so on. If Repetitions is not 1, after the sequence of frames is played, it starts over at the frame specified by StartFrame (which may not be the first frame in the clip).

StopFrame Set StopFrame to specify the last frame shown every time the animation control displays its sequence of frames. When StopFrame is 0, the clip is played to the very end. Otherwise, StopFrame is the number of the frame in the sequence. When the Active property is set to true, the animation control displays the sequence of frames from StartFrame to StopFrame, repeating this sequence by the number of iterations specified by the Repetitions property. Note: The Play method overrides StopFrame with the value passed as the ToFrame parameter.

Timers Not supported in TAS Professional Powered by CAS

Position

Align

AutoSize Size the object box to fit the image loaded. If you want to use the Stretch property above then you should not choose this property (set to .False.). If this is checked (set to .True.) it will override the Stretch setting.

Height

Left

Top

Width

EVENTS

There are no events for this object.

NOTE: On windows vista there are no common AVI so if your going to use this object on Vista you will have to provide files for your animations.


TBevel

Navigation: Reference > Form Objects >

TBevel

 Print this Topic Return to chapter overview

Use this object to put a bevel around entry objects or other screen objects. Even though this is a visible object there is no interface with the user other than beautifying your form. The icon for this object is on the Additional page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Cursor

Behavior

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

Name

Tag

Other

Anchors

Constraints

Shape This determines the shape of the bevel. The options are: bsBottomLine, bsBox (default), bsFrame, bsLeftLine, bsRightLine, bsSpacer, bsTopLine.

Style This determines whether the bevel is lowered (bsLowered - default) or raised (bsRaised).

Position

Align

Height

Left

Top

Width

EVENTS

There are no events for this object.


TButton

Navigation: Reference > Form Objects >

TButton

 Print this Topic Return to chapter overview

This will display the standard Windows button on the form. The user will be able to 'click' on this button (press the left mouse button while the arrow is over the object) and have this execute an Event that will call a routine in your program. This is a common object and will probably be used often on your forms. The icon for this object is on the Standard page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Caption This is the text that is displayed on the face of the button. This is any standard string and can be changed at runtime.

Cursor

Behavior

Cancel If this is checked (set to .True.) the Click event (see below) will execute if the user presses the ESC key. This property can be set during runtime.

Default If this is checked (set to .True.) the button will be the default object on the form. This means if the user presses the ENTER key it will have the same effect as if they had clicked the button.

NOTE: If you have entry objects on the form, e.g. TTASEnter, with the ReturnIsTab property checked (set to .True.) then this will be ignored.

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

Constraints

ModalResult If this button is on a form loaded using the LOAD_MODAL_FORM() function this would be one way to set the Modal_Result property for that form. This will release the form and return the appropriate value from the function. If it is placed on a non-modal form (most often) you can still determine which button is calling by setting up a separate event (see below) or putting a value in the Tag property and checking that property in the common event called. These values are defined in COMPILERCONSTANTS.TXT. This property can be modified during runtime.

Position

Height

Left

Top

Width

EVENTS

This object has a single event that is called if your user clicks the button. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks the button, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple buttons call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.


TColorButton

Navigation: Reference > Form Objects >

TColorButton

 Print this Topic Return to chapter overview

This will display the Windows color button on the form. The user will be able to 'click' on this button (press the left mouse button while the arrow is over the object) and have this execute an Event that will call a routine in your program. This is a enhanced object this is like the TButton and will probably be used often on your forms. The icon for this object is on the standard page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Caption This is the text that is displayed on the face of the button. This is any standard string and can be changed at runtime.

Cursor

WordWrap If the Caption is too long to fit within a single line you can stretch the label box and check this option (set to .True.). The label will then be treated like a minor memo and the Caption will word wrap within the box provided. You can adjust the box and the Caption will wrap to fit.

Behavior

Cancel If this is checked (set to .True.) the Click event (see below) will execute if the user presses the ESC key. This property can be set during runtime.

Default If this is checked (set to .True.) the button will be the default object on the form. This means if the user presses the ENTER key it will have the same effect as if they had clicked the button.

NOTE: If you have entry objects on the form, e.g. TTASEnter, with the ReturnIsTab property checked (set to .True.) then this will be ignored.

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

BackGroundColorIn This is the color when the button is activated or pushed.

BackGroundColorOut This is the color of the button when the button is at rest or not pushed

Constraints

FontColorIn This is the color of the font when the button is pushed.

FontColorOut This is the color of the font when the button is not active or pushed.

ModalResult If this button is on a form loaded using the LOAD_MODAL_FORM() function this would be one way to set the Modal_Result property for that form. This will release the form and return the appropriate value from the function. If it is placed on a non-modal form (most often) you can still determine which button is calling by setting up a separate event (see below) or putting a value in the Tag property and checking that property in the common event called. These values are defined in COMPILERCONSTANTS.TXT. This property can be modified during runtime.

Position

Height

Left

Top

Width

EVENTS

This object has a single event that is called if your user clicks the button. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks the button, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple buttons call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.


TControlBar

Navigation: Reference > Form Objects >

TControlBar

 Print this Topic Return to chapter overview

This object manages the layout of toolbar objects.

Note: At the current time this object is not on the TAS Professional pallet and not available for use.

Description

Use TControlBar as a docking site for toolbar components. Control bars contain child controls (usually TToolBar objects) that can be moved and resized independently at runtime. each child control resides on its own individual band that the user positions by dragging it's sizing grip.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Color

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

BorderWidth

AutoDock Determines whether the control bar temporarily docks drag clients to provide visual feedback. If AutoDock is true (the default), when a dockable object is dragged over the control bar, the control bar temporarily docks the object so that the user can see the impact of the drag operation. That is, the user can see the dock position and how other docked controls will be repositioned to make room. When the user releases the mouse, the dragged object is docked at the current spot, and any temporary dockings are canceled. However, if the user cancels the drag-and-dock operation, the dragged object reverts to its last temporary dock site rather than to its location at the start of the drag operation. If AutoDock is false, the control bar does not temporarily dock dragged objects. Instead, the user only sees the dragging rectangle as it passes over the control bar, with no feedback as to the adjustments the control bar would make if the dragged object were released.

AutoDrag Specifies whether control bands can be undocked by dragging. Use AutoDrag to specify whether control bands are automatically undocked when the user drags them. If AutoDrag is true, control bands (TToolBar objects) are undocked when dragged off the control bar. Otherwise, control bands are kept within the control bar.

BevelEdges

Constraints

Position

Align

AutoSize

Height

Left

Top

Width

COMMENTS

This object would only be used during design.

EVENTS

There are no events for this object.


TDCFormFill

Navigation: Reference > Form Objects >

TDCFormFill

 Print this Topic Return to chapter overview

Use this object to display a predefined background on the form.

The icon for this object is on the Enhanced page.

PALETTE ICON

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Cursor

Behavior

Visible

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Fill Type Sets the background image, the following options are valid: Adobe, Alcatraz, ElPaso, Hanoi, Harvard, Holes, Hollywood, Honolulu, London, Manhattan, Minsk, Orleans, Oshawa, Philadelphia, Pittsburg, Sahara, Smithsonian

Position

Align

Height

Left

Top

Width

COMMENTS

This object will appear behind any other objects you put on the form. This is a background or backdrop for your form.

EVENTS

There are no events for this object.


TDualListDialog

Navigation: Reference > Form Objects >

TDualListDialog

 Print this Topic Return to chapter overview

This is a non-visual object at design time that can display a very useful dialog at runtime. To execute this dialog you will use the DUAL_LIST_EXEC() function. Refer to this for an image of what the dialog will look like to the user. You will also use the STRINGS() function to determine what options the user has chosen, and perhaps, to set the options (strings) the user has to choose from. The icon for this object is on the Additional page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Ctl3d NOTE: This doesn't apply to the object on the form but the dialog that can be executed during runtime.

Misc

HelpContext

Name

Tag

Other

CancelBtnCaption The caption that appears on the cancel button when the dialog is executed. The default value is "Cancel" and can be modified during runtime.

HelpBtnCaption The caption that appears on the help button when the dialog is executed. The default value is "&Help" and can be modified during runtime.

Label1Caption The caption that appears above the string list on the left. The default value is "&Source" and can be modified during runtime.

Label2Caption The caption that appears above the string list on the right. The default value is "&Destination" and can be modified during runtime.

List1 The string list that appears on the left, the source list. You can create/edit this list during design by clicking on the button in the property field. This will bring up the standard Strings Property Editor. You can also edit this field during runtime through the use of the STRINGS() function.

List2 The string list that appears on the right, the destination list. You can create/edit this list during design by clicking on the button in the property field. This will bring up the standard Strings Property Editor. You can also edit this field during runtime through the use of the STRINGS() function.

OkBtnCaption The caption that appears on the ok button when the dialog is executed. The default value is "OK" and can be modified during runtime.

ShowHelp If this is checked (set to .True.) the Help button will be displayed on the dialog box. If not, you will only have Ok and Cancel. This can be modified during runtime.

Sorted If this is checked (set to .True.) the string lists will be sorted alphabetically, in ascending mode. This can be modified during runtime.

Title The caption that appears at the top of the dialog box. The default is blank. This can be modified during runtime.

COMMENTS

See Object General Info for more about the use of the ampersand (&) as part of a button caption.

EVENTS

There are no events for non-visible objects.


TGauge

Navigation: Reference > Form Objects >

TGauge

 Print this Topic Return to chapter overview

This object can give the user a visible idea of how close a process is to completion the object is like the TProgressBar. The icon for this object is on the Enhanced page. The aditional feature this object has is a % of completion can change displayed colors with backcolor and for color properties.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Cursor

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

BackColor Specifies the background color of the gauge.
ForeColor Specifies the foreground color of the gauge.

BorderWidth

Constraints

Max When you setup this object you need to specify the beginning and end point for the image to be displayed to the user. The default for Max is 100, as in 100%. If you are reading through a file and know the number of records you have to read, you can set this property to the number of records and each time you read a record increment the Position property. This property can be modified during runtime.

Min The starting point for the image to be displayed. Generally this will be set to 0 but it can be set to any value you wish as long as it's less than the Max property. This property can be modified during runtime.

Orientation Does the image progress from left to right (pbHorizontal - default value) or bottom to top (pbVertical).

NOTE: The position of the progress bar on the form will NOT change when you change this value. Only the direction of the internal bar during your program operation will change. This means you must change the size of the bar yourself to tall and narrow from short and wide before saving the form.

Position NOTE: This property doesn't exist on the property editor. However, it is used by you during your program to move the progress bar during the process. You would increment this value during each loop or when a record is read, etc. Each time the Position value exceeds the next Step (see below) the progress bar will display a little longer (or taller depending on the Orientation property). This property can only be changed at runtime.

Smooth If this property is checked (set to .True.) then the progress bar will be a single smooth line of color. The default value is not checked (.False.) and the progress bar will increment in block form.

Step This is the change in the Position property that must occur before the progress bar changes. The default value is 10 which means the Position property must change by a value of 10 before the progress bar increases in size. This default setting in is keeping with the Min/Max properties of 0 and 100 (or 0% and 100%) in which case this could be considered 10%. You should set this value to some logical portion of the difference between Min and Max. If it's too small the blocks in the progress bar will be very small. This property can be modified during runtime.

Position

Align

Height

Left

Top

Width

EVENTS

There are no events for this object.

Sample 1

//use this is an sql or a while loop using a counter.

define rec_cntr,cntr type I

'@Gage1.max' = rec_cnt

while dummy_l = .t.

'@Gage1.position' = cntr

inc cntr

//find next record till done

endw

Sample 2

// Use this if your checking a file/Table no need to set the max

'@Gage1.position' = 0

scan @myfile_hndl key @0 while this_field = that_field

'@Gage11.position' = REC_PERCENTAGE(myfile_hndl)

save @myfile_hndl nocnf

ends

NOTE: you could also use the SET_OBJECT to do this and there could be other ways to do this as well Just some code to look at here.


TGlyphBtn

Navigation: Reference > Form Objects >

TGlyphBtn

 Print this Topic Return to chapter overview

This will display a slightly different Windows button on the form. In this case the button can have a glyph (.bmp graphic) that is part of the button along with the caption. If you don't include the graphic this is identical to the standard TButton object.

The user will be able to 'click' on this button (press the left mouse button while the arrow is over the object) and have this execute an Event that will call a routine in your program. The icon for this object is on the Standard page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Caption This is the text that is displayed on the face of the button. This is any standard string and can be changed at runtime.

Cursor

Glyph If you have chosen a custom glyph (bkCustom) in GlyphKind below this is where you would choose the .bmp file that would be used instead of the standard ones that come with this object.

Behavior

Cancel If this is checked (set to .True.) the Click event (see below) will execute if the user presses the ESC key. This property can be set during runtime.

Default If this is checked (set to .True.) the button will be the default object on the form. This means if the user presses the ENTER key it will have the same effect as if they had clicked the button.

NOTE: If you have entry objects on the form, e.g. TTASEnter, with the ReturnIsTab property checked (set to .True.) then this will be ignored.

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

Constraints

GlyphKind This will determine what appears on this object. The options are: bkCustom (this will use what ever you have chosen in the Glyph property above - this is the default value), bkOK (sets the ModalResult property to mrOK), bkCancel (sets the ModalResult property to mrCancel), bkHelp (sets the ModalResult property to mrNone), bkYes (sets the ModalResult property to mrYes), bkNo (sets the ModalResult property to mrNo), bkClose (sets the ModalResult property to mrNone), bkAbort (sets the ModalResult property to mrAbort), bkRetry (sets the ModalResult property to mrRetry), bkIgnore (sets the ModalResult property to mrIgnore) and bkAll (sets the ModalResult property to mrAll). Each one of these options has their own unique glyph except for bkCustom which has none. The options are defined in COMPILERCONSTANTS.TXT and can be modified during runtime.

Layout This determines where the glyph will be displayed in relation to the caption. The default is blGlyphLeft. The other options are: blGlyphBottom (under the caption), blGlyphRight (to the right of the caption) and blGlyphTop (on top of the caption).

Margin The number of pixels between the glyph and the sides of the button. The default value of -1 will center the Glyph and the Caption on the button face. This property can be modified during runtime.

ModalResult If this button is on a form loaded using the LOAD_MODAL_FORM() function this would be one way to set the Modal_Result property for that form. This will release the form and return the appropriate value from the function. If it is placed on a non-modal form (most often) you can still determine which button is calling by setting up a separate event (see below) or putting a value in the Tag property and checking that property in the common event called. These values are defined in COMPILERCONSTANTS.TXT. This property can be modified during runtime.

NumGlyphs If you have two glyphs that can be displayed, one normally, and the second when the user clicks the button, then this would be two. The default value is one. This value changes automatically depending on the GlyphKind property.

Spacing This is the number of pixels between the glyph and the Caption. The default value is 4 and can be changed during runtime.

Style This controls what the button looks like. You should leave it set on bsAutoDetect.

Position

Height

Left

Top

Width

EVENTS

This object has a single event that is called if your user clicks the button. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks the button, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple buttons call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.


TGroupBox

Navigation: Reference > Form Objects >

TGroupBox

 Print this Topic Return to chapter overview

This object is used in connection with TTASRadioButtons. When multiple radio buttons are placed on a single group box the user will be able to set only one of the options active at a time. The icon for this object is on the Standard page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Caption This is the text that is displayed on the top of the group box. The default is the name of the object.

Color

Ctl3D

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

Constraints

ParentCtl3D

Position

Align

Height

Left

Top

Width

COMMENTS

You must place the TGroupBox on your form before any TTASRadioButtons. If you forgot to do this first and you've already placed radio buttons you cannot just move the radio button object from someplace else on the form onto the group box. You can, however, copy it (click on the object, right click and choose copy or press CTL+C) and then paste it on the group box (right click on the group box and choose Paste or CTL+V) and then delete the original radio button.

EVENTS

This object has a single event that is called if your user clicks on the object. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks on the object, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple objects call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.


TImage

Navigation: Reference > Form Objects >

TImage

 Print this Topic Return to chapter overview

Use this object to display an image on the form. The icon for this object is on the Additional page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Cursor

Transparent Some .BMP files have backgrounds that can be made transparent. If this option is checked (set to .True.) that will be the case. This can be changed at runtime.

Behavior

Enabled

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

Name

PopupMenu

Tag

Other

Anchors

Center If you want to center the image in the object space then choose this option (set to .True.). This can be changed during runtime.

Constraints

IncrementalDisplay If the image is very large you can display it a little at a time by choosing this option (set to .True.). This is probably not necessary on most computers today. This can be changed during runtime.

Picture The image you want to display. This can be any .BMP, .ICO, .EMF or .WMF file. You can choose the file by entering a file name (including a full path if necessary), using the Load Image Editor, or during runtime by specifying the file name (including a full path if necessary). You can also set this value during runtime by using the LOAD_PICTURE command. Note: Since version 7 We now suport many other graphic formats.

NOTE: We are working on including .JPG and .GIF files also. These should be available soon. These formats and more and now supported.

Stretch If this option is checked (set to .True.) the image will stretch to match the size of the object, if possible. .ICO files will not stretch. This can be changed during runtime.

Position

Align

AutoSize Size the object box to fit the image loaded. If you want to use the Stretch property above then you should not choose this property (set to .False.). If this is checked (set to .True.) it will override the Stretch setting.

Height

Left

Top

Width

EVENTS

This object has a single event that is called if your user clicks on the object. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks on the object, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple objects call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.


TImageList

Navigation: Reference > Form Objects >

TImageList

 Print this Topic Return to chapter overview

This is a non-visible object. The purpose of this object is to create a catalog of images that will be used in conjunction with a TToolBar, TMainMenu or TPopupMenu. The icon for this object is on the Additional page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Misc

Name

Tag

Position

Height The height of the images in pixels.
Width The width of the images in pixels.

COMMENTS

This object would only be used during design. You only need to use this if you are including a TToolBar, TMainMenu or TPopupMenu object on your form. These objects can make use of the TImageList items.

To add images to the catalog you would right click on the object and choose the ImageList Editor option. This will connect you to the proper editor.

EVENTS

There are no events for this object.


TLabel

Navigation: Reference > Form Objects >

TLabel

 Print this Topic Return to chapter overview

This object will allow you to put a fixed string on the form. It is the simplest of all objects that you will use and, along with TTASEnter, probably one of the most used. The icon for this object is on the Standard page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Caption This is the text that will appear on the form. It is any standard string and can be modified at runtime.

Color

Cursor

ParentColor

Transparent If you want to put a label on a TImage you can check this option (set to .True.) and only the text will appear instead of both the text and the background color.

NOTE: To get a TLabel object to appear on top of an image you must right click on the label and then choose the Bring To Front option before you move the label to the image, or, it will go behind the image.

WordWrap If the Caption is too long to fit within a single line you can stretch the label box and check this option (set to .True.). The label will then be treated like a minor memo and the Caption will word wrap within the box provided. You can adjust the box and the Caption will wrap to fit.

Behavior

Enabled

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

FocusControl Even though this object has no events attached to it, you can specify which object will get focus (become active) if the user should click on the label instead of the object you expected. This can happen when the label defines what the object is. The user may not know where to click (especially if they are new to GUI programs) and, by setting this option, you give them an extra choice. The object property is a standard drop box and, if you click on the down arrow, a list of objects on your form that can receive focus (can be made active) will be displayed.

Name

PopupMenu

Tag

Other

Anchors

Constraints

Layout You can set where the caption will be displayed within the label box. The options are: tlTop (display at the top of the box), tlBottom (display at the bottom of the box) and tlCenter (display at the center of the box). The default value is tlTop, however, when you first create a TLabel object the box will be created the size of the caption. So, this option has little effect unless you change the size of the label box on the form.

ShowAccelChar If you use an ampersand (&) in the caption it will be treated the same way as if you were creating the caption for a button (see General Info for more on ALT+ keys). If this option is checked (set to .True.), the default value, the underscore will be displayed for the user.

Position

Align

AutoSize

Height

Left

Top

Width

EVENTS

This object has a single event that is called if your user clicks on the object. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks on the object, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple objects call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.

See Also : TAngleLabel TRunningText TrxLabel


TAngleLabel

Navigation: Reference > Form Objects >

TAngleLabel

 Print this Topic Return to chapter overview

This object TAngleLabel is a Label with some additional special effects. This object will allow you to put a fixed string on the form. The icon for this object is on the enhanced page.

PALETTE ICON and Sample

Description

TAngleLabel supports shadows (like 3D style). In addition to standard label properties. You can display the text under any angle. This component allows to change a horizontal alignment and vertical layout.

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Caption This is the text that will appear on the form. It is any standard string and can be modified at runtime.

Color

Cursor

ParentColor

Transparent If you want to put a label on a TImage you can check this option (set to .True.) and only the text will appear instead of both the text and the background color.

NOTE: To get an object to appear on top of an image you must right click on the label and then choose the Bring To Front option before you move the label to the image, or, it will go behind the image.

WordWrap If the Caption is too long to fit within a single line you can stretch the label box and check this option (set to .True.). The label will then be treated like a minor memo and the Caption will word wrap within the box provided. You can adjust the box and the Caption will wrap to fit.

Behavior

Enabled

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

FocusControl Even though this object has no events attached to it, you can specify which object will get focus (become active) if the user should click on the label instead of the object you expected. This can happen when the label defines what the object is. The user may not know where to click (especially if they are new to GUI programs) and, by setting this option, you give them an extra choice. The object property is a standard drop box and, if you click on the down arrow, a list of objects on your form that can receive focus (can be made active) will be displayed.

Name

PopupMenu

Tag

Other

Anchors

Angle This will control the angle that your text lable will be displayed.

Constraints

Layout You can set where the caption will be displayed within the label box. The options are: tlTop (display at the top of the box), tlBottom (display at the bottom of the box) and tlCenter (display at the center of the box). The default value is tlTop, however, when you first create a TLabel object the box will be created the size of the caption. So, this option has little effect unless you change the size of the label box on the form.

ShadowColor Sets the color of the label shadow

Position

Align

AutoSize

Height

Left

Top

Width

EVENTS

This object has a single event that is called if your user clicks on the object. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks on the object, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple objects call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.

See Also : Tlabel TRunningText TrxLabel


TDateLabel

Navigation: Reference > Form Objects >

TDateLabel

 Print this Topic Return to chapter overview

This object will allow you to display the date and time derived from the computer date on the form. The icon for this object is on the Enhanced page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Caption This is the text that will appear on the form. It is any standard string and can be modified at runtime.

Color

Cursor

ParentColor

Transparent If you want to put a label on a TImage you can check this option (set to .True.) and only the text will appear instead of both the text and the background color.

NOTE: To get a TLabel object to appear on top of an image you must right click on the label and then choose the Bring To Front option before you move the label to the image, or, it will go behind the image.

WordWrap If the Caption is too long to fit within a single line you can stretch the label box and check this option (set to .True.). The label will then be treated like a minor memo and the Caption will word wrap within the box provided. You can adjust the box and the Caption will wrap to fit.

Behavior

Enabled

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

FocusControl Even though this object has no events attached to it, you can specify which object will get focus (become active) if the user should click on the label instead of the object you expected. This can happen when the label defines what the object is. The user may not know where to click (especially if they are new to GUI programs) and, by setting this option, you give them an extra choice. The object property is a standard drop box and, if you click on the down arrow, a list of objects on your form that can receive focus (can be made active) will be displayed.

Name

PopupMenu

Tag

Other

Anchors

Constraints

DateTimeFormat This is the format you want to use dd/mm/yy, dd/mm/yyyy, mm/dd/yy, mm/dd/yyyy, mmmm/dd/yyyy

Layout You can set where the caption will be displayed within the label box. The options are: tlTop (display at the top of the box), tlBottom (display at the bottom of the box) and tlCenter (display at the center of the box). The default value is tlTop, however, when you first create a TLabel object the box will be created the size of the caption. So, this option has little effect unless you change the size of the label box on the form.

ShowAccelChar If you use an ampersand (&) in the caption it will be treated the same way as if you were creating the caption for a button (see General Info for more on ALT+ keys). If this option is checked (set to .True.), the default value, the underscore will be displayed for the user.

Position

Align

AutoSize

Height

Left

Top

Width

EVENTS

This object has a single event that is called if your user clicks on the object. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks on the object, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple objects call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.

See Also : TAngleLabel TRunningText TrxLabel


TRunnungText

Navigation: Reference > Form Objects >

TRunnungText

 Print this Topic Return to chapter overview

This object TRunningText is a Label with some additional special effects. This object will allow you to put a fixed string on the form. The icon for this object is on the enhanced page.

PALETTE ICON

Description

This object is an analog of a marque when text is scrolled in some defined direction.

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Caption This is the text that will appear on the form. It is any standard string and can be modified at runtime.

Color

Cursor

ParentColor

Transparent If you want to put a label on a TImage you can check this option (set to .True.) and only the text will appear instead of both the text and the background color.

NOTE: To get an object to appear on top of an image you must right click on the label and then choose the Bring To Front option before you move the label to the image, or, it will go behind the image.

Behavior

Enabled

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

Name

PopupMenu

Tag

Other

Anchors

Constraints

Active Scrolling will be started when you set Active .true.

Continuous If you want to scroll a text continuously.

Direct This is direction in which text will be scrolled (diLeftToRight,diRightToLeft, diTopToBottom, diBottomToTop)

Layout You can set where the caption will be displayed within the label box. The options are: tlTop (display at the top of the box), tlBottom (display at the bottom of the box) and tlCenter (display at the center of the box). The default value is tlTop, however, when you first create a TLabel object the box will be created the size of the caption. So, this option has little effect unless you change the size of the label box on the form.

NumRepeat Number of time to repeat.

Speed Speed for scrolling.

StyleLabel 3D-style which is used for text displaying (slNormal, slLowered, slRaised)

Position

Align

AutoSize

Height

Left

Top

Width

EVENTS

This object has a single event that is called if your user clicks on the object. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks on the object, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple objects call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.

See Also : Tlabel TAngleLabel TrxLabel


TRxLabel

Navigation: Reference > Form Objects >

TRxLabel

 Print this Topic Return to chapter overview

This object TrxLabel is TLabel with some additional special effects. This object will allow you to put a fixed string on the form. The icon for this object is on the enhanced page.

PALETTE ICON

Description

TrxLabel supports shadows (like 3D style). In addition to standard label properties. You can use ShadowPos, ShadowColor and ShadowSize properties to determines how to draw the label shadowed.

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Caption This is the text that will appear on the form. It is any standard string and can be modified at runtime.

Color

Cursor

ParentColor

Transparent If you want to put a label on a TImage you can check this option (set to .True.) and only the text will appear instead of both the text and the background color.

NOTE: To get a TLabel object to appear on top of an image you must right click on the label and then choose the Bring To Front option before you move the label to the image, or, it will go behind the image.

WordWrap If the Caption is too long to fit within a single line you can stretch the label box and check this option (set to .True.). The label will then be treated like a minor memo and the Caption will word wrap within the box provided. You can adjust the box and the Caption will wrap to fit.

Behavior

Enabled

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

FocusControl Even though this object has no events attached to it, you can specify which object will get focus (become active) if the user should click on the label instead of the object you expected. This can happen when the label defines what the object is. The user may not know where to click (especially if they are new to GUI programs) and, by setting this option, you give them an extra choice. The object property is a standard drop box and, if you click on the down arrow, a list of objects on your form that can receive focus (can be made active) will be displayed.

Name

PopupMenu

Tag

Other

Anchors

Constraints

Layout You can set where the caption will be displayed within the label box. The options are: tlTop (display at the top of the box), tlBottom (display at the bottom of the box) and tlCenter (display at the center of the box). The default value is tlTop, however, when you first create a TLabel object the box will be created the size of the caption. So, this option has little effect unless you change the size of the label box on the form.

ShadowColor Sets the color of the label shadow

ShadowPos Sets the direction of the shadow effect, valid options are: spLeftBottom, spLeftTop, spRightBottom, spRightTop

ShadowSize Sets the size of the shadow, integer value

ShowAccelChar If you use an ampersand (&) in the caption it will be treated the same way as if you were creating the caption for a button (see General Info for more on ALT+ keys). If this option is checked (set to .True.), the default value, the underscore will be displayed for the user.

Position

Align

AutoSize

Height

Left

Top

Width

EVENTS

This object has a single event that is called if your user clicks on the object. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks on the object, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple objects call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.

See Also: Tlabel TAngleLabel TRunningText


TRxSwitch

Navigation: Reference > Form Objects >

TRxSwitch

 Print this Topic Return to chapter overview

RX Switch is a custom control representing a switch. The icon for this object is on the enhanced page.

PALETTE ICON & EXAMPLE

Description

RxSwitch is a simple component that displays a switch depending on whether the state property is "On" or "Off". It's GlyphOn and GlyphOff properties determine what bitmaps are used. so you can customize this with your own bitmaps.

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Caption This is the text that is displayed on the Switch.

Color

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

BorderStyle Options are none and single

Constraints

GlyphOff This is the bitmap that will be displayed in the off state.

GlyphOn This is the bitmap that will be displayed in the on state.

StateOn This property allows you to check the state of the switch.

TextPosition This determins the text position options are tpTop, tpBotton,tpRight, tpLeft, tpRight, tpNone.

ToggleKey

Position

Height

Left

Top

Width

EVENTS

This object has a single event that is called if your user clicks the switch. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks the switch, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple buttons call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.


TMainMenu

Navigation: Reference > Form Objects >

TMainMenu

 Print this Topic Return to chapter overview

This object creates the menu that appears at the top of the form. The items that make up the menu are actually TMenuItem objects. You create those by using the Menu Item Editor. The icon for this object is on the Standard page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

List

Items These are the TMenuItems that make up the menu. This is what the user will actually see. To create new items or edit/delete existing ones you can either click on the button in the property field or, right click on the TMainMenu object and choose the Menu Designer option.

NOTE: At the current time you cannot add or remove menu items at runtime. However, if you have extra items that you add during design you can turn them on or off (using the Visible option in the line item).

Misc

Name

Tag

Other

Images If you want to include images in the menu you need to specify the TImageList here. You will then choose individual images during menu design (creating the line items).

COMMENTS

This object doesn't do anything by itself. You have to create menu items with the menu editor before any items are visible.

EVENTS

There are no events for this object.


TMemo

Navigation: Reference > Form Objects >

TMemo

 Print this Topic Return to chapter overview

Use this object to put a mini-word processor on your form. If you want to allow your user to enter messages or notes, etc. you would use this object in connection with the STRINGS() function. The icon for this object is on the Standard page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Color

Ctl3D

Cursor

ParentColor

WordWrap This would normally be checked (set to .True.) so that the lines the user enters will be wrapped automatically. If you set this to .False. (unchecked) the lines will scroll to the left as the user enters characters that would stretch beyond the edge of the object.

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

BorderStyle

Constraints

Lines This a string list that contains the lines that make up the memo. You can preset these lines or retrieve them through the use of the STRINGS() function.

Each line in the memo can be accessed as a separate string in the list.

MaxLength If you want to limit the number of characters that can be entered you would put that number here. If it is set to 0 there is no limit. This can be changed during runtime.

ParentCtl3D

ReadOnly

ScrollBars You would set this option to attach scroll bars to the memo area. This will allow the user to move the memo easily if they exceed the space available. The options are: ssBoth (both vertical and horizontal scroll bars), ssHorizontal (horizontal scroll bars only), ssNone (no scroll bars, in this case the user would use up/down and left/right arrows to move around the memo if it exceeds the size available) and ssVertical (vertical scroll bars only). The default value is ssNone. If you check the WordWrap property (set to .True.) then you may not need horizontal scroll bars at all.

WantReturns If you want to allow the user to enter returns (separate sections of the memo) then this should be checked. This is the default value.

WantTabs If you want to allow the user to enter tabs then this should be checked. This is the default value.

Position

Align

Height

Left

Top

Width

COMMENTS

NOTE: If you place a TMemo object on a TPanel object you will no longer be able to set the TabOrder for the TMemo. It will look to you like it's the only object on the TPanel, even if there are others.

EVENTS

There are no events for this object.

See Also TTasMemo & TRTFMemo


TRTFMemo

Navigation: Reference > Form Objects >

TRTFMemo

 Print this Topic Return to chapter overview

Use this object to put a mini-word processor on your form. This is similar to the TTASMemo object, except it will display RTF - (Rich text formated data)

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Color

Ctl3D

Cursor

ParentColor

WordWrap This would normally be checked (set to .True.) so that the lines the user enters will be wrapped automatically. If you set this to .False. (unchecked) the lines will scroll to the left as the user enters characters that would stretch beyond the edge of the object.

Behavior

Enabled

TabOrder

TabStop

Visible

Entry

EntryBGColor

EntryFont

EntryUseDflt

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

BorderStyle

Constraints

Lines This a string list that contains the lines that make up the memo. When you read a record that has a memo field attached that value will show up in this object automatically. Also, when you save the record, if there is anything in this object it will be saved to the record.

MaxLength If you want to limit the number of characters that can be entered you would put that number here. If it is set to 0 there is no limit. This can be changed during runtime.

ParentCtl3D

ReadOnly

ReturnIsTab

ScrollBars You would set this option to attach scroll bars to the memo area. This will allow the user to move the memo easily if they exceed the space available. The options are: ssBoth (both vertical and horizontal scroll bars), ssHorizontal (horizontal scroll bars only), ssNone (no scroll bars, in this case the user would use up/down and left/right arrows to move around the memo if it exceeds the size available) and ssVertical (vertical scroll bars only). The default value is ssNone. If you check the WordWrap property (set to .True.) then you may not need horizontal scroll bars at all.

WantReturns If you want to allow the user to enter returns (separate sections of the memo) then this should be checked. This is the default value.

WantTabs If you want to allow the user to enter tabs then this should be checked. This is the default value.

Position

Align

Height

Left

Top

Width

TAS Pro

AllowedChrs You can specify the characters that are allowed to be entered for this object. Do not separate the values with commas, for example, if you want to allow A, B and C only you would make this property: ABC. Default value is blank. This can be changed at runtime.

DfltValue This value will be inserted automatically into the field if the field is blank when the object is chosen on the form. If you want to use a constant value surround the value in quotes, e.g., 'ABC' or '100.50' etc. If you want to use a field, then just put in the field name. The default value is blank. This can be changed during runtime.

NOTE: You can't use an expression here. However, this is a perfect use of the VALUE option in the DEFINE field command. Just define a field, set the VALUE option to what ever expression you want to use, and put that field name into the DfltValue property.

FieldName

FldModified NOTE: This is a runtime only property and will not show up in the Object Inspector.

NOTE: In the case of the TRTFMemo this property works a little differently. Each time the user enters the object, the object makes a copy of what's presently there. Then, if you access this property, the stored version is compared to the current value. If it's different this property returns True, if not, it returns False. When the user enters the object the next time a copy will again be made and that will be compared when this property is checked. Also, when you check this property, if the field has been changed, and there is an attached field (FieldName above other than NONE), that field will be updated at the same time.

FocusOnObject

HelpStatusBar

HelpStatusBarMsg

KeyTrapHint

KeyTraps

ValidCheckOnExit

ValidExpr

ValidMsg

COMMENTS

NOTE: If you place a TTASMemo object on a TPanel object you will no longer be able to set the TabOrder for the TRTFMemo. It will look to you like it's the only object on the TPanel, even if there are others.

NOTE: If you check the ReturnIsTab option you will not be able to enter returns in the TRTFMemo regardless of your setting in WantsReturns. Each time the user presses the ENTER key the program will move to the next object in the TabOrder list.

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:

Change This event is called every time the user makes a change to the Text of this object. That includes entering a new character, deleting a character, etc. Each time this event is executed the field that is attached to this object through the FieldName property is updated so that you can check the characters entered, modified, etc. through the field. Be cautious about using this since it will slow down the entry process.

Disp This event is called when the field that is attached to the object is to be refreshed on the screen. This can happen when a record is read, after a calculation, etc.

Post This event is called when the user moves from the current object to another. This will not stop the process from continuing, but can be used to make sure settings are proper after leaving the object. To force the user to stay on the current object, if there is a problem, use the Valid event instead of this.

Pre This event is called when the user moves into an object. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to access the object. If you return .False. the object that was active before they got to this object will get the focus again. This keeps the user from accessing an object that you don't want to be active. Commonly used in application where some fields are accessible sometimes (RET .TRUE.) and aren't others (RET .FALSE.).

The process by which these events are called is:

Pre - This occurs when focus changes to the object.

Change - During field entry.

Post - Called after Valid returns .True. (if there is a Valid event) and before the Pre for the next object.

Disp - Is called anytime the form/object is refreshed.

See Also TMemo & TTasMemo


TMenuItem

Navigation: Reference > Form Objects >

TMenuItem

 Print this Topic Return to chapter overview

There is no separate item on the palette for this object. This is created when editing a TMainMenu or TPopupMenu and are the actual menu line items.

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Caption This is the text that is displayed as the line item of the menu. This is any standard string and can be changed at runtime.

NOTE: If you put a single hyphen (-) as the caption, when the menu is displayed a complete line will be displayed. This will allow you to separate the actual items that can be selected into groups.

Behavior

Default If this is checked (set to .True.) the menu item will be the default object on the menu. This means if the user presses the ENTER key it will have the same effect as if they had clicked the item.

Enabled

Visible

Hint

Hint

Misc

HelpContext

Name

Tag

Other

Bitmap You can specify an image that is to be part of the menu line item. It will be displayed on the left side of the line.

Break You can force the menu to start another column with this property. The options are: mbNone (do not start another column - this is the default value), mbBarBreak (start a new column and put a vertical bar between the current and new column), mbBreak (start a new column and put a space between the current and new column).

Checked If this is checked (set to .True.) a check mark will be put at the left side of the menu item. If you have also check the RadioItem property then instead of a check mark a radio mark (the same used in the TTASRadioButton) will be used. The default value is not checked (set to .False.).

ImageIndex If you have specified a TImageList in the parent item of this one then this is the number of the image in that list. The default value is -1. Images start at 0.

NOTE: For each menu item level a TImageList is specified. It may be the same image list for all levels, but it need not be.

RadioItem If this is checked (set to .True.) a radio mark (the same used in the TTASRadioButton) will be put at the left side of the menu item if the Checked property above is also set. The default value is not checked (set to .False.).

ShortCut This is the keys the user can press that would be the equivalent of clicking on the menu item. The default value is (none) which means there are no short cut keys.

SubMenuImages If you are going to create sub menus, that is line items that use this item as a 'parent' and, you want to use images from a TImageList object in those subsequent line items, you need to put that image list object name here. This is the same type of property as Images in TMainMenu or TPopupMenu.

EVENTS

This object has a single event that is called if your user clicks the menu item. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks the menu item, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple menu items call the same routine by 'stacking' the event labels on top of each other. For example, if you had two menu items you wanted to call the same event, you could do the following:

mliFirst.click:

mliSecond.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.


TPanel

Navigation: Reference > Form Objects >

TPanel

 Print this Topic Return to chapter overview

This object is similar to theTBevel in that it can put a border around other objects but it has other uses also. The types of styles available are greater than with a bevel and it 'owns' the objects placed on it. This means that if you set the Visible property of the panel to .False. all object that are on the panel, automatically become invisible also. The same applies to the Enabled property. This can be very useful when you know you want to effect a group of objects all the same way at the same time.

The icon for this object is on the Standard page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment In this object the default is taCenter
Caption This is the text that is displayed on the panel. The default is the name of the object.

Color

Ctl3D

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

BevelInner This will effect the look of the panel. The options are: bvLowered, bvNone (the default value), bvRaised and bvSpace.

BevelOuter This will also effect the look of the panel. The options are: bvLowered, bvNone, bvRaised (the default value) and bvSpace.

BevelWidth This is how wide the bevel is in pixels. The default value is 1.

BorderStyle By manipulating all four of these properties (BevelInner, BevelOuter, BevelWidth and BorderStyle) you can completely change the look of the panel.

Constraints

ParentCtl3D

Position

Align

Height

Left

Top

Width

COMMENTS

If you decide to put a TPanel on your form after other objects have already been added that you want to move to the panel, you can't just move them to the panel. You can, however, copy it (click on the object, right click and choose copy or press CTL+C) and then paste it on the panel (right click on the panel and choose Paste or CTL+V) and then delete the original object.

EVENTS

This object has a single event that is called if your user clicks on the object. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks on the object, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple objects call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.


TTasframePanel

Navigation: Reference > Form Objects >

TTasframePanel

 Print this Topic Return to chapter overview

This object is similar to the TTASPanel in that it can hold other objects but it has other uses also. The types of styles available are the Look and Feel of an XP/Office style bar and it 'owns' the objects placed on it. This means that if you set the Visible property of the panel to .False. all object that are on the panel, automatically become invisible also. The same applies to the Enabled property. This can be very useful when you know you want to effect a group of objects all the same way at the same time.

The icon for this object is on the Zip & Other page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Caption

This is the text that is displayed on the panel. The default is the name of the object.

Color

Ctl3d

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

BevelInner

BevelOuter

BevelWidth

BorderStyle

BorderWidth

Constraints

GrabberPlace Position of the Bars.

GrabberSize Point size of bars.

HelpKeyword

HelpType

Icon The Icon used for the panel

Moveable if you user can move the Frame.

ParentBackground Use parent background color

ParentCtl3D

Position

Align

AutoSize

Height

Left

Top

Width

COMMENTS

EVENTS

Events are Click and Close

This object has two events that is called if your user clicks on the object. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click: and ObjectName.close:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks on the object, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple objects call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.

Example

mypanel.click:
msg 'The user clicked on the panel'
ret

mypanel.close:
msg ' User Clicked on the X.'
ret


TSpeedButton

Navigation: Reference > Form Objects >

TSpeedButton

 Print this Topic Return to chapter overview

The Speed Button object (TSpeedButton) which usually have images on their faces, can function in groups. They are commonly used with panels to create toolbars. The icon for this object is on the Standard page.

Description

Use TSpeedButton object to add a button to a group of buttons in a form. TSpeedButton introduces properties that can be used to set graphical images that represent the different button states (selected, unselected, disabled and so on). Use other properties to specify multiple images or to rearrange the images and text on the button. TSpeedButton also introduces properties that allow speed buttons to work together as a group. Speed buttons are commonly grouped in panels to create specialized tool bars and tool palettes.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Caption This is the text that is displayed on the face of the button. This is any standard string and can be changed at runtime.

Cursor

Glyph If you have chosen a custom glyph (bkCustom) in GlyphKind below this is where you would choose the .bmp file that would be used instead of the standard ones that come with this object.

Behavior

Enabled

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

AllowAllUp Specifies whether all speed buttons in the group that contains this speed button can be unselected at the same

Anchors

Constraints

Down Specifies whether all speed buttons in the group that contains this speed button can be unselected at the same time.

Layout Determines where the image or text appears on the speed button.

Margin Use Margin to specify the indentation of the image specified by the Glyph property or the text specified by the Caption property. The edges that Margin separates depends on the Layout property. If Layout is blGlyphLeft, the margin appears between the left edge of the image or caption and the left edge of the button. If Layout is blGlyphRight, the margin separates the right edges. If Layout is blGlyphTop, the margin separates the top edges, and if Layout is blGlyphBottom, the margin separates the bottom edges. If Margin is –1, the image or text is centered on the button.

NumGlyphs Set NumGlyphs to the number of images provided by the bitmap assigned to the Glyph property. All images must be the same size and next to each other in a row. The Glyph property can provide up to four images.

Spacing Set Spacing to the number of pixels that should appear between the image specified in the Glyph property and the text specified in the Caption property. If Spacing is a positive number, its value is the number of pixels between the image and text. If Spacing is 0, the image and text appear flush with each other. If Spacing is -1, the text appears centered between the image and the button edge.

Position

Height

Left

Top

Width

EVENTS

This object has a single event that is called if your user clicks the button. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks the button, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: To make speed buttons act as a group, give the GroupIndex property of all the buttons the same nonzero value. By default, speed buttons appear in an up (unselected) state. To initially display a speed button as selected, set the Down property to True. If AllowAllUp is True, all of the speed buttons in a group can be unselected. Set AllowAllUp to False if you want a group of buttons to act like a radio group.

Tip: To create a speed button with a client-aligned glyph that covers the button's edges, add a 1-pixel margin around the button's top and left edges and a 3-pixel margin around its bottom and right edges. Do this by manually editing the bitmap specified by the Glyph property.


TSplitPanel

Navigation: Reference > Form Objects >

TSplitPanel

 Print this Topic Return to chapter overview

This object is similar to the Tpanel in that it can put a border around other objects but it has other uses also. The types of styles available are greater than with a bevel and it 'owns' the objects placed on it. This means that if you set the Visible property of the panel to .False. all object that are on the panel, automatically become invisible also. The same applies to the Enabled property. This can be very useful when you know you want to effect a group of objects all the same way at the same time. It has a built in Split bar control. The icon for this object is on the enhanced page.

The icon for this object is on the Enhanced page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment In this object the default is taCenter
Caption This is the text that is displayed on the panel. The default is the name of the object.

Color

Ctl3D

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

BevelInner This will effect the look of the panel. The options are: bvLowered, bvNone (the default value), bvRaised and bvSpace.

BevelOuter This will also effect the look of the panel. The options are: bvLowered, bvNone, bvRaised (the default value) and bvSpace.

BevelWidth This is how wide the bevel is in pixels. The default value is 1.

BorderStyle By manipulating all four of these properties (BevelInner, BevelOuter, BevelWidth and BorderStyle) you can completely change the look of the panel.

Constraints

ParentCtl3D

Position

Align

Height

Left

Top

Width

COMMENTS

If you decide to put a TDCPanel on your form after other objects have already been added that you want to move to the panel, you can't just move them to the panel. You can, however, copy it (click on the object, right click and choose copy or press CTL+C) and then paste it on the panel (right click on the panel and choose Paste or CTL+V) and then delete the original object.

EVENTS

This object has a single event that is called if your user clicks on the object. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks on the object, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple objects call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.


TGradientPanel

Navigation: Reference > Form Objects >

TGradientPanel

 Print this Topic Return to chapter overview

This object is similar to the TPanel in that it can put a border around other objects but it has other uses also. The types of styles available are greater than with a TPanel and it 'owns' the objects placed on it. This means that if you set the Visible property of the panel to .False. all object that are on the panel, automatically become invisible also. The same applies to the Enabled property. This can be very useful when you know you want to effect a group of objects all the same way at the same time. This Object can display a gradient color on a panel. The icon for this object is on the Enhanced page.

PALETTE ICON

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

ParentColor

Behavior

Enabled

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

ColorCount The number of colors to use in the gradiant.

ColorFrom The starting color for the gradient color.

ColorTo The ending color for the gradient color.

Direction Use 14 different directions having gradient fill TopToBottom, BottomToTop, LeftToRight, RightToLeft, EdgesToCenter, CenterToEdges, HCenterToEdges, EdgesToHCenter, VCenterToEdges, EdgesToVCenter, TopLeft, BottomLeft, TopRight, BottomRight

Position

Align

Height

Left

Top

Width

EVENTS

This object has a single event that is called if your user clicks on the object. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks on the object, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple objects call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.


TPopupMenu

Navigation: Reference > Form Objects >

TPopupMenu

 Print this Topic Return to chapter overview

This object creates a menu that appears when the user right clicks on an object (you must specify the TPopupmenu object name as the PopupMenu property). The items that make up the menu are actually TMenuItem objects. You create those by using the Menu Item Editor. The icon for this object is on the Standard page.

NOTE: You can also display the menu by using the WMENU command.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment In this case this property determines where the menu will appear in relation to the mouse. The default is taLeftJustify (to the left of the mouse).

List

Items These are the TMenuItems that make up the menu. This is what the user will actually see. To create new items or edit/delete existing ones you can either click on the button in the property field or, right click on the TMainMenu object and choose the Menu Designer option.

NOTE: At the current time you cannot add or remove menu items at runtime. However, if you have extra items that you add during design you can turn them on or off (using the Visible option in the line item).

Misc

HelpContext

Name

Tag

Other

Images If you want to include images in the menu you need to specify the TImageList here. You will then choose individual images during menu design (creating the line items).

MenuAnimation This property will control how the menu appears on the screen when the user right clicks the object in control. The options are: maBottomToTop (start at bottom and display to the top of the menu), maLeftToRight, maNone (the entire menu is displayed at once - this is the default value), maRightToLeft and maTopToBottom.

COMMENTS

This object doesn't do anything by itself. You have to create menu items with the menu editor before any items are visible.

EVENTS

There are no events for this object.


TProgressBar

Navigation: Reference > Form Objects >

TProgressBar

 Print this Topic Return to chapter overview

This object can give the user a visible idea of how close a process is to completion. The icon for this object is on the Additional page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Cursor

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

BorderWidth

Constraints

Max When you setup this object you need to specify the beginning and end point for the image to be displayed to the user. The default for Max is 100, as in 100%. If you are reading through a file and know the number of records you have to read, you can set this property to the number of records and each time you read a record increment the Position property. This property can be modified during runtime.

Min The starting point for the image to be displayed. Generally this will be set to 0 but it can be set to any value you wish as long as it's less than the Max property. This property can be modified during runtime.

Orientation Does the image progress from left to right (pbHorizontal - default value) or bottom to top (pbVertical).

NOTE: The position of the progress bar on the form will NOT change when you change this value. Only the direction of the internal bar during your program operation will change. This means you must change the size of the bar yourself to tall and narrow from short and wide before saving the form.

Position NOTE: This property doesn't exist on the property editor. However, it is used by you during your program to move the progress bar during the process. You would increment this value during each loop or when a record is read, etc. Each time the Position value exceeds the next Step (see below) the progress bar will display a little longer (or taller depending on the Orientation property). This property can only be changed at runtime.

Smooth If this property is checked (set to .True.) then the progress bar will be a single smooth line of color. The default value is not checked (.False.) and the progress bar will increment in block form.

Step This is the change in the Position property that must occur before the progress bar changes. The default value is 10 which means the Position property must change by a value of 10 before the progress bar increases in size. This default setting in is keeping with the Min/Max properties of 0 and 100 (or 0% and 100%) in which case this could be considered 10%. You should set this value to some logical portion of the difference between Min and Max. If it's too small the blocks in the progress bar will be very small. This property can be modified during runtime.

Position

Align

Height

Left

Top

Width

EVENTS

There are no events for this object.

Sample 1

//use this is an sql or a while loop using a counter.

define rec_cntr,cntr type I

'@progressbar1.max' = rec_cnt

while dummy_l = .t.

'@progressbar1.position' = cntr

inc cntr

//find next record till done

endw

Sample 2

// Use this if your checking a file/Table no need to set the max

'@progressbar1.position' = 0

scan @myfile_hndl key @0 while this_field = that_field

'@progressbar1.position' = REC_PERCENTAGE(myfile_hndl)

save @myfile_hndl nocnf

ends

NOTE: you could also use the SET_OBJECT to do this and there could be other ways to do this as well Just some code to look at here.


TRtnTimer

Navigation: Reference > Form Objects >

TRtnTimer

 Print this Topic Return to chapter overview

This is a non-visual object. It won't appear on your form at runtime, however, it can call a routine in your program at a semi-regular interval. If you want to execute an event only once a day at a specific time your should use the TAlarmClock instead of this object.

The icon for this object is on the Additional page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Behavior

Enabled

Misc

Name

Tag

Other

SecondsBtwnCalls

The value here determines the number of seconds between calls to the event routine.

Unless your routines very fast it is recommended that you set this to a minimum of 10.

COMMENTS

NOTE: You should have only one TRtnTimer per form. Also, if you have timers on other forms that are executing at the same time the calls they are making will "stack up" until they are executed. This means if you're running a routine that takes a long time you could have calls to that routine, or others, waiting until it's done and returns control to the form before they are called. Be careful how you use this. The user may never regain control of the form if you call the routine too often (the SecondsBtwnCalls property value is too small).

EVENTS

This object has a single event that is called if you have checked the Enabled property. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Call). The full event name would be ObjectName.Call:. You would not return a value from the program, just a simple RET is all that is required. So, if the timer fires and if the event label exists, the routine is called, you return from the routine, and the user has control again.


TScrollBox

Navigation: Reference > Form Objects >

TScrollBox

 Print this Topic Return to chapter overview

This Object TScrollBox represents a scrolling area (a scroll box) on a form. This object is like a TPanel With a scrolling area.

Description

Use TScrollBox to create a scroll box in a window. This object is similar to theTPanel in that it can put a border around other objects but it has other uses also. It 'owns' the objects placed on it and provide a scrolling area. This means that if you set the Visible property of the TScrollBox to .False. all object that are on the TScrollBox, automatically become invisible also. The same applies to the Enabled property. This can be very useful when you know you want to effect a group of objects all the same way at the same time.

Note : A scroll box can contain objects, such as TButton and TCheckBox objects. Use it as a scroling area on your form.

PALETTE ICON

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Color

Ctl3D

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

BevelInner This will effect the look of the panel. The options are: bvLowered, bvNone (the default value), bvRaised and bvSpace.

BevelOuter This will also effect the look of the panel. The options are: bvLowered, bvNone, bvRaised (the default value) and bvSpace.

BevelWidth This is how wide the bevel is in pixels. The default value is 1.

BorderStyle By manipulating all four of these properties (BevelInner, BevelOuter, BevelWidth and BorderStyle) you can completely change the look of the panel.

Constraints

ParentBackground

ParentCtl3D

HorzScrollBar Use HorzScrollBar to hide, show, or manipulate the vertical scroll bar for the scrolling windowed control. Options are.

Button Size

Color

Increment

Margin

ParentColor

Range

Size

ThumbSize

Tracking

Visible

VertScrollBar Use VertScrollBar to hide, show, or manipulate the vertical scroll bar for the scrolling windowed control. Options are.

Button Size

Color

Increment

Margin

ParentColor

Range

Size

ThumbSize

Tracking

Visible

Position

Align

Height

Left

Top

Width

COMMENTS

If you decide to put a TPanel on your form after other objects have already been added that you want to move to the panel, you can't just move them to the panel. You can, however, copy it (click on the object, right click and choose copy or press CTL+C) and then paste it on the panel (right click on the panel and choose Paste or CTL+V) and then delete the original object.

EVENTS

This object has a single event that is called if your user clicks on the object. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks on the object, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple objects call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.


TSpinEdit

Navigation: Reference > Form Objects >

TSpinEdit

 Print this Topic Return to chapter overview

A spin edit object (TSpinEdit) or spin button. This object lets the application user change an integer value in fixed increments, either by clicking the up or down arrow buttons to increase or decrease the value currently displayed, or by typing the value directly into the spin box. The current value is given by the Value property; the increment, which defaults to 1, is specified by the Increment property.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Color

Ctl3D

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

AutoSelect Set AutoSelect to select all the text when the edit control gets focus. AutoSelect only applies to single-line edit controls. Use AutoSelect when the user is more likely to replace the text in the edit control than to append to it.

EditorEnabled

Increment This is the value you want to increment the value by.
MaxLength

MaxValue

MinValue

ParentCtl3D

ReadOnly

Value This is the value of the spinedit object.

Position

Height

Left

Top

Width


TShape

Navigation: Reference > Form Objects >

TShape

 Print this Topic Return to chapter overview

This object will allow you to draw a simple shape on the form. It can be used in the same manner as the TBevel, to put a box around an object or group of objects. Other than that, it has no other purpose. The icon for this object is on the Additional page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Cursor

Behavior

Enabled

Visible

Hint

Hint

ParentShowHint

ShowHint

Misc

Name

Tag

Other

Anchors

Brush This is the color and style used for the background. Both the colors (clScrollBar to clWhite) and styles (bsSolid to bsDiagCross) are defined in COMPILERCONSTANTS.TXT. These properties can be modified at runtime by referring to the property as 'Brush.Style' or 'Brush.Color'.

Constraints

Pen This is the color, mode, style and width of the border around the shape. The colors (clScrollBar to clWhite), modes (pmBlack to pmNotXor) and styles (psSolid to psInsideFrame) are defined in COMPILERCONSTANTS.TXT. These properties can be modified at runtime by referring to the property as 'Pen.Style', 'Pen.Color' or 'Pen.Mode'. Pen.Width is an integer value that specifies the size of the border in pixels. The default value is 1.

Shape This property determines the type of shape to be displayed on the form. The options are: rectangle (stRectangle), square (stSquare - the default value), round rectangle (stRoundRect - a rectangle with rounded corners), round square (stRoundSquare - a square with rounded corners), ellipse (stEllipse - a flattened circle) and circle (stCircle). These values are defined in COMPILERCONSTANTS.TXT and can be modified at runtime.

Position

Align

Height

Left

Top

Width

COMMENTS

This object will always appear behind any other objects you put on the form, except other TShapes.

EVENTS

There are no events for this object.


TStatusBar

Navigation: Reference > Form Objects >

TStatusBar

 Print this Topic Return to chapter overview

This object is generally used to display information to the user at the bottom of the form. You can split up the bar into panels, each of which can be individually modified. The panels that make up the menu are actually TStatusPanel objects. You create those by using the Status Bar Panel Editor. The icon for this object is on the Additional page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Color

Cursor

ParentColor

Behavior

Enabled

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

AutoHint If this property is checked (set to .True.) then any Hints that would normally be displayed at the cursor location for any objects on the form will be displayed in the status bar. This gives the user a single place to look for hints and keeps them from covering up other objects on the form. This property can be changed during runtime.

BorderWidth

Constraints

Panels By editing this property you can split the status bar into separate panels. These panels can be updated during runtime by using the STATUS_BAR() function.

SimplePanel If you want a single panel to appear on the status bar and not have it broken into multiple panels then check this property (set to .True.). Any panels you have created with the Status Bar Panel Editor will not be displayed. This property can be modified during runtime.

SimpleText If the SimplePanel property is checked (set to .True.) then you can put the text you want displayed in this property. This can be modified during runtime.

SizeGrip If you check this property (set to .True.) a glyph will be displayed on the right side bottom of the status bar to alert the user that the bar can be resized during runtime. This only works if it's on a normal form. The default value is .True. This property can be modified during runtime.

UseSystemFont If this property is checked (set to .True.) the text displayed on the status bar will use the current system font. The default value is .True. This can be modified during runtime.

Position

Align The default value for this object is alBottom.

Height

Left

Top

Width

EVENTS

There are no events for this object.


TStatusPanel

Navigation: Reference > Form Objects >

TStatusPanel

 Print this Topic Return to chapter overview

There is no separate item on the palette for this object. This is created when editing a TStatusBar are the actual status bar panels. The icon for this object is on the Standard page.

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Other

Bevel The panel can appear lowered (pbLowered - default value), flat (pbNone) or raised (pbRaised).

Style This MUST be psText or nothing will appear in the panel.

Text This is the caption that will appear for this panel. You can specify the string here or use the STATUS_BAR() function during runtime.

Position

Width This is the size of the panel in pixels.

EVENTS

There are no events for this object.


TTabSheet

Navigation: Reference > Form Objects >

TTabSheet

 Print this Topic Return to chapter overview

There is no separate item on the palette for this object. This is created when editing a TTASPageControl and are the actual page tabs.

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Caption This is the text that is displayed in the page tab. This is any standard string and can be changed at runtime.

Cursor

Behavior

Enabled

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

BorderWidth

Constraints

Highlighted If this is checked (set to .True.) the tab is shaded. This can be used to set off a particular tab. This can be modified during runtime.

ImageIndex If you have specified a TImageList in the TTASPageControl object for this page this is the number of the image in that list. The default value is -1. Images start at 0.

PageIndex This is the tab counter. The first tab has an index of 0. By changing this value at runtime you can move the tab position.

TabVisible If this is checked (set to .True.) the tab is visible, if you uncheck the property, the tab will disappear and the user won't be able to choose that page. This would have the same effect as setting the Visible property to .False. This can be modified at runtime.

Position

Height

Left

Top

Width

COMMENTS

To create a TTabSheet for a TTASPageControl right click on the TTASPageControl object. Then choose New Page from the popup menu. You can continue to make pages by right clicking and choosing New Page. To access the TTabSheet object for that page click on the appropriate tab, then click on the block below the tab. When you click on the tab itself the object in the object inspector is the TTASPageControl itself. When you click below the tab, in the panel below, you will see the TTabSheet object in the object inspector.

EVENTS

There are no events for this object. The event of changing pages applies to the TTASPageControl object.


TToolBar

Navigation: Reference > Form Objects >

TToolBar

 Print this Topic Return to chapter overview

This object creates a tool button bar that appears at the top of the form. The items that make up the bar are actually TToolButton objects. The icon for this object is on the Additional page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Caption Even though this property is available it doesn't show up anywhere on the bar. You can ignore it.

Color

Ctl3D

Cursor

Flat If this is checked (set to .True.) the buttons will disappear into the bar and will look like a button when the user passes their mouse over it. The default value is .False.

ParentColor

Transparent If this is checked (set to .True.) then anything behind the tool bar itself will be visible. This only effects the actual tool bar and not the buttons. The default value is .False.

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

BorderWidth

ButtonHeight The height of each button on the tool bar.

ButtonWidth The default width of each button on the tool bar.

Constraints

DisabledImages Normally, if you disable a button on a tool bar (set Enabled for that button to .False.) the button image will be 'grayed out.' If you want a different image to be displayed then place the name of the TImageList object here that contains that image.

NOTE: This must be different than the TImageList object used in the Images property since the ImageIndex property in the TToolButton is the controlling value here also.

EdgeBorders This option determines which borders of the tool bar will have a distinct edge. You have the ability to choose any or all of the four bar edges. The default value is top only.

EdgeInner This property, along with EdgeOuter below control what the edge of the tool bar will look like. The options are: Lowered, None and Raised (the default value).

EdgeOuter This property, along with EdgeInner above control what the edge of the tool bar will look like. The options are: Lowered (the default value), None and Raised.

HotImages Normally, when the mouse passes over the button, the image displayed stays the same. If you want a different image to be displayed then place the name of the TImageList object here that contains that image.

NOTE: This must be different than the TImageList object used in the Images property since the ImageIndex property in the TToolButton is the controlling value here also.

Images This is the TImageList object that contains the images that will appear on the face of the buttons in normal use. The particular image used is controlled by the ImageIndex property in the TToolButton.

Indent This will create a margin on the left side of the tool bar before the first tool button is displayed. The default value is 0.

List Normally, if captions are displayed on the buttons (see ShowCaptions below) they appear under the images centered on the button face. If you check this option (set to .True.) the captions (if displayed) will show up to the right of the images instead of underneath.

ShowCaptions If you check this option (set to .True.) the caption for each TToolButton will be displayed on the button face along with (or instead of) the image. The position of the caption is normally under the image. However, if you have checked the List property above the caption will appear to the right of the image.

Wrapable If this option is checked (set to .True.) the tool bar will automatically wrap to the next line if the buttons don't fit in the space allowed. This would occur if the user changed the size of the form during runtime, for example.

Position

Align

AutoSize

Height

Left

Top

Width

COMMENTS

This object would only be used during design. The actual working part of the TToolBar are the TToolButtons. To add buttons to the bar you would right click on the object and choose either NewButton or NewSeparator. Either option will put a TToolButton object on the bar that you can modify using the object inspector. There are no special editors for this type of object.

NOTE: You can have multiple rows of TToolBars on a form.

EVENTS

There are no events for this object.


TToolButton

Navigation: Reference > Form Objects >

TToolButton

 Print this Topic Return to chapter overview

There is no separate item on the palette for this object. This is created when editing a TToolBar and are the actual tool bar buttons.

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Caption If the ShowCaption property is set in the parent TToolBar object then this is the text that will appear on the button face.

Cursor

Behavior

Enabled

Visible

Hint

Hint

ParentShowHint

ShowHint

Misc

Name

PopupMenu

Tag

Other

AllowAllUp If this property is NOT checked then one button in a group on the tool bar must be selected at all times (including when it's first displayed). To fulfill this requirement one of the buttons (in the group) must have its Down property checked (set to .True.). The default value is checked (set to .True.). This property can be modified during runtime.

NOTE: Changing this value for one of the buttons in the group changes it for all.

Down By checking this property (set to .True.) you are choosing which button will start in the down position when the form is displayed. This property can be modified during runtime.

DropDownMenu If the Style of this button is tbsDropDown then this is the TPopupMenu that will be displayed when the user clicks on the down arrow that will appear to the right side of the button.

Grouped This property works in conjunction with the tbsCheck option in Style. If you have this property checked in a line of buttons that are a group (see COMMENTS below) and have their Style set to tbsCheck, then only one button can be selected in that group at a time. This would be the equivalent of a group of TTASRadioButtons that would be part of a TGroupBox.

ImageIndex If you have specified a TImageList in the TToolBar parent then this is the number of the image in that list. The default value is -1. Images start at 0.

NOTE: If you have also specified a TImageList in DiabledImages and HotImages then this will use the same image number in those lists also. If this is set to -1 then no images will be used, regardless of the lists assigned.

Indeterminate This is similar to setting the Enabled value for this button. If is checked (set to .True.) then the image is 'grayed out' just like it would be if Enabled were unchecked (set to .False.). This property can be modified at runtime.

Marked If this property is checked (set to .True.) the face of the button will be shaded. This can be modified at runtime.

Style The style for this button. The options are: tbsButton (a standard TButton type of object, calls a CLICK event when pushed), tbsCheck (more like a TCheckBox in that the button stays down until it's pushed again - see AllowAllUp and Down above), tbsDivider (puts a dividing line between buttons - has no events itself), tbsDropDown (works in conjunction with a TPopupMenu to display a menu when the user clicks on the drop down arrow - see DropDownMenu above), tbsSeparator (puts a space between buttons).

NOTE: Both tbsDivider and tbsSeparator can be used to break up groups of buttons (see COMMENTS below).

Wrap If this is checked (set to .True.) the button will be the last in its row. This is ignored if the Wrapable property on the TToolBar is checked.

Position

AutoSize

Height

Left

Top

Width

COMMENTS

Buttons are considered to be part of a group when they are placed side-by-side together on the bar and are not separated by a tbsSeparator or tbsDivider (see Style above).

NOTE: In the case of this object the Height, Top and Width values are more for information than anything else. All buttons on the TToolBar will have the same height and width unless you set the AutoSize property to .True. (checked). If you do not set the AutoSize property the width will be determined by the widest button on the bar.

EVENTS

This object has a single event that is called if your user clicks the button. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks the menu item, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple tool bar buttons call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

tbbFirst.click:

tbbSecond.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.


TTrackBar

Navigation: Reference > Form Objects >

TTrackBar

 Print this Topic Return to chapter overview

This object is similar to an TTASNumEnter object in that the user sets a position and it is transformed into an integer value that your program can use. You can also set the position in the program to display a visual value to the user. The icon for this object is on the Additional page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Ctl3D

Cursor

Behavior

Enabled

TabOrder

TabStop

Visible

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

BorderWidth

Constraints

Frequency This specifies how often a tick mark will appear. This should generally be set to the same value as LineSize or PageSize. This property can be modified during runtime.

LineSize This is the value the Position property will change each time the track bar pointer moves. This property can be modified at runtime.

Max This is the maximum value that can be represented by the track bar. This would be the Position property value if the pointer is all the way to the right (or top). This property can be modified during runtime.

Min The minimum value that can be represented by the track bar. This would be the Position property value if the pointer is all the way to the left (or bottom). This property can be modified during runtime.

Orientation Does the image progress from left to right (trHorizontal - default value) or bottom to top (trVertical). The image of the object will change when you change this property value.

PageSize This is the value the track bar pointer will be moved if the user presses the PAGEUP key (increments) or clicks on the track bar to the right (or above) its current location; or presses the PAGEDOWN key or clicks on the track bar to the left (or below) its current location. This property can be changed during runtime.

ParentCtl3D

Position NOTE: This property doesn't exist on the property editor. However, it is used by you during your program to move the track bar or read its current location. This property can only be changed at runtime.

SelEnd You can use this property and SelStart to limit the track bar to a subset of the Min to Max distance displayed. Special marks are put on the track bar to highlight the available choices. If the Position property is less than SelStart or more than SelEnd it is reset to the proper start or end value.

SelStart You can use this property and SelEnd to limit the track bar to a subset of the Min to Max distance displayed. Special marks are put on the track bar to highlight the available choices. If the Position property is less than SelStart or more than SelEnd it is reset to the proper start or end value.

SliderVisible If checked (set to .True.) the slider or track bar pointer is displayed. This is the default value. This can be modified at runtime.

ThumbLength The height (if horizontal) or width (if vertical) of the track bar in pixels. The default value is 20. This can be modified at runtime.

TickMarks Where to display the tick marks. The options are: tmBoth (both sides of the bar), tmBottomRight (the right size if vertical or bottom if horizontal) and tmTopLeft (the left side if vertical or top if horizontal - the default value).

TickStyle How the tick marks are to be displayed. The options are: tsAuto (automatically place the tick marks depending on the Frequency and LineSize properties above - the default value), tsManual (tick marks at the beginning and end) and tsNone (no tick marks).

Position

Align

Height

Left

Top

Width

EVENTS

There are no events for this object.


TTASCalcEdit

Navigation: Reference > Form Objects >

TASCalcEdit

 Print this Topic Return to chapter overview

The TASCalcEdit takes the display and editing of numeric data one step further: it provides a popup calculator to help you

calculate the number.

PALETTE ICON

Example

Description

When you perform a calculation on the calculator, the result is inserted into the number edit's display. TASCalcEdit will have

the keyboard restrictions, so the user cannot enter invalid characters. When the user leaves the field, the number is reformatted

to display appropriately, accordingly with the DisplayFormat property.

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Color

Ctl3D

Cursor

Flat

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Entry

EntryBGColor

EntryFont

EntryUseDflt

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

AutoSelect If this property is checked (True) when the user activates this object, either by clicking on it, pressing the TAB key, or executing the FOCUS command, any Text that is currently displayed will be marked as selected. The user will be able to enter a new value just by typing. If the user wants to start at a certain character they will have to move the edit cursor to that character with the mouse or arrow keys. Default value is True. This can be changed at runtime.

BorderStyle

ButtonHint This is the hint that will be displayed to the user when they hover over the button. This can be changed at runtime.

ButtonWidthNum The size of the button in pixels. Defaults to 0. This can be changed at runtime. If you want to make the button appear in the object you must set this value to something more than 0. In general, this should be 20 or 21 to properly display the button.

ClickKey Choose the key stroke the user can use to have the same effect as clicking the button. This would be in addition to clicking the button. The default value is Alt+Down (alt key + down arrow).

Constraints

DecimalPlaces This is the number of decimal characters that are allowed for this field. This can be from 0 to 8 and should match, if it exists, the DisplayFormat property. This property can be modified at runtime.

DirectInput If this is clicked (set to .True.), the user will be able to enter the text directly. If this is not clicked (set to .False.) the only way they will be able to set the text value is to click the button and have the routine that is called set the Text value. The default is checked. This can be changed during runtime.

DisplayFormat This will control how the number is displayed to the user. The default value is $,0.00;-$,0.00. The effect of this is to force two decimal characters, use a comma (,) to separate thousands, etc, use a period as a decimal character, preface the field with a dollar sign and, if it's a negative number, put the minus sign in front of the dollar sign. Make sure the number of decimal characters match what you have in DecimalPlaces. If this is blank there will be no formatting. This property can be modified at runtime.

FormatOnEditing Generally in Windows numeric entries the value is moved to the left (left justified) and all formatting is removed when the user makes changes. If you check this property (set to True) the number will remain right justified and the formatting will remain while the user edits the numbers. The default value is checked (True) and can be modified during runtime.

NOTE: If you check this option you must not use the .CHANGE event also. If you do, the entry will not work properly.

MaxLength The maximum number of characters the user can enter for this object. If you have connected this to a field in your program with the FieldName property then this will be set automatically when the program runs to the size of the field.

MaxValue You can specify the maximum value that can be entered into this object by putting that value here. This is similar to using the Valid event except that you don't need any other code. The default value is 0 which means no checking. This can be changed during runtime.

MinValue You can specify the minimum value that can be entered into this object by putting that value here. This is similar to using the Valid event except that you don't need any other code. The default value is 0 which means no checking. This can be changed during runtime.

NumGlyphs If you have two glyphs that can be displayed, one normally, and the second when the user clicks the button, then this would be two. The default value is one.

ParentCtl3D

ReadOnly

ReturnIsTab

Text In this object this property is not relied upon. Instead the program uses the Value property.

Value The numeric value of the entry. This strips all formatting characters and all that's left is just the actual number.

ZeroEmpty If this is checked (True) and the Value property is 0 then the entry field will be blank when the user sets the focus to this object.

Position

AutoSize If this property is set to True (checked) the object will increase in size if the Text value is too long to be displayed and reduced in size if the Width value is too wide for the Text. Default value is True. You should change this to False (unchecked) if you want to make sure the entry field stays the same size as you designed it. This can be changed at runtime.

Height

Left

Top

Width

TAS Pro

DfltValue This value will be inserted automatically into the field if the field is blank when the object is chosen on the form. If you want to use a constant value surround the value in quotes, e.g., '100.50' etc. If you want to use a field, then just put in the field name. The default value is blank. This can be changed during runtime.

NOTE: You can't use an expression here. However, this is a perfect use of the VALUE option in the DEFINE field command. Just define a field, set the VALUE option to what ever expression you want to use, and put that field name into the DfltValue property.

FastSearchType If you are using this object as a FastSearch field in connection with a TTASDataGrid you need to specify the type of numeric field. This would match the index type you're searching on. So, if the index is a type N you would set this to fsNum. If the index is a type R, this should be fsRec. The options are fsByte (type B), fsInt (type I), fsRec (type R) and fsNum (type N). This can be changed at runtime.

FieldName

FldModified NOTE: This is a runtime only property and will not show up in the Object Inspector.

FocusOnObject

HelpStatusBar

HelpStatusBarMsg

KeyTrapHint

KeyTraps

ValidCheckOnExit

ValidExpr

ValidMsg

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:

Change This event is called every time the user makes a change to the Text of this object. That includes entering a new character, deleting a character, etc. Each time this event is executed the field that is attached to this object through the FieldName property is updated so that you can check the characters entered, modified, etc. through the field. Be cautious about using this since it will slow down the entry process.

Click In this component there is no click event because when clicked the Calculator will come up making a click even imposible.

Disp This event is called when the field that is attached to the object is to be refreshed on the screen. This can happen when a record is read, after a calculation, etc.

Post This event is called when the user moves from the current object to another. By default this event will return .True. If you return .False. This will keep the user from leaving this object. This will stop the process from continuing, This can be used to make sure settings are proper after leaving the object. To force the user to stay on the current object, if there is a problem, you may also use the Valid event instead of this.

Pre This event is called when the user moves into an object. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to access the object. If you return .False. the object that was active before they got to this object will get the focus again. This keeps the user from accessing an object that you don't want to be active. Commonly used in application where some fields are accessible sometimes (RET .TRUE.) and aren't others (RET .FALSE.).

The process by which these events are called is:

Pre - This occurs when focus changes to the object.

Change - During field entry.

Post - Called after Valid returns .True. (if there is a Valid event) and before the Pre for the next object.

Disp - Is called anytime the form/object is refreshed.


TTASCheckBox

Navigation: Reference > Form Objects >

TTASCheckBox

 Print this Topic Return to chapter overview

Use this object to replace a standard Y/N question. If the user checks the box the value returned to the field attached to the object will be Y, if unchecked, it will return N. You can also make the attached field a type L (logical). In that case the object will return .True. (clicked) or .False. (unclicked) as would be expected.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Caption This is the text that is displayed on the left or the right of the checkbox depending on the value in Alignment.

Color

Ctl3D

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Entry

EntryBGColor

EntryFont

EntryUseDflt

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

Checked If the box is checked this property will return .True. You can also preset the Checkbox by setting this value.

Constraints

ParentCtl3D

ReturnIsTab

State If the Checkbox is checked this will return cbChecked, if not it will return cbUnchecked. This property can be modified during runtime. The values are defined in COMPILERCONSTANTS.TXT.

Position

Height

Left

Top

Width

TAS Pro

DfltValue If you want to set the checkbox use Y or N here. The default value is N. This can be changed during runtime.

FieldName NOTE: if you use get_obj_prop() you must have a field name here if blank use can use "NONE" Also Pre post events will not fire without a field or the word NONE here.

NOTE: If you use an alpha 1 field the value will be Y or N if you use this as a logical it will be true or false.

NOTE : Also Pre post events will not fire without a FieldName or the word NONE here. (for both Pre and Post events) You must have a field name here, or if blank you can use "NONE"

FldModified NOTE: This is a runtime only property and will not show up in the Object Inspector.

FocusOnObject

HelpStatusBar

HelpStatusBarMsg

KeyTrapHint

KeyTraps

ValidMsg

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Click event below would be: ObjectName.Click:

Click This event is called if the user clicks on the object. you will uses this in place of change event for a checkbox.

Disp This event is called when the field that is attached to the object is to be refreshed on the screen. This can happen when a record is read, after a calculation, etc.

Post This event is called when the user moves from the current object to another. By default this event will return .True. If you return .False. This will keep the user from leaving this object. This will stop the process from continuing, This can be used to make sure settings are proper after leaving the object. To force the user to stay on the current object, if there is a problem, you may also use the Valid event instead of this.

Pre This event is called when the user moves into an object. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to access the object. If you return .False. the object that was active before they got to this object will get the focus again. This keeps the user from accessing an object that you don't want to be active. Commonly used in application where some fields are accessible sometimes (RET .TRUE.) and aren't others (RET .FALSE.).

The process by which these events are called is:

Pre - This occurs when focus changes to the object.

Change - During field entry. NOTE : Change Is not valid for TTASCheckBox

Post - Called after Valid returns .True. (if there is a Valid event) and before the Pre for the next object.

Disp - Is called anytime the form/object is refreshed.

NOTE : Also Pre post events will not fire without a FieldName or the word NONE here. (for both Pre and Post events) You must have a field name here, or if blank you can use "NONE"


TTASComboBox

Navigation: Reference > Form Objects >

TTASComboBox

 Print this Topic Return to chapter overview

This object is similar to the TTASEnter with a few extra options. You can create a list of values that the user can choose from if the click on the drop down button or as they are typing.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Color

Ctl3D

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

List

ItemHeight The size of each line in the drop down box in pixels. This can be modified during runtime.

Items The line items in the drop down box. You can modify this list during runtime by using the COMBO_ITEM command or the STRINGS() function.

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

CharCase Use this property to determine what case the characters will be entered in. To force upper case use ecUpperCase, to force lower case use ecLowerCase and to allow either use ecNormal. The default value is ecNormal. This property can be modified during runtime. The values are defined in COMPILERCONSTANTS.TXT.

Constraints

DropDownCount How many line items appear to the user at a time. If there are more items than this a vertical scroll bar will be displayed for the user to scroll down or up in the list of items.

ItemNumber If the user chooses an item from the Item property list this will be the item number value.

MaxLength The maximum number of characters the user can enter for this object. If you have connected this to a field in your program with the FieldName property then this will be set automatically when the program runs to the size of the field.

ParentCtl3D

ReturnIsTab

SelectStart This property allows you to set the location of the cursor within the text window. The primary purpose of this property is to reset the text line within the object window. If the user exits the object and the text line is longer than the window and the beginning of the text line is hidden, you can force the text line to redisplay from the beginning by setting this property to 0.

Sorted If this is checked (set to .True.) then the items in the Items list will be sorted. This can be modified during runtime.

Style What type of combo box to display. The options are: csDropDown (allow the user to either enter a value directly into the field or choose a value from the drop down box - default value), csDropDownList (user may only choose a value from the drop down list, not allowed to enter directly into the field), csSimple (no drop down box is available, however, the user can scroll through the available items using the up and down arrows). The options csOwnerDrawFixed and csOwnerDrawVariable are not available at this time.

NOTE: The csDropDownList option will make sure that the user will always choose one of the values in the Items property. To have the value display properly in the object display window you must make sure that the value in the field matches exactly one of the values in the ITEMS list (above). Something to watch out for are extra spaces at the end of the value in the ITEMS list. The program will not be able to match the value in the field to the value in the list if there are extra spaces appended to the items in the list.

Text This is the actual data that has been entered by the user or that comes from the field value if this is attached to a field in your program. The value can be accessed during runtime and is automatically updated if you have set the FieldName property value. The property value will also be saved automatically to the field when the user moves to the next object.

Position

Height

Left

Top

Width

TAS Pro

DfltValue This value will be inserted automatically into the field if the field is blank when the object is chosen on the form. If you want to use a constant value surround the value in quotes, e.g., 'ABC' or '100.50' etc. If you want to use a field, then just put in the field name. The default value is blank. This can be changed during runtime.

NOTE: You can't use an expression here. However, this is a perfect use of the VALUE option in the DEFINE field command. Just define a field, set the VALUE option to what ever expression you want to use, and put that field name into the DfltValue property.

DropDown Set this property to True if you want to force the drop down box to be displayed. This will also set the focus to this object. To close the drop down box set this property to False.

NOTE: This is a runtime only property and will not show up in the Object Inspector.

FieldName

FldModified NOTE: This is a runtime only property and will not show up in the Object Inspector.

FocusOnObject

HelpStatusBar

HelpStatusBarMsg

KeyTrapHint

KeyTraps

ValidCheckOnExit

ValidExpr

ValidMsg

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:

Change This event is called every time the user makes a change to the Text of this object. That includes entering a new character, deleting a character, etc. Each time this event is executed the field that is attached to this object through the FieldName property is updated so that you can check the characters entered, modified, etc. through the field. Be cautious about using this since it will slow down the entry process.

Disp This event is called when the field that is attached to the object is to be refreshed on the screen. This can happen when a record is read, after a calculation, etc.

DropDown This event is called when the user clicks on the drop down button and before the list is displayed. This gives you the ability to load the list when needed.

Post This event is called when the user moves from the current object to another. By default this event will return .True. If you return .False. This will keep the user from leaving this object. This will stop the process from continuing, This can be used to make sure settings are proper after leaving the object. To force the user to stay on the current object, if there is a problem, you may also use the Valid event instead of this.

Pre This event is called when the user moves into an object. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to access the object. If you return .False. the object that was active before they got to this object will get the focus again. This keeps the user from accessing an object that you don't want to be active. Commonly used in application where some fields are accessible sometimes (RET .TRUE.) and aren't others (RET .FALSE.).

The process by which these events are called is:

Pre - This occurs when focus changes to the object.

Change - During field entry.

Post - Called after Valid returns .True. (if there is a Valid event) and before the Pre for the next object.

Disp - Is called anytime the form/object is refreshed.

DropDown - Is called when the user clicks on the drop down button.

Example

The example below shows code on how to read data into the combo box using a scan and the combo_item command.

umcomp.pre: //load the dropdown

COMBO_ITEM CLR NAME 'umcomp' clear

SCAN @um_hndl KEY UM.TYPE START MAT.UM.TYPE WHILE UM.TYPE = MAT.UM.TYPE

COMBO_ITEM ADD UM.NAME NAME 'umcomp'

ends

set_object 'umcomp' property 'dropdown' value true //This forces the dropdown to dropdown it has to be after the COMBO_ITEM command

ret


TTASComboEnter

Navigation: Reference > Form Objects >

TTASComboEnter

 Print this Topic Return to chapter overview

This is a special version of the standard TTASEnter object. Using this object you can allow the user to enter a value 'normally', and/or by chaining to a program routine when the user clicks on the button.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Color

Ctl3D

Cursor

Glyph If you have chosen a custom glyph in GlyphKind below this is where you would choose the .bmp file that would be used instead of the standard ones that come with this object.

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Entry

EntryBGColor

EntryFont

EntryUseDflt

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

AutoSelect If this property is checked (True) when the user activates this object, either by clicking on it, pressing the TAB key, or executing the FOCUS command, any Text that is currently displayed will be marked as selected. The user will be able to enter a new value just by typing. If the user wants to start at a certain character they will have to move the edit cursor to that character with the mouse or arrow keys. Default value is True. This can be changed at runtime.

BorderStyle

ButtonHint This is the hint that will be displayed to the user when they hover over the button that displays the calendar. This can be changed at runtime.

ButtonWidth The size of the button in pixels. Defaults to 20. This can be changed at runtime.

CharCase Use this property to determine what case the characters will be entered in. To force upper case use ecUpperCase, to force lower case use ecLowerCase and to allow either use ecNormal. The default value is ecNormal. This property can be modified during runtime. The values are defined in COMPILERCONSTANTS.TXT.

ClickKey Choose the key stroke the user can use to have the same effect as clicking the button. This would be in addition to clicking the button. The default value is Alt+Down (alt key + down arrow).

Constraints

DirectInput If this is clicked (set to .True.), the user will be able to enter the text directly. If this is not clicked (set to .False.) the only way they will be able to set the text value is to click the button and have the routine that is called set the Text value. The default is checked. This can be changed during runtime.

EditMask This will control the structure of the field that can be entered. An Edit Mask Property Editor can be accessed by clicking on the button in the property field.

NOTE: If you specify an EditMask value the Change event will be ignored.

GlyphKind This will determine what appears on the button in this object. The options are: gkCustom (this will use what ever you have chosen in the Glyph property above), gkDefault (the default value, displays a blank button), gkDropDown (a standard drop down arrow glyph), gkEllipsis (a standard ellipsis glyph).

MaxLength The maximum number of characters the user can enter for this object. If you have connected this to a field in your program with the FieldName property then this will be set automatically when the program runs to the size of the field.

NumGlyphs If you have two glyphs that can be displayed, one normally, and the second when the user clicks the button, then this would be two. The default value is one.

ParentCtl3D

ReadOnly

ReturnIsTab

SelectStart This property allows you to set the location of the cursor within the text window. The primary purpose of this property is to reset the text line within the object window. If the user exits the object and the text line is longer than the window and the beginning of the text line is hidden, you can force the text line to redisplay from the beginning by setting this property to 0.

Text This is the actual data that has been entered by the user or that comes from the field value if this is attached to a field in your program. The value can be accessed during runtime and is automatically updated if you have set the FieldName property value. The property value will also be saved automatically to the field when the user moves to the next object. You can also set this property during the routine that is executed when the user clicks the button.

Position

Height

Left

Top

Width

TAS Pro

AllowedChrs You can specify the characters that are allowed to be entered for this object. Do not separate the values with commas, for example, if you want to allow A, B and C only you would make this property: ABC. Default value is blank. This can be changed at runtime.

DfltValue This value will be inserted automatically into the field if the field is blank when the object is chosen on the form. If you want to use a constant value surround the value in quotes, e.g., 'ABC' or '100.50' etc. If you want to use a field, then just put in the field name. The default value is blank. This can be changed during runtime.

NOTE: You can't use an expression here. However, this is a perfect use of the VALUE option in the DEFINE field command. Just define a field, set the VALUE option to what ever expression you want to use, and put that field name into the DfltValue property.

FieldName

FldModified NOTE: This is a runtime only property and will not show up in the Object Inspector.

FocusOnObject

HelpStatusBar

HelpStatusBarMsg

KeyTrapHint

KeyTraps

ValidCheckOnExit

ValidExpr

ValidMsg

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:

Change This event is called every time the user makes a change to the data of this object. That includes entering a new character, deleting a character, etc. Each time this event is executed the field that is attached to this object through the FieldName property is updated so that you can check the characters entered, modified, etc. through the field. Be cautious about using this since it will slow down the entry process.

NOTE: If you enter a value for the EditMask the Change event will be ignored.

Click This event is called if the user clicks the button on the object.

Disp This event is called when the field that is attached to the object is to be refreshed on the screen. This can happen when a record is read, after a calculation, etc.

Post This event is called when the user moves from the current object to another. By default this event will return .True. If you return .False. This will keep the user from leaving this object. This will stop the process from continuing, This can be used to make sure settings are proper after leaving the object. To force the user to stay on the current object, if there is a problem, you may also use the Valid event instead of this.

Pre This event is called when the user moves into an object. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to access the object. If you return .False. the object that was active before they got to this object will get the focus again. This keeps the user from accessing an object that you don't want to be active. Commonly used in application where some fields are accessible sometimes (RET .TRUE.) and aren't others (RET .FALSE.).

The process by which these events are called is:

Pre - This occurs when focus changes to the object.

Change - During field entry.

Post - Called after Valid returns .True. (if there is a Valid event) and before the Pre for the next object.

Disp - Is called anytime the form/object is refreshed.

Click - Is called anytime the user clicks the button.


TTASDataGrid

Navigation: Reference > Form Objects >

TTASDataGrid

 Print this Topic Return to chapter overview

This may be the most important object available. This will display a list of records or array field values on the form in a certain order in columns. You can allow the user to delete rows (records or array elements), insert rows (array elements only), add new rows to the end of the grid, and, through the use of the DATA_GRID command, add columns, remove columns, shift them around, etc.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Color

Ctl3D

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

AltColorRows If this is checked the the grid will use the Column Color using that color and reduce every other row by 5% so Row 1 is white and next is a darker white. giving you a nice looking effect. Remeber this Uses the Column Color. Note: We may in toe future add the ability to choose the color. This property is checked by default. this feature avalible at ver 7.7.2

Here is an example using the AltColorRows Notice the color change between Column

Anchors

AutoNumAlign If this is checked (set to .True.) numeric columns will be aligned to the right, automatically.

BorderStyle

ColCount The number of columns in the grid. This is generally maintained automatically by the number of columns you create in the Columns property.

Columns This is where you created or edit the columns for this grid. See the Data Grid Columns Editor for more information on creating columns. The actual column objects are defined in TTASDGItem.

Constraints

DefaultColWidth When a column is created this is the default width in pixels that will be used. You can adjust any column to any width you wish.

DefaultRowHeight The height of each row in the grid, in pixels. When the grid is used to access a regular file this value may be modified to force the rows to show up properly within the space available in the grid.

EnhRowColMove If you are using the grid to edit array fields and you want to allow the user to move rows, or you want to allow the user to move columns for either type, then check this property (set to .True.).

ExtraFields This is used in connection with WLISTM grids. When the user inserts or deletes a row you will want all the arrays that apply to be updated. Some of the fields in those arrays may not be part of the grid. To make sure all fields are updated properly add those field names using the editor for this property. This is not a field that can be entered directly or at runtime. For more information please see TTASDGExtraFld.

FixedColor The color used for fixed columns or rows.

FixedCols The number of fixed columns. These are columns which can't be used for data entry. Generally this value is 0. However, if you are using the grid to edit array fields you can set this value to 1. The first column will appear to be fixed to the user, however, they can, by clicking on the appropriate row, move the row to another location in the grid.

FixedFont The font to be used on fixed rows and columns. Uses the standard Font Property Editor.

FixedRows The number of fixed rows. These are rows which can't be used for data entry. Generally this value is 1 since the top row of the grid is used for column titles.

GridLineWidth The size of the grid lines in pixels. This property value defaults to 1.

HintColor The background color to use when displaying hints for the grid.

Hovering If this is checked (set to .True.) and the grid is in edit mode, the cell will be selected if you move the mouse over the cell and let it stay there for a few moments.

Navigation This is a multiple option property. Click the '+' next to the property name to display the sub properties.

AdvanceAtEnd - If this is checked, when the user moves off the last cell in the last row the grid will automatically create a new row.

AdvanceAuto - If this is checked, and the cell has a masked entry, the grid will automatically move to the next cell when the entry is complete. For example, if you were entering a telephone number and used a masked entry field, when the user reaches the end of the entry the cursor will move to the next cell.

AdvanceDirection - Which cell is the next one selected when the grid is in edit mode. The options are: adLeftRight (the selected cell is the next one in the row or the first in the next row) or adTopBottom (the selected cell is the next row). The default value is adLeftRight.

AdvanceOnEnter - Move to the next cell when the user presses the ENTER key.

NOTE: If you are in goRowSelect (see below) and want to allow the user to press ENTER to select the record then check this option (set to .True.).

AllowAddRecListF - Allow the user to add a new row at the end of the grid when a file is attached to the grid. If this is not checked the user won't be able to add new records (rows) to the file.

AllowDeleteRow - If this is checked the user will be able to delete rows (records) from the grid by pressing the DELETE key.

AllowInsertRow - If this is checked the user will be able to insert rows in the grid by pressing the INSERT key. This will work with arrays only.

CursorWalkEditor - If this is checked when the user moves the cursor within a cell using the left or right arrow key and reaches the end of the entry field for that cell, the cursor will move to the previous (left arrow) or next (right arrow) cell.

InsertPosition - If you've checked the AllowInsertRow property, and you're working with array fields, this determines where inserted rows will be placed. The options are: pInsertBefore (add a new row before the current row - the default value) or pInsertAfter (add a new row after the current row).

NOTE: All of the above options apply ONLY IF the grid is in edit mode. See goEditing in Options below for more information.

Options This is a multiple option property. Click the '+' next to the property name to display the subproperties.

goColMoving - Allow the user to move columns in the grid. This can also be done programmatically through the DATA_GRID command.

goColSizing - The user can resize individual columns.

goDrawFocusSelected - if you don't check this value, and goRowSelect is checked, you will notice that the first column in the row is a different color than the rest of the row. It is recommended that you should always check this option if you have also checked goRowSelect.

goEditing - If this is checked the grid is placed in edit mode. The goRowSelect option will automatically be unchecked.

goFixedHorzLine - Horizontal lines separate the fixed columns and rows. The default value is checked.

goFixedVertLine - Vertical lines separate the fixed columns and rows. The default value is checked.

goHorzLine - Horizontal Lines separate the rows in the grid. The default value is checked.

goRowMoving - Allow the user to move rows in the grid. This only applies to grids that are used in conjunction with arrays. Also, you the FixedCols property value must be at least 1. The user then grabs the row by the fixed column portion and moves it to the new location. The array location will be updated automatically.

goRowSelect - If you want the user to select a record (or array element) instead of editing individual fields then check this option. This would be used for choosing a record during lookups, etc.

goRowSizing - The user can resize individual rows.

goVertLine - Vertical lines separate the columns in the grid. The default value is checked.

ParentCtl3D

PasswordChar This is the character to use when the column is marked as Password type (see TTASDGItem).

RowCount The number of rows in the grid. This is set automatically by the program, however, if you want to see how many rows will fit in the space you have designed you can put a number in here. It will not have any effect once the program is running.

ScrollBars This property allows you to determine whether or which scroll bars should be displayed if they are necessary. The default value is ssBoth (both vertical and horizontal scroll bars can be displayed). It is recommended that you leave this ssBoth unless you know you don't want the user scrolling one way or the other on the grid.

SelectionColor Sets the grid background color for selected cells. Default value is clHighLight.

SelectionRectangle If this is checked (set to .True.) a thick line will be placed around the selected row or cell.

SelectionTextColor The color to use when a row is marked as selected (see Options for goRowSelect).

VAlignment Sets vertical alignment of text in cells in single line mode. The options are: vtaTop (display the text at the top of the cell - this is the default value), vtaCenter (center the text vertically in the cell) and vtaBottom (display the text at the bottom of the cell). In most cases this won't matter since the row size is just a little bigger than the text itself. However, if you have large rows and want to move the text to a different position you can do so here.

Position

Align

Height

Left

Top

Width

TAS Pro

CurrentCol Use this property to get or set the column number in the grid. The first column (after any fixed columns) is number 1. This property will not be visible in the object inspector.

CurrentRow Use this property to get or set the row number in the grid. This should only be used for memory array type grids. In file grids the actual row may or may not match what you expect. In memory array grids the row matches the element number in the array. This property is will not be visible in the object inspector.

FastSearchFld If you want to allow the user to search for a record in the grid at runtime you would place an entry object (TTASEnter, TTASNumEnter, TTASTimeEdit, TTASDateEdit or TTASComboEnter) on the form along with the appropriate grid. You would then put the object name into the FastSearchFld property. Then any characters the user enters will be used for searching the record in the grid. If they backspace, the letters will be deleted and a previous record will be found. You can use the AllowedChrs, DfltValue, EditMask or CharCase (if available) to control what the user enters or how the characters are entered. Also, if you set the ReturnIsTab option in the entry field and the AdvanceOnEnter option in the Navigation property for the grid, when the user presses the ENTER key it will have the same effect as pressing the ENTER key in the grid and the .SELECT event will fire for the grid. An example of this is the program is FLDLST.

NOTE: If you are searching a number you need to be aware of this property. for the TTasNumEnter. FastSearchType If you are using this object as a FastSearch field in connection with a TTASDataGrid you need to specify the type of numeric field. This would match the index type you're searching on. So, if the index is a type N you would set this to fsNum. If the index is a type R, this should be fsRec. The options are fsByte (type B), fsInt (type I), fsRec (type R) and fsNum (type N). This can be changed at runtime.

NOTE: The FastSearchFld value can be changed at runtime. This means you can change the entry field to match the array index. You could have multiple fields on the form and only the appropriate field would be visible. If the user changed to a different index the appropriate field would be made visible and the current would be set to invisible. Set the FastSearchFld to the new field name and you're done.

NOTE: This only works when the grid is in goRowSelect mode as described above.

NOTE: The Up and Down Arrow keys will also work in a FastSearch field. This means the user can move up or down the grid by pressing the appropriate key when the FastSearch field has focus.

NOTE: If you are accessing a CodeBase file, then this must be a TTASEnter type field. There are a couple of different rules applying to CodeBase files also, these are:

1. When entering a date value to search on it must be entered in YYYYMMDD type format, for example, 20021005 is October 5, 2002.

2. If you are entering a compound key (made up of multiple keys) you must enter the defined display size of the field, not the actual size you're looking for. For example, if part of the index is an alpha type field that is defined as 6 characters and the index you're looking for uses only the first three as in ABC, then you would still enter ABC and three spaces before the next part of the index.

3. If you are searching on a numeric value the value must be right justified and the full display size entered. For example, if you are searching on an I type field of Dsize 3 and the value you're searching for is 45 then you must enter a space and then the 45. The same applies to numeric values with a decimal character. And, internally in CodeBase, ALL decimal characters are periods and no other separators are saved.

NoAutoUpdate When a grid is active, the current row will be updated each time a screen refresh is called for the parent form. This can be often depending on what's happening on the form. If you have modified data in the grid and haven't saved the record before the screen refreshes, the data changes can be lost. By setting this property to true (checked) you will keep the grid from updating that data automatically.

StartAtEnd If you want to start the grid at the end of the file for the given key then check this option (set to .True.). This is effective during the initial display of the grid only (or when you execute the SETUP option in the WLISTF or WLISTM command).

COMMENTS

Each intersection of a row and a column in the grid is called a cell.

Any changes the user makes to the grid during runtime is not saved automatically. If you wish to keep track of the changes you will need to look at each column (using the DATA_GRID command) and save the layout in a separate file (or in the registry with the REGEDIT() function).

NOTE: If you are in goRowSelect (see below) and want to allow the user to press ENTER to select the record then check this option (set to .True.).

NOTE: If you want to check ValidExpr's in your columns you must use the GRID_VALID_CHECK() function instead of the VALID_CHECK() function you would use in a normal entry field.

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Add event below would be: ObjectName.Add:

Add This event is called when the user tries to add a new record to the end of the grid. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to add a new record/row. If you return .False. the record/row will not be added. Use this event to keep the user from creating new records/array rows until they have finished the current one, or, if they have reached a maximum.

Delete This event is called when the user tries to delete a record/array row currently in the grid. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to delete the record/row. If you return .False. the record/row will not be deleted.

NOTE: If you have a TTASNavigator attached to this grid and you have the ConfirmDelete property set to True (checked) the delete question will be asked of the user before the Delete event is executed.

Display This event is called every time a row is displayed. Use this event to find related records in a file grid. The event is called before the row is displayed so that any record found will be included with the row.

Insert This event is called when the user tries to insert a new row in the grid. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to insert a new row. If you return .False. the row will not be added. Use this event to keep the user from creating new array rows until they have finished the current one, or, if they have reached a maximum.

NOTE: This event applies only to WLISTM (array) type grids. You cannot insert a row in a WLISTF type grid.

Move This event is called every time the user moves to a different row in the grid. Use this event to find supporting records, arrays, etc. Before the event is called the appropriate record is found or the array counter is updated properly.

Save This event is called when the user tries to save a record than has been added or changed in the grid. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the record will be saved. If you return .False. the record will not be saved. Use this event to keep the user from updating or adding records until they are complete.

NOTE: This event applies only to a WLISTF (file) type grid.

NOTE: If you have a TTASNavigator attached to this grid and you have the ConfirmSave property set to True (checked) the save question will be asked of the user before the Save event is executed.

Select This event is called every time the user double clicks on a row in the grid. This event is also called in connection with the FastSearchFld process (listed above) when the user presses the ENTER key during the search (if the appropriate properties are set correctly).

Header This even will fire when the user click on the Header on the grid. Col1 is the name of that Column.

Example

Col1.header:

Msg 'Switch'

ret

Note: To control formatting of numbers in the grid use the Format command. If you need to display a number of decimal placed in the grid other then the defined number of places you can use the redef command. the number of decimal places in the O / I will not change the number of decimal places at this time.


TTASDateEdit

Navigation: Reference > Form Objects >

TTASDateEdit

 Print this Topic Return to chapter overview

Use this object to enter any type D (date) field. There are other objects to enter numbers, strings and times.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Color

Ctl3D

Cursor

Glyph If you have chosen a custom glyph in GlyphKind below this is where you would choose the .bmp file that would be used instead of the standard ones that come with this object.

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Entry

EntryBGColor

EntryFont

EntryUseDflt

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

AutoSelect If this property is checked (True) when the user activates this object, either by clicking on it, pressing the TAB key, or executing the FOCUS command, any Text that is currently displayed will be marked as selected. The user will be able to enter a new value just by typing. If the user wants to start at a certain character they will have to move the edit cursor to that character with the mouse or arrow keys. Default value is True. This can be changed at runtime.

BorderStyle

ButtonHint This is the hint that will be displayed to the user when they hover over the button that displays the calendar. This can be changed at runtime.

ButtonWidth The size of the button in pixels. Defaults to 20. This can be changed at runtime.

CalendarHints There are 4 buttons at the top of the calendar that can be displayed using this object. The standard hints are: "Last Year", "Last Month", "Next Month" and "Next Year." You can change these to anything you wish by using the standard Strings Property Editor. Only the first four lines will be used and will replace the default values on a line-by-line change.

CalendarStyle When the user clicks on the calendar button you have a choice of what type of display to use. This can be csPopup (the default value) which displays a calendar attached to the object; or csDialog which displays the calendar in a standard dialog form.

ClickKey Choose the key stroke the user can use to display the calendar for this object. This would be in addition to clicking on the button. The default value is Alt+Down (alt key + down arrow).

Constraints

DefaultToday If this is clicked (set to .True.), and no previous date was entered, the date will default to the current date as set on the user's system. This would have the same effect as setting the DfltValue to the DATE() function.

DialogTitle If you have chosen csDialog in CalendarStyle above you can specify what will appear in the dialog box caption by entering a value here. The default value is "Select a Date." This can be changed during runtime.

DirectInput If this is clicked (set to .True.), the user will be able to enter the date directly. If this is not clicked (set to .False.) the only way they will be able to set the date value is to choose one from the calendar. The default is checked. This can be changed during runtime.

EditMask This will control the structure of the field that can be entered. An Edit Mask Property Editor can be accessed by clicking on the button in the property field.

GlyphKind This will determine what appears on the button in this object. The options are: gkCustom (this will use what ever you have chosen in the Glyph property above), gkDefault (the default value, displays a small calendar symbol), gkDropDown (a standard drop down arrow glyph), gkEllipsis (a standard ellipsis glyph).

MaxLength The maximum number of characters the user can enter for this object. If you have connected this to a field in your program with the FieldName property then this will be set automatically when the program runs to the size of the field.

NumGlyphs If you have two glyphs that can be displayed, one normally, and the second when the user clicks the button, then this would be two. This is the default value.

ParentCtl3D

PopupAlign If you choose csPopup in CalendarStyle above this will determine whether the popup box will be aligned with the right side of the object (epaRight - the default value) or the left (epaLeft).

ReadOnly

ReturnIsTab

StartOfWeek What day will be the first day of the week when the calendar is displayed.

Text This is the alpha representation of the date value. If this object is attached to a field the correct date value is automatically used.

WeekendColor If you want the weekends in the calendar to be displayed with a special color you can choose that here. The default value is Red.

Weekends Choose the days that makeup the weekend. The default value is Sunday only.

YearDigits This is the number of digits for the year value. This can be: dyDefault (depends on settings for the user's locality), dyFour (a four digit year, e.g., 2000), and dyTwo (a two digit year, e.g., 00).

NOTE: If you are using short (8 character) dates in your program this MUST be set to dyTwo or your dates will not display properly.

Position

Height

Left

Top

Width

TAS Pro

DfltValue This value will be inserted automatically into the field if the field is blank when the object is chosen on the form. If you want to use a constant value surround the value in quotes, e.g., '12/01/00'. If you want to use a field, then just put in the field name. The default value is blank. This can be changed during runtime.

NOTE: You can't use an expression here. However, this is a perfect use of the VALUE option in the DEFINE field command. Just define a field, set the VALUE option to what ever expression you want to use, and put that field name into the DfltValue property.

FieldName

FldModified NOTE: This is a runtime only property and will not show up in the Object Inspector.

FocusOnObject

HelpStatusBar

HelpStatusBarMsg

KeyTrapHint

KeyTraps

ValidCheckOnExit

ValidExpr

ValidMsg

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:

Disp This event is called when the field that is attached to the object is to be refreshed on the screen. This can happen when a record is read, after a calculation, etc.

Post This event is called when the user moves from the current object to another. By default this event will return .True. If you return .False. This will keep the user from leaving this object. This will stop the process from continuing, This can be used to make sure settings are proper after leaving the object. To force the user to stay on the current object, if there is a problem, you may also use the Valid event instead of this.

Pre This event is called when the user moves into an object. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to access the object. If you return .False. the object that was active before they got to this object will get the focus again. This keeps the user from accessing an object that you don't want to be active. Commonly used in application where some fields are accessible sometimes (RET .TRUE.) and aren't others (RET .FALSE.).

The process by which these events are called is:

Pre - This occurs when focus changes to the object.

Post - Called after Valid returns .True. (if there is a Valid event) and before the Pre for the next object.

Disp - Is called anytime the form/object is refreshed.

NOTE: The CHANGE event is not available for this object. This allows the user to enter date values directly. If the entry was checked after every character the user would receive almost continuous error messages.


TTASDGColTemplate

Navigation: Reference > Form Objects >

TTASDGColTemplate

 Print this Topic Return to chapter overview

This is a duplicate of the TTASDGItem (Columns) in a TTASDataGrid object. Through the use of this object you can add to or update an existing grid through the use of the DATA_GRID command.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Color

Font

Font

Misc

Name

Other

BorderPen This is the color, mode, style and width of the border around the cell. The colors (clScrollBar to clWhite), modes (pmBlack to pmNotXor) and styles (psSolid to psInsideFrame) are defined in COMPILERCONSTANTS.TXT. These properties can be modified at runtime by referring to the property as 'BorderPen.Style', 'BorderPen.Color' or 'BorderPen.Mode'. The Width is an integer value that specifies the size of the border in pixels. The default value is 1.

Borders You can specify a special border that fits around the cell. This would be instead of the normal grid lines. You can choose any or all of the four sides of the cell by checking the appropriate option. The default values for each option is unchecked.

CharCase This can be used to force all the characters entered by the user to be in upper case (ecUpperCase), lower case (ecLowerCase) or just the way the user enters them (ecNormal - the default value).

ComboItems If the Editor property value is edComboEdit or edComboList then this is the line items in the drop down box. You can modify this list during runtime by using the COMBO_ITEM command or the STRINGS() function.

ComboItemsSort If there are strings in the ComboItems property by checking this option they will be sorted when the user clicks on the drop down arrow.

DecimalChrs If the Editor property value is edNumeric then this is the number of decimal characters in the field that will be displayed for the user.

EditLength The maximum number of characters the user can enter for this column. If you have connected this to a field in your program with the FieldName property then this will be set automatically when the program runs to the size of the field.

EditMask This will control the structure of the field that can be entered. An Edit Mask Property Editor can be accessed by clicking on the button in the property field.

Editor What type of editor to use for this column if the user is going to be allowed to edit the field value. The options are: edCheckBox (displays a standard check box in the cell), edComboEdit (allow the user to either enter a value directly into the field or choose a value from the drop down box), edComboList (user may only choose a value from the drop down list, not allowed to enter directly into the field), edDateEdit (use this for date fields, has an integrated calendar), edDefault (a simple text entry editor - the is the default value), edEditBtn (put a button on the right side of the entry field - see CLICK in events below), edInteger (enter an integer value - B, I or R types), edNumeric (enter a decimal value - N type), edPassword (don't let anyone watching the screen see the entry the user is making - the password character is specified in TTASDataGrid), edSpinEdit (an up/down spin object that can be used for integer values), edTimeEdit (use this for entering time fields).

ElapsedTime If Editor property value is edTimeEdit you can check this property if you want to keep track of the number of seconds in hours:minutes:seconds.milliseconds type format. If the Editor is set to edTimeEdit and this property is not checked then the program assumes that you're entering actual time.

Fixed If you want this column to display as a fixed column in the grid then check this property. This will also make the values read-only.

FormatOnEnter If the Editor property value is edNumeric then the number will stay in display format when it is being editied.

Header The text to be displayed in the header (FixedRow) for this column.

Password This will also set the editor into password mode (see edPassword above in Editor).

ReadOnly If you don't want the user to be able to make any changes to values in this column then check this option.

SpinMax If the Editor property value is edSpinEdit then this is the maximum value the user can enter for this column.

SpinMin If the Editor property value is edSpinEdit then this is the minimum value the user can enter for this column.

SpinStep If the Editor property value is edSpinEdit then this is the amount that will be incremented/decremented each time the user clicks the up or down arrow in the column.

TimeFieldType If the Editor property value is edTimeEdit then this determines the format of the time displayed. NOTE: If the field is defined differently then the value entered here the object will default to the value entered here.

Position

Width

TAS Pro

AllowedChrs You can specify the characters that are allowed to be entered for this object. Do not separate the values with commas, for example, if you want to allow A, B and C only you would make this property: ABC. Default value is blank. This can be changed at runtime.

DfltValue This is the value that will be used as the default if, when the user accesses this field, no other value exists this will be set as the Text value. The user can then change the value if desired, or leave it alone and move to the next object. If you want to specify a value for this property it can be any string of characters. Do not include quotes. The default value is blank. This can be changed during runtime.

FieldName

HelpStatusBar

HelpStatusBarMsg

KeyTrapHint

KeyTraps

OnChangeLabel This label is called every time the user makes a change to the data of this column. That includes entering a new character, deleting a character, etc. Each time this label is called the field that is attached to this column through the FieldName property is updated so that you can check the characters entered, modified, etc. through the field. Be cautious about using this since it will slow down the entry process. The is the equivalent of the CHANGE event.

OnClickLabel If the column uses the edEditBtn editor this label is called when the user clicks on the button that appears in the cell during editing. This is the equivalent of a CLICK event for a TButton object.

PostLabel This label is called when the user moves from the current column to another. This will not stop the process from continuing, but can be used to make sure settings are proper after leaving the object. To force the user to stay on the current object, if there is a problem, use the Valid event instead of this. This is the equivalent of the POST event.

PreLabel This label is called when the user moves into a column. If you call this label you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to access the column. If you return .False. the column that was active before they got to this column will get the focus again. This keeps the user from accessing an column that you don't want to be active. Commonly used in application where some fields are accessible sometimes (RET .TRUE.) and aren't others (RET .FALSE.). This is the equivalent of the PRE event.

ValidCheckOnExit

ValidExpr

ValidMsg

COMMENTS

Each one of these properties can be modified during runtime.

NOTE: If you want to use an expression as the field value in a grid column, including an array specifier, you must use a DEFINEd field with a VALUE option. For example, if you want to display two fields added together as a column value you add the following to your program:

DEFINE tempFld type I size 5 value fld1+fld2

Then you would use tempFld as the FieldName in the column. When it is displayed it would execute the value expression.

EVENTS

Events for a standard TTASDataGrid and the associated Columns are setup when the form is loaded. Because of that you must define the labels to be called in the properties above.


TTASDGExtraFld

Navigation: Reference > Form Objects >

TTASDGExtraFld

 Print this Topic Return to chapter overview

There is no separate item on the palette for this object. This is created when editing a TTASDataGrid and you click on the ExtraFields property.

PROPERTIES

The following is the only property that applies to this object. It is defined in Common Properties and is linked to its appropriate page.

FieldName

COMMENTS

This property should be used to add extra fields to the grid that won't be displayed but will be updated when a row is inserted or deleted. This would only apply to array fields in WLISTM type grids. This uses a special property editor, similar to the one used for the Columns property in the data grid.


TTASDGItem

Navigation: Reference > Form Objects >

TTASDGItem

 Print this Topic Return to chapter overview

There is no separate item on the palette for this object. This is created when editing a TTASDataGrid and are the Columns property.

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Color

Font

Font

Misc

Name

Other

BorderPen This is the color, mode, style and width of the border around the cell. The colors (clScrollBar to clWhite), modes (pmBlack to pmNotXor) and styles (psSolid to psInsideFrame) are defined in COMPILERCONSTANTS.TXT. The Width is an integer value that specifies the size of the border in pixels. The default value is 1.

Borders You can specify a special border that fits around the cell. This would be instead of the normal grid lines. You can choose any or all of the four sides of the cell by checking the appropriate option. The default values for each option is unchecked.

CharCase This can be used to force all the characters entered by the user to be in upper case (ecUpperCase), lower case (ecLowerCase) or just the way the user enters them (ecNormal - the default value).

ComboItems If the Editor property value is edComboEdit or edComboList then this is the line items in the drop down box. You can modify this list during runtime by using the COMBO_ITEM command or the STRINGS() function.

ComboItemsSort If there are strings in the ComboItems property by checking this option they will be sorted when the user clicks on the drop down arrow.

DecimalChrs If the Editor property value is edNumeric then this is the number of decimal characters in the field that will be displayed for the user.

EditLength The maximum number of characters the user can enter for this column. If you have connected this to a field in your program with the FieldName property then this will be set automatically when the program runs to the size of the field.

EditMask This will control the structure of the field that can be entered. An Edit Mask Property Editor can be accessed by clicking on the button in the property field.

Editor What type of editor to use for this column if the user is going to be allowed to edit the field value. The options are: edCheckBox (displays a standard check box in the cell), edComboEdit (allow the user to either enter a value directly into the field or choose a value from the drop down box), edComboList (user may only choose a value from the drop down list, not allowed to enter directly into the field), edDateEdit (use this for date fields, has an integrated calendar), edDefault (a simple text entry editor - the is the default value), edEditBtn (put a button on the right side of the entry field - see CLICK in events below), edInteger (enter an integer value - B, I or R types), edNumeric (enter a decimal value - N type), edPassword (don't let anyone watching the screen see the entry the user is making - the password character is specified in TTASDataGrid), edSpinEdit (an up/down spin object that can be used for integer values), edTimeEdit (use this for entering time fields).

ElapsedTime If Editor property value is edTimeEdit you can check this property if you want to keep track of the number of seconds in hours:minutes:seconds.milliseconds type format. If the Editor is set to edTimeEdit and this property is not checked then the program assumes that you're entering actual time.

Fixed If you want this column to display as a fixed column in the grid then check this property. This will also make the values read-only.

FormatOnEnter If the Editor property value is edNumeric then the number will stay in display format when it is being edited.

Header The text to be displayed in the header (FixedRow) for this column.

Password This will also set the editor into password mode (see edPassword above in Editor).

ReadOnly If you don't want the user to be able to make any changes to values in this column then check this option.

SpinMax If the Editor property value is edSpinEdit then this is the maximum value the user can enter for this column.

SpinMin If the Editor property value is edSpinEdit then this is the minimum value the user can enter for this column.

SpinStep If the Editor property value is edSpinEdit then this is the amount that will be incremented/decremented each time the user clicks the up or down arrow in the column.

TimeFieldType If the Editor property value is edTimeEdit then this determines the format of the time displayed. NOTE: If the field is defined differently then the value entered here the object will default to the value entered here.

Position

Width

TAS Pro

AllowedChrs You can specify the characters that are allowed to be entered for this object. Do not separate the values with commas, for example, if you want to allow A, B and C only you would make this property: ABC. Default value is blank. This can be changed at runtime.

DfltValue This is the value that will be used as the default if, when the user accesses this field, no other value exists this will be set as the Text value. The user can then change the value if desired, or leave it alone and move to the next object. If you want to specify a value for this property it can be any string of characters. Do not include quotes. The default value is blank. This can be changed during runtime.

FieldName

HelpStatusBar

HelpStatusBarMsg

KeyTrapHint

KeyTraps

ValidCheckOnExit

ValidExpr

ValidMsg

COMMENTS

None of these properties can be changed at runtime. To do so you must use the TTASDGColTemplate and the DATA_GRID command to update an existing column in a grid.

NOTE: If you want to use an expression as the field value in a grid column, including an array specifier, you must use a DEFINEd field with a VALUE option. For example, if you want to display two fields added together as a column value you add the following to your program:

DEFINE tempFld type I size 5 value fld1+fld2

Then you would use tempFld as the FieldName in the column. When it is displayed it would execute the value expression.

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:

Change This event is called every time the user makes a change to the data of this column. That includes entering a new character, deleting a character, etc. Each time this event is executed the field that is attached to this column through the FieldName property is updated so that you can check the characters entered, modified, etc. through the field. Be cautious about using this since it will slow down the entry process.

Click This event is called if the user clicks the button on the cell (the Editor property value is edEditBtn).

Disp This event is called when the field that is attached to the column is to be refreshed on the screen. This can happen when a record is read, after a calculation, etc.

Post This event is called when the user moves from the current column to another. This will not stop the process from continuing, but can be used to make sure settings are proper after leaving the object. To force the user to stay on the current object, if there is a problem, use the Valid event instead of this.

Pre This event is called when the user moves into a column. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to access the column. If you return .False. the process will continue with the next column until one is found where the PRE event returns .True. This keeps the user from accessing an column that you don't want to be active. Commonly used in application where some fields are accessible sometimes (RET .TRUE.) and aren't others (RET .FALSE.).

The process by which these events are called is:

Pre - This occurs when focus changes to the object.

Change - During field entry.

Post - Called after Valid returns .True. (if there is a Valid event) and before the Pre for the next object.

Disp - Is called anytime the form/object is refreshed.

Click - Is called anytime the user clicks the button (edEditBtn only).


TTASEnter

Navigation: Reference > Form Objects >

TTASEnter

 Print this Topic Return to chapter overview

Use this object to enter any type A (alpha - string). There are other objects to enter numbers, dates and times. However, you can use this object to enter any value in your program.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Color

Ctl3D

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Entry

EntryBGColor

EntryFont

EntryUseDflt

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

AutoSelect If this property is checked (True) when the user activates this object, either by clicking on it, pressing the TAB key, or executing the FOCUS command, any Text that is currently displayed will be marked as selected. The user will be able to enter a new value just by typing. If the user wants to start at a certain character they will have to move the edit cursor to that character with the mouse or arrow keys. Default value is True. This can be changed at runtime.

BorderStyle

CharCase Use this property to determine what case the characters will be entered in. To force upper case use ecUpperCase, to force lower case use ecLowerCase and to allow either use ecNormal. The default value is ecNormal. This property can be modified during runtime. The values are defined in COMPILERCONSTANTS.TXT.

Constraints

EditMask This will control the structure of the field that can be entered. An Edit Mask Property Editor can be accessed by clicking on the button in the property field.

MaxLength The maximum number of characters the user can enter for this object. If you have connected this to a field in your program with the FieldName property then this will be set automatically when the program runs to the size of the field.

ParentCtl3D

PasswordChar If you want the characters the user enters (or those displayed from a field value) to be changed to a single character (generally *) enter it here. If not leave this value at the default of #0 (binary 0). This property can be modified at runtime.

ReadOnly

ReturnIsTab

SelectStart This property allows you to set the location of the cursor within the text window. The primary purpose of this property is to reset the text line within the object window. If the user exits the object and the text line is longer than the window and the beginning of the text line is hidden, you can force the text line to redisplay from the beginning by setting this property to 0.

Text This is the actual data that has been entered by the user or that comes from the field value if this is attached to a field in your program. The value can be accessed during runtime and is automatically updated if you have set the FieldName property value. The property value will also be saved automatically to the field when the user moves to the next object.

Position

AutoSize If this property is set to True (checked) the object will increase in size if the Text value is too long to be displayed and reduced in size if the Width value is too wide for the Text. Default value is True. You should change this to False (unchecked) if you want to make sure the entry field stays the same size as you designed it. This can be changed at runtime.

Height

Left

Top

Width

TAS Pro

AllowedChrs You can specify the characters that are allowed to be entered for this object. Do not separate the values with commas, for example, if you want to allow A, B and C only you would make this property: ABC. Default value is blank. This can be changed at runtime.

DfltValue This value will be inserted automatically into the field if the field is blank when the object is chosen on the form. If you want to use a constant value surround the value in quotes, e.g., 'ABC' or '100.50' etc. If you want to use a field, then just put in the field name. The default value is blank. This can be changed during runtime.

NOTE: You can't use an expression here. However, this is a perfect use of the VALUE option in the DEFINE field command. Just define a field, set the VALUE option to what ever expression you want to use, and put that field name into the DfltValue property.

FieldName

FldModified NOTE: This is a runtime only property and will not show up in the Object Inspector.

FocusOnObject

HelpStatusBar

HelpStatusBarMsg

KeyTrapHint

KeyTraps

ValidCheckOnExit

ValidExpr

ValidMsg

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:

Change This event is called every time the user makes a change to the Text of this object. That includes entering a new character, deleting a character, etc. Each time this event is executed the field that is attached to this object through the FieldName property is updated so that you can check the characters entered, modified, etc. through the field. Be cautious about using this since it will slow down the entry process.

Disp This event is called when the field that is attached to the object is to be refreshed on the screen. This can happen when a record is read, after a calculation, etc.

Post This event is called when the user moves from the current object to another. By default this event will return .True. If you return .False. This will keep the user from leaving this object. This will stop the process from continuing, This can be used to make sure settings are proper after leaving the object. To force the user to stay on the current object, if there is a problem, you may also use the Valid event instead of this.

Pre This event is called when the user moves into an object. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to access the object. If you return .False. the object that was active before they got to this object will get the focus again. This keeps the user from accessing an object that you don't want to be active. Commonly used in application where some fields are accessible sometimes (RET .TRUE.) and aren't others (RET .FALSE.).

The process by which these events are called is:

Pre - This occurs when focus changes to the object.

Change - During field entry.

Post - Called after Valid returns .True. (if there is a Valid event) and before the Pre for the next object.

Disp - Is called anytime the form/object is refreshed.


TTASForm

Navigation: Reference > Form Objects >

TTASForm

 Print this Topic Return to chapter overview

This object is created automatically when you choose the New option in the screen editor. All other objects must be placed on a TTASForm.

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Caption This is the text that is displayed at the top of the form. This property can be modified during runtime.

Color

Ctl3D

Cursor

Behavior

Enabled

Visible

Font

Font

ParentFont

Hint

Hint In the TTASForm this has a special use. It keeps track of the name of the form during the editing process. Do not change this property while editing a form.

ShowHint

Misc

HelpContext

Name NOTE: Regardless what you put in this property the form is named something different depending on when it's loaded in your program. You must use the GET_FORM_NAME() function during runtime to get the correct Name property for this form.

PopupMenu

Tag NOTE: When the form is being edited this value is set to -1. Do not change this value.

Other

ActiveControl This is the object that will have control when the form is loaded. This is generally set by the Tab Order (see Tab Order Property Editor) but you can override that and specify an object here. To get a list of the object available, click on the drop down arrow.

AlphaBlend Specifies whether the form is translucent. Set AlphaBlend to specify that the form represents a layered window that allows a translucent color. The AlphaBlendValue property specifies the degree of translucency.

NOTE: AlphaBlend does not work on all systems. The application must be running under Windows 2000 or better,and the machine must be a P90 or better.

AlphaBlendValue Specifies the degree of translucency on a translucent form. Set AlphaBlendValue to a value between 0 and 255 to indicate the degree of translucency when the AlphaBlend property is true. A value of 0 indicates a completely transparent window. A value of 255 indicates complete opacity.

NOTE: AlphaBlendValue only has an effect when the AlphaBlend property is true.

TransparentColor Specifies whether a color on the form appears transparent. Use TransparentColor to indicate that one of the colors on the form should be treated as transparent, allowing windows behind the form to completely show through. The TransparentColorValue property indicates the color that appears completely transparent.

NOTE: To make the entire form transparent, or to make it translucent rather than transparent, use the AlphaBlend and AlphaBlendValue properties.

NOTE: TransparentColor does not work on all systems. The application must be running under Windows 2000 or better, with adequate hardware.

ScreenSnap Specifies whether form snaps to edge of screen. ScreenSnap determines whether the edges of the form snap to the edge of the screen when the user moves the form. To control the snap distance, set the SnapBuffer property.

SnapBuffer Specifies distance for screen snap. If ScreenSnap is true, SnapBuffer determines the maximum number of pixels that be between the form edge and the screen edge before the form snaps to the screen edge.

Anchors

AutoResize If AutoResize is checked the user when they make the form larger or smaller will atempt to resize all the components on the screen re sizing the screen. NOTE: Because of the calculations for this are very complex and rounding ocures the user may adjust the screen so that it is unusable.

NOTE : This feature was implemented for one of our customer as a feature they wanted TASPRO to have it is our recommendation not to use this feature as we felt it was unneeded in most cases but if you just have to have re sizable form it is supported with this property.

AutoResizeMinHeight This is the minimum height that the user will be allowed to resize there form when AutoResize is checked. NOTE: this was placed here to try to protect the user from making the form unusable. If this value is set to 0 the minimum height will be set to 1/3 the original size the programmer made there form.

AutoResizeMinWidth This is the minimum width that the user will be allowed to resize there form when AutoResize is checked. NOTE: this was placed here to try to protect the user from making the screen unusable. If this value is set to 0 the minimum width will be set to 1/3 the original size the programmer made there screen.

AutoScroll If this property is checked (set to .True.) scroll bars will be displayed automatically if the size of the window is too small to accommodate all of the objects on it. The default value is checked.

BorderIcons This property controls which icons appear in the caption bar of the form. The options are: biMaximize (allow the user to maximize the size of the form at runtime), biMinimize (allow the user to minimize the size of the form at runtime) and biSystemMenu (which puts both the menu that will appear if the user clicks on the icon at the left side of the window and the X on the right side of the window). The default value is all three options are checked (set to .True.).

NOTE: If you don't check at least the biSystemMenu option you MUST give the user another way of exiting out of the form (a button, etc.). If you don't they'll be stuck and the only option will be CTRL-ALT-DEL.

BorderStyle This property determines how or if the user can resize the form and which BorderIcons are available (regardless of what you choose in the BorderIcons property). The options are: bsDialog (form cannot be resized at all and only the Close icon is displayed), bsNone (no border is displayed, the form cannot be resized, and no BorderIcons are displayed), bsSingle (a narrow border is displayed around the form, the user is not able to resize the form by stretching the sides, all of the BorderIcons chosen are displayed), bsSizeable (standard resize border, all BorderIcons are displayed, default value), bsSizeToolWin (narrow caption bar, only Close icon is displayed, user is able to resize the form by stretching the sides) and bsToolWin (only Close icon is displayed, user cannot resize form at all).

BorderWidth

ClientHeight The height of the inside portion of the form, in pixels. This is the vertical space in which you can put other objects.

ClientWidth The width of the inside portion of the form, in pixels. This is the horizontal space in which you can put other objects.

Constraints

HelpFile The name and path of the file to be used as the help file for this form. If you use the HelpContext values in objects you place on this form it will look at this file for the correct pages.

HorzScrollBar These options specify what the horizontal scroll bar will look and act like if you have checked the AutoScroll property above.

Icon This is the .ICO file image that will be used in the upper left corner of the form. The default value is the standard TAS Professional icon.

Menu You can specify which TMainMenu will be used as the Main Menu for this form by placing the name of the object here. When you put a TMainMenu object on the form its name is automatically put in this property.

VertScrollBar These options specify what the vertical scroll bar will look and act like if you have checked the AutoScroll property above

WindowState This determines how the form will appear to the user. The options are: wsNormal - The form will be displayed the same size you have designed it. wsMaximized - The form will grow to take up the entire available screen space. In this option the user will not be able to resize the form, generally used in menu type forms. wsMinimized - Will start out in minimized form at the bottom of the screen. The default is wsNormal and this property can be changed during runtime.

Position

Align

AutoSize

Height

Left

RememberSize If this is checked (True) the program will remember where the screen is, and its height and width when the screen (form) is closed. Then, the next time the specific program is run, and the screen is displayed, it will be placed in the same location with the same sizes. This can be set at runtime.

NOTE: If this property is checked in can cause problems if your program is going to use Skins.

NOTE: If you have the AutoResize checked in the object inspector this option should not be checked or used as it could cause problems with your form.

ScreenPos This property determines where on your monitor the form will be displayed when it is first loaded. The options are: tpDesigned (leave the form where you designed it), tpDesktopCenter (place the form in the center of the desk top), tpMainFormCenter (place the form in the center of the main form), tpScreenCenter (place the form in the center of your monitor).

Top

Width

TAS Pro

Modal_Result This property is not published, you won't see it in the Object Inspector when you look at the form. However, it is available during runtime through the use of the SET_OBJECT command. If the form is loaded as a modal type (the user can't do anything until the form is closed) you can accomplish that through program code by setting the value of this property to something other than 0. You can also specify the ModalResult property of a TButton.

No_Refresh This property is not published, you won't see it in the Object Inspector when you look at the form. However, it is available during runtime through the use of the SET_OBJECT command. By setting this property to .True. you will speed up your program when it's in the process of lots of calculations. Each time a calculation is completed the program attempts to update the form since something in that expression may effect one of the fields on the form. By setting this property to .True. you tell the form to ignore the update call. Since the slowest part of Windows is updating the screen you will speed up your program considerably. When you're finished, just set this property to .False. Then, the form will update as expected. The default value of this property is .False.

NOTE: If you have a WLISTF grid active and have changed the current record while the NO_REFRESH was set to .True. then you should return to that previously current record before setting NO_REFRESH to .False. If you don't the current record in the grid will change also.

OnClose This label is called just before the form closes. If you call this label you must return .True. or .False. when you return (RET) from the routine. If you return .True. the form will close as expected. If you return .False. the form will not close. This keeps the user from quitting a program before all the entries that are required have been completed. This property can be modified during runtime.

OnDisplayScreen This label is called each time the form is displayed. If it is minimized during runtime and restored this label will be called again. You can eliminate this possibility by clearing out this property during runtime. Then it will only be called once.

OnStart When a program is first run and the first form is loaded, this property is checked. If there is a value here the program will try to call that label. If there is no value in this property, the program will look for a label named START, and will call that, if it exists.

OpenFiles This label is called when the form is first loaded but before the OnStart label. This will allow you to open any files necessary so that all fields are active before any objects that link to those fields are activated.

SourceAttached If this is checked then there is source code attached directly to the screen form. A page in the source code editor will be created when this property is checked, and each time thereafter when the form is edited. Any commands that you would use in a standard program can be added to this source file. You can also test compile the source by clicking on the Compile button or pressing the F9 key. Even though the source code is not saved, the compiler will tell you if you have any problems before you load the screen at runtime. The attached source code is compiled automatically when the form is loaded and acts just like code that was compiled in advance in the program that called this form.

NOTE: If you want to use the automatic event creation process the program will check for a source file loaded through the SourceFile property below first, then will check for source code here second.

NOTE: If the code has any line labels that duplicate those in the main program, they will be overridden by the new labels. The only way you will be able to call the previous routines is with the use of the INHERITED command.

SourceFile If you enter the name of a source file here it is loaded when the screen form is loaded. This will allow you to use the automatic event creation process. If the source file is not in the same subdirectory as the form you must include the proper path.

COMMENTS

If you decide to put a TPanel on your form after other objects have already been added that you want to move to the panel, you can't just move them to the panel. You can, however, copy it (click on the object, right click and choose copy or press CTL+C) and then paste it on the panel (right click on the panel and choose Paste or CTL+V) and then delete the original object.

EVENTS

Events for a TTASForm are different than any other object. You won't know what the name is until runtime (see Name property above) so you can't use the standard events as they exist in other objects.

When TAS Professional loads a form it first tries to call the OpenFiles label, if it exists. This will make sure that any files that need to be open will be before the objects that relate to them have been activated. Next comes the OnStart or the default START label. The user still hasn't seen the form so if you need to activate a data grid or pre-load any objects you would do so here. Finally, the OnDisplayScreen label is called. This comes last since some objects cannot be accessed until the form is visible on the screen. The OnClose label isn't called until the user closes the form either by clicking on the close button or exiting the program.

NOTE: The labels do not have to be OnClose, OpenFiles, etc. They can be anything you wish as long as the correct label name is used as the property value. Also, don't add the colon (:) that would appear at the end of the label name. This needs to be used in the program only, not here.


TTASMemo

Navigation: Reference > Form Objects >

TTASMemo

 Print this Topic Return to chapter overview

Use this object to put a mini-word processor on your form. This is similar to the TMemo object, except that it's connected to a field in a data file.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Color

Ctl3D

Cursor

ParentColor

WordWrap This would normally be checked (set to .True.) so that the lines the user enters will be wrapped automatically. If you set this to .False. (unchecked) the lines will scroll to the left as the user enters characters that would stretch beyond the edge of the object.

Behavior

Enabled

TabOrder

TabStop

Visible

Entry

EntryBGColor

EntryFont

EntryUseDflt

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

BorderStyle

Constraints

Lines This a string list that contains the lines that make up the memo. When you read a record that has a memo field attached that value will show up in this object automatically. Also, when you save the record, if there is anything in this object it will be saved to the record.

MaxLength If you want to limit the number of characters that can be entered you would put that number here. If it is set to 0 there is no limit. This can be changed during runtime.

ParentCtl3D

ReadOnly

ReturnIsTab

ScrollBars You would set this option to attach scroll bars to the memo area. This will allow the user to move the memo easily if they exceed the space available. The options are: ssBoth (both vertical and horizontal scroll bars), ssHorizontal (horizontal scroll bars only), ssNone (no scroll bars, in this case the user would use up/down and left/right arrows to move around the memo if it exceeds the size available) and ssVertical (vertical scroll bars only). The default value is ssNone. If you check the WordWrap property (set to .True.) then you may not need horizontal scroll bars at all.

WantReturns If you want to allow the user to enter returns (separate sections of the memo) then this should be checked. This is the default value.

WantTabs If you want to allow the user to enter tabs then this should be checked. This is the default value.

Position

Align

Height

Left

Top

Width

TAS Pro

AllowedChrs You can specify the characters that are allowed to be entered for this object. Do not separate the values with commas, for example, if you want to allow A, B and C only you would make this property: ABC. Default value is blank. This can be changed at runtime.

DfltValue This value will be inserted automatically into the field if the field is blank when the object is chosen on the form. If you want to use a constant value surround the value in quotes, e.g., 'ABC' or '100.50' etc. If you want to use a field, then just put in the field name. The default value is blank. This can be changed during runtime.

NOTE: You can't use an expression here. However, this is a perfect use of the VALUE option in the DEFINE field command. Just define a field, set the VALUE option to what ever expression you want to use, and put that field name into the DfltValue property.

FieldName

FldModified NOTE: This is a runtime only property and will not show up in the Object Inspector.

NOTE: In the case of the TTASMemo this property works a little differently. Each time the user enters the object, the object makes a copy of what's presently there. Then, if you access this property, the stored version is compared to the current value. If it's different this property returns True, if not, it returns False. When the user enters the object the next time a copy will again be made and that will be compared when this property is checked. Also, when you check this property, if the field has been changed, and there is an attached field (FieldName above other than NONE), that field will be updated at the same time.

FocusOnObject

HelpStatusBar

HelpStatusBarMsg

KeyTrapHint

KeyTraps

ValidCheckOnExit

ValidExpr

ValidMsg

COMMENTS

NOTE: If you place a TTASMemo object on a TPanel object you will no longer be able to set the TabOrder for the TTASMemo. It will look to you like it's the only object on the TPanel, even if there are others.

NOTE: If you check the ReturnIsTab option you will not be able to enter returns in the TTASMemo regardless of your setting in WantsReturns. Each time the user presses the ENTER key the program will move to the next object in the TabOrder list.

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:

Change This event is called every time the user makes a change to the Text of this object. That includes entering a new character, deleting a character, etc. Each time this event is executed the field that is attached to this object through the FieldName property is updated so that you can check the characters entered, modified, etc. through the field. Be cautious about using this since it will slow down the entry process.

Disp This event is called when the field that is attached to the object is to be refreshed on the screen. This can happen when a record is read, after a calculation, etc.

Post This event is called when the user moves from the current object to another. By default this event will return .True. If you return .False. This will keep the user from leaving this object. This will stop the process from continuing, This can be used to make sure settings are proper after leaving the object. To force the user to stay on the current object, if there is a problem, you may also use the Valid event instead of this.

Pre This event is called when the user moves into an object. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to access the object. If you return .False. the object that was active before they got to this object will get the focus again. This keeps the user from accessing an object that you don't want to be active. Commonly used in application where some fields are accessible sometimes (RET .TRUE.) and aren't others (RET .FALSE.).

The process by which these events are called is:

Pre - This occurs when focus changes to the object.

Change - During field entry.

Post - Called after Valid returns .True. (if there is a Valid event) and before the Pre for the next object.

Disp - Is called anytime the form/object is refreshed.

See Also TMemo & TRTFMemo


TTASNavigator

Navigation: Reference > Form Objects >

TTASNavigator

 Print this Topic Return to chapter overview

This is a special object that provides the user with a group of buttons that can be accessed by the user to scroll through the records in a file, delete a record, save a changed record or refresh a record from the file even after changes have been made. Use the Navigator command to link this object to a file and key. This is required before this command will have any effect.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Ctl3D

Cursor

Flat If this is checked (set to .True.) the emphasis around the buttons is removed making the buttons look 'flatter.' The default value is not checked. This property can be modified at runtime.

Behavior

Enabled

TabOrder

TabStop

Visible

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

AfterActionFocus When the user clicks on one of the Navigator buttons they could be on any object. If you want to make sure they always return to a specific object after any action; record change, save, delete, cancel, etc., then the name of that object should be entered here. To accomplish this you would click on the drop down arrow in the property entry box and choose an object from the list provided. The object you want to set active must be on the screen form before it can be specified here.

Anchors

ClearRecOnSave If this is checked (set to .True.) and the user clicks on the save button then the record buffer will be cleared after the record is saved. If it's not checked (set to .False.) then the record buffer will not be cleared. This property can be modified during runtime.

ConfirmDelete If this is checked (set to .True.) the message entered in the ConfirmDeleteMsg property below will be displayed if the user clicks on the delete button. If the user clicks the No button the record will not be deleted. This property can be modified during runtime. Also see the Delete event below for other options.

ConfirmDeleteMsg If ConfirmDelete above is checked (set to .True.) then this is the message that will be displayed when the user clicks on the delete button.

ConfirmSave If this is checked (set to .True.) the message entered in the ConformSaveMsg property below will be displayed if the user clicks on the save button. If the user clicks the No button the record will not be saved. This property can be modified during runtime. Also see the Save event below for other options.

ConfirmSaveMsg If ConfirmSave above is checked (set to .True.) then this is the message that will be displayed when the user clicks on the delete button.

Constraints

Hints This is a list of strings that will be displayed as the hints for the buttons. They are in the same order as the buttons. This property can be modified using the STRINGS() function.

ParentCtl3D

VisibleButtons This property determines which of the buttons will be displayed on the navigator bar. To make the button visible check the appropriate property. In design mode the navigator bar will change when you check or uncheck the appropriate button.

Position

Align

Height

Left

Top

Width

TAS Pro

AttachGrid If you have a TTASDataGrid on the form you can attach this TTASNavigator to that grid by entering the name of that grid here. The easy way to do this is by clicking on the down arrow and choosing the appropriate grid. The grid must be on the form before this will work. If you utilize this option, and the grid is a WLISTF type, then you don't have to set the File Number or Key for this object (see Navigator command). It will be done automatically by the grid.

NOTE: For an example of this see WTASDATAM. The main form (WTASDATAM.DFM) has a TTASNavigator attached to the TTASDataGrid.

ClickBtn This property doesn't show up in the Object Inspector during design mode since it's a write only property. It cannot be read from. The way to use it is to set the property equal to a value which represents one of the buttons displayed on the navigator bar. This will have the same effect as if the user had clicked the button directly. So, for example, if you want the Save button to be clicked at a certain point, perhaps after the user exits a field, you would include something like this:

'@navName.ClickBtn' = nbPost

nbPost is a constant defined in CompilerConstants.txt and represents the Save button.

What's the benefit of this? You can have a single routine that handles the saves for the program and access it in two different ways, if the user clicks on the save (post) button or if they reach the end of the possible inputs.

This property can also be updated using the command SET_OBJECT or the function SET_OBJ_PROP().

StdKeyTraps If this is checked (set to .True.) the user will be able to use the standard TAS fkeys to access records controlled by this TTASNavigator. F5 - First record, F6 - Last record, F7 - Previous record, F8 - Next record, F3 - Clear record buffer, F4 - Delete record, F10 - Save record and F12 - Edit record. If you have the ShowHint property above checked the program will add the Fx value to the end of the current hint for that button. For example, if you have Delete record as the hint for delete then it will be displayed as Delete record (F4).

NOTE: This property cannot be changed during runtime. It is setup when the form is loaded.

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:

AfterChange This event is called every time the user clicks the First, Next, Last or Prior button after the record is found. This is different from the Change event that is called before the record is found.

Cancel This event is called when the user clicks the Cancel button. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the record buffer will be cleared. If you return .False. the current record will remain. If there are other files you wish to clear also you would use this event to do so in your program code.

Change This event is called every time the user clicks the First, Next, Last or Prior button. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the appropriate record will be found and displayed. If you return .False. the current record will remain. If you want to call an event after the record is found see the AfterChange event above.

Delete This event is called every time the user clicks the Delete button. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the record will be deleted. If you return .False. the current record will remain. NOTE: If you have checked ConfirmDelete this event will be called only if the user answers Yes to that confirmation message first.

Edit This event is called every time the user clicks the Edit button. If there is a record active and it can be locked, then the event routine will be called. NOTE: Once in edit mode the edit button will be disabled (turn off) until the record is cleared or it is unlocked.

Refresh This event is called when the user clicks the Refresh button. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the current record will be read fresh from disk and any changes will be lost. If you return .False. the current record will remain.

Save This event is called every time the user clicks the Save button. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the record will be save. If you return .False. the record will not be updated. NOTE: If you have checked ConfirmSave this event will be called only if the user answers Yes to that confirmation message first.


TTASNumEnter

Navigation: Reference > Form Objects >

TTASNumEnter

 Print this Topic Return to chapter overview

Use this object to enter any numeric (N, B, I or R) type field. There are other objects to enter strings, dates and times.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Color

Ctl3D

Cursor

Glyph If you have chosen a custom glyph in GlyphKind below this is where you would choose the .bmp file that would be used instead of the standard ones that come with this object.

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Entry

EntryBGColor

EntryFont

EntryUseDflt

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

AutoSelect If this property is checked (True) when the user activates this object, either by clicking on it, pressing the TAB key, or executing the FOCUS command, any Text that is currently displayed will be marked as selected. The user will be able to enter a new value just by typing. If the user wants to start at a certain character they will have to move the edit cursor to that character with the mouse or arrow keys. Default value is True. This can be changed at runtime.

BorderStyle

ButtonHint This is the hint that will be displayed to the user when they hover over the button. This can be changed at runtime.

ButtonWidthNum The size of the button in pixels. Defaults to 0. This can be changed at runtime. If you want to make the button appear in the object you must set this value to something more than 0. In general, this should be 20 or 21 to properly display the button.

ClickKey Choose the key stroke the user can use to have the same effect as clicking the button. This would be in addition to clicking the button. The default value is Alt+Down (alt key + down arrow).

Constraints

DecimalPlaces This is the number of decimal characters that are allowed for this field. This can be from 0 to 8 and should match, if it exists, the DisplayFormat property. This property can be modified at runtime.

DirectInput If this is clicked (set to .True.), the user will be able to enter the text directly. If this is not clicked (set to .False.) the only way they will be able to set the text value is to click the button and have the routine that is called set the Text value. The default is checked. This can be changed during runtime.

DisplayFormat This will control how the number is displayed to the user. The default value is $,0.00;-$,0.00. The effect of this is to force two decimal characters, use a comma (,) to separate thousands, etc, use a period as a decimal character, preface the field with a dollar sign and, if it's a negative number, put the minus sign in front of the dollar sign. Make sure the number of decimal characters match what you have in DecimalPlaces. If this is blank there will be no formatting. This property can be modified at runtime.

FormatOnEditing Generally in Windows numeric entries the value is moved to the left (left justified) and all formatting is removed when the user makes changes. If you check this property (set to True) the number will remain right justified and the formatting will remain while the user edits the numbers. The default value is checked (True) and can be modified during runtime.

NOTE: If you check this option you must not use the .CHANGE event also. If you do, the entry will not work properly.

GlyphKind This will determine what appears on the button in this object. The options are: gkCustom (this will use what ever you have chosen in the Glyph property above), gkDefault (the default value, displays a blank button), gkDropDown (a standard drop down arrow glyph), gkEllipsis (a standard ellipsis glyph).

MaxLength The maximum number of characters the user can enter for this object. If you have connected this to a field in your program with the FieldName property then this will be set automatically when the program runs to the size of the field.

MaxValue You can specify the maximum value that can be entered into this object by putting that value here. This is similar to using the Valid event except that you don't need any other code. The default value is 0 which means no checking. This can be changed during runtime.

MinValue You can specify the minimum value that can be entered into this object by putting that value here. This is similar to using the Valid event except that you don't need any other code. The default value is 0 which means no checking. This can be changed during runtime.

NumGlyphs If you have two glyphs that can be displayed, one normally, and the second when the user clicks the button, then this would be two. The default value is one.

ParentCtl3D

ReadOnly

ReturnIsTab

Text In this object this property is not relied upon. Instead the program uses the Value property.

Value The numeric value of the entry. This strips all formatting characters and all that's left is just the actual number.

ZeroEmpty If this is checked (True) and the Value property is 0 then the entry field will be blank when the user sets the focus to this object.

Position

AutoSize If this property is set to True (checked) the object will increase in size if the Text value is too long to be displayed and reduced in size if the Width value is too wide for the Text. Default value is True. You should change this to False (unchecked) if you want to make sure the entry field stays the same size as you designed it. This can be changed at runtime.

Height

Left

Top

Width

TAS Pro

DfltValue This value will be inserted automatically into the field if the field is blank when the object is chosen on the form. If you want to use a constant value surround the value in quotes, e.g., '100.50' etc. If you want to use a field, then just put in the field name. The default value is blank. This can be changed during runtime.

NOTE: You can't use an expression here. However, this is a perfect use of the VALUE option in the DEFINE field command. Just define a field, set the VALUE option to what ever expression you want to use, and put that field name into the DfltValue property.

FastSearchType If you are using this object as a FastSearch field in connection with a TTASDataGrid you need to specify the type of numeric field. This would match the index type you're searching on. So, if the index is a type N you would set this to fsNum. If the index is a type R, this should be fsRec. The options are fsByte (type B), fsInt (type I), fsRec (type R) and fsNum (type N). This can be changed at runtime.

FieldName

FldModified NOTE: This is a runtime only property and will not show up in the Object Inspector.

FocusOnObject

HelpStatusBar

HelpStatusBarMsg

KeyTrapHint

KeyTraps

ValidCheckOnExit

ValidExpr

ValidMsg

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:

Change This event is called every time the user makes a change to the Text of this object. That includes entering a new character, deleting a character, etc. Each time this event is executed the field that is attached to this object through the FieldName property is updated so that you can check the characters entered, modified, etc. through the field. Be cautious about using this since it will slow down the entry process.

Click This event is called if the user clicks the button on the object.

Disp This event is called when the field that is attached to the object is to be refreshed on the screen. This can happen when a record is read, after a calculation, etc.

Post This event is called when the user moves from the current object to another. By default this event will return .True. If you return .False. This will keep the user from leaving this object. This will stop the process from continuing, This can be used to make sure settings are proper after leaving the object. To force the user to stay on the current object, if there is a problem, you may also use the Valid event instead of this.

Pre This event is called when the user moves into an object. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to access the object. If you return .False. the object that was active before they got to this object will get the focus again. This keeps the user from accessing an object that you don't want to be active. Commonly used in application where some fields are accessible sometimes (RET .TRUE.) and aren't others (RET .FALSE.).

The process by which these events are called is:

Pre - This occurs when focus changes to the object.

Change - During field entry.

Post - Called after Valid returns .True. (if there is a Valid event) and before the Pre for the next object.

Disp - Is called anytime the form/object is refreshed.


TTASPageControl

Navigation: Reference > Form Objects >

TTASPageControl

 Print this Topic Return to chapter overview

This can be used to create a standard multi-page notebook on your form. You can place objects (including another TTASPageControl) in the panel below the tabs and the objects will be seen only when the user chooses the appropriate tab.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Cursor

Behavior

Enabled

TabOrder

TabStop

Visible

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

Constraints

HotTrack If this is checked (set to .True.) the tab will highlight when the user passes the mouse over the tab. This can be modified at runtime.

Images If you want to use graphic images in the tabs you need to put a TImageList object on the form and load the images in that object. Then choose that object here. In each of the TTabSheet objects you would choose the appropriate image number.

MutliLine If you want to allow multiple lines of tabs then check this property. The default value is unchecked.

PageIndex The index number of the active tab page. By changing this value at runtime you can force a page to be active.

PageName The object name of the TTabSheet that is currently active. This can be modified at runtime.

RaggedRight If there are multiple lines the tabs will, by default, grow to fill the width of the object. If you don't want that to occur then check (set to .True.) this property. This can be modified during runtime.

ScrollOpposite If there are multiple lines, when the user clicks on a tab that is not in the active line, the active line will switch with that tab line. Normally, this will put the active line immediately above the object panel. However, if you check this property (set to .True.) the active line will do the reverse, it will be placed at the top of all other tab lines.

Style This property controls what the tabs will look like. The default value is tsTabs, the standard tab appearance. The other options are tsButtons (use buttons instead of tabs) and tsFlatButtons (the tabs appear flat with dividers between them).

TabHeight This is the height of the tab in pixels. The default value is 0 which means the object will use the size required for the font. This can be modified during runtime.

TabPosition If you have specified tsTabs in Style you can choose where the tabs should appear. The options are: tpBottom (under the object panel), tpLeft (left side of panel), tpRight (right side of panel) and tpTop (the top of the panel - the default value).

TabWidth This is the width of the tab in pixels. The default value is 0 which means the object will use the size required for the font and the length of the text. This can be modified during runtime.

Position

Align

Height

Left

Top

Width

EVENTS

This object has a single event that is called if your user changes from one tab to another. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Change). The full event name would be ObjectName.Change:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks the page tab, if the event label exists the routine is called, you can check what the new active page is. If you don't want the user to access that page all you have to do is set the PageIndex or PageName property. You return from the routine, and the user has control again.

Example

This code below in a post event

// this set the page to display in the TTASPageControl and set focus to a tas enter object.

myevent.click: or myevent.post:

set_object 'page' property 'tabindex' value 0

set_focus 'compname'

ret

To use the change event in the TTASPageControl

objectname.change:

// Do something

ret


TTASRadioButton

Navigation: Reference > Form Objects >

TTASRadioButton

 Print this Topic Return to chapter overview

Use this object to replace a standard Y/N question. If the user checks the box the value returned to the field attached to the object will be Y, if unchecked, it will return N. You can also make the attached field a type L (logical). In that case the object will return .True. (clicked) or .False. (unclicked) as would be expected. The major difference between this object and the TTASCheckBox is in usage. Generally, you would put two or more TTASRadioButton objects on a TGroupBox. The group box allows only one radio button to be chosen at a time. Using this, you can give the user multiple choices with the knowledge that they can only choose one.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Alignment

Caption This is the text that is displayed on the left or the right of the radio button depending on the value in Alignment.

Color

Ctl3D

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Entry

EntryBGColor

EntryFont

EntryUseDflt

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

Checked If the button is chosen this property will return .True. You can also preset the radio button by setting this value.

Constraints

ParentCtl3D

ReturnIsTab

Position

Height

Left

Top

Width

TAS Pro

DfltValue If you want to set the radio button use Y or N here. The default value is N. This can be changed during runtime.

FieldName NOTE: if you use get_obj_prop() you must have a field name here if blank use can use. "NONE".

NOTE : Also Pre post events will not fire without a FieldName or the word NONE here. (for both Pre and Post events) You must have a field name here, or if blank you can use "NONE"

FldModified NOTE: This is a runtime only property and will not show up in the Object Inspector.

FocusOnObject

HelpStatusBar

HelpStatusBarMsg

ValidMsg

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Click event below would be: ObjectName.Click:

Change This event is called every time the user clicks the button in this object. That includes entering a new character, deleting a character, etc. Each time this event is executed the field that is attached to this object through the FieldName property is updated so that you can check the new state through the field. Be cautious about using this since it will slow down the entry process.

Click This event is called if the user clicks on the object.

Disp This event is called when the field that is attached to the object is to be refreshed on the screen. This can happen when a record is read, after a calculation, etc.

Post This event is called when the user moves from the current object to another. By default this event will return .True. If you return .False. This will keep the user from leaving this object. This will stop the process from continuing, This can be used to make sure settings are proper after leaving the object. To force the user to stay on the current object, if there is a problem, you may also use the Valid event instead of this.

Pre This event is called when the user moves into an object. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to access the object. If you return .False. the object that was active before they got to this object will get the focus again. This keeps the user from accessing an object that you don't want to be active. Commonly used in application where some fields are accessible sometimes (RET .TRUE.) and aren't others (RET .FALSE.).

The process by which these events are called is:

Pre - This occurs when focus changes to the object.

Change - During field entry.

Post - Called after Valid returns .True. (if there is a Valid event) and before the Pre for the next object.

Disp - Is called anytime the form/object is refreshed.

NOTE : Also Pre post events will not fire without a FieldName or the word NONE here. (for both Pre and Post events) You must have a field name here, or if blank you can use "NONE"


TTASStrList

Navigation: Reference > Form Objects >

TTASStrList

 Print this Topic Return to chapter overview

This is a non-visible object. This object can be used specifically to create a string list. To manipulate the list you can either use the appropriate property editor (see below) or the Strings() function.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Misc

Name

Tag

Other

Lines This is the actual string list. You can create/edit this list during design by clicking on the button in the property field. This will bring up the standard Strings Property Editor. In general, though, you will probably manipulate this list during runtime using the Strings() function.

EVENTS

There are no events for non-visible objects.


TTASTreeView

Navigation: Reference > Form Objects >

TTASTreeView

 Print this Topic Return to chapter overview

TTASTreeView

This object is similar to the TTASDataGrid

This will display a list field values on the form in a certain order in columns. add new elements to the end of the List, and, through the use of the TreeView command.

The icon for this object is on the Zip & Other page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Color

Cursor

Ctl3D

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

List

Items

Are of type TTreeNode which has the

Text,stateindex, Selectindex and ImageIndex..

MultiSelect

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

AutoExpand

BevelEdges Were are the Bevels
BevelInner type of Bevel

BevelKind Kind of Bevel

BevelOuter type of Bevel

BevelWidth

BorderStyle Style of Border

BorderWidth

ChangeDelay Default 0

Constraints

HelpKeyword

HelpType

HotTrack

HotTrackColor

Icon

ImageList

MultiSelectStyle

ParentCtl3d

Readonly

RightClickSelect

RowSelect

ShowButtons

ShowLines

ShowRoot

SortType

StateImages

ToolTips

Position

Align

Height

Left

Top

Width

COMMENTS

EVENTS

This object has a single event that is called if your user clicks on the object. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks on the object, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: This uses a Special Field in when Initialized to return the Position Selected (See WTREE)

Example see


TTasTreeTreenodeTemplate

Navigation: Reference > Form Objects >

TTasTreeTreenodeTemplate

 Print this Topic Return to chapter overview

This object is similar to the TTASDGColTemplate

This will display a list field values on the form in a certain order in columns. add new elements to the end of the List, and, through the use of the TreeView wtree command.

The icon for this object is on the Zip & Other page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Misc

Name

Tag

Other

ImageIndex

Level

SelectedIndex

StateIndex

Text

This is to be used with the Wtree command with that Add option. Like the TASDGColTemplate.


TTASTimeEdit

Navigation: Reference > Form Objects >

TTASTimeEdit

 Print this Topic Return to chapter overview

Use this object to enter/edit time values. You can also include a check box as part of this object.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Color

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Entry

EntryBGColor

EntryFont

EntryUseDflt

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

Checked If the box is checked this property will return .True. You can also preset the checkbox by setting this value. NOTE: This value is not automatically returned in any field. You must access this value using the GET_OBJ_PROP() function.

Constraints

ParentCtl3D

ReturnIsTab

ShowCheckbox If you want to include a check box in the object then check this option (set to .True.).

Time This is the time value that is currently displayed in the object. This is a T (time) type value.

Position

Height

Left

Top

Width

TAS Pro

DfltValue This value will be inserted automatically into the field if the field is blank when the object is chosen on the form. If you want to use a constant value surround the value in quotes, e.g., '10:15:00' etc. If you want to use a field, then just put in the field name. The default value is blank. This can be changed during runtime.

NOTE: You can't use an expression here. However, this is a perfect use of the VALUE option in the DEFINE field command. Just define a field, set the VALUE option to what ever expression you want to use, and put that field name into the DfltValue property.

FieldName

FldModified NOTE: This is a runtime only property and will not show up in the Object Inspector.

FocusOnObject

HelpStatusBar

HelpStatusBarMsg

KeyTrapHint

KeyTraps

ValidCheckOnExit

ValidExpr

ValidMsg

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:

Change This event is called every time the user makes a change to the time of this object. That includes entering a new character, deleting a character, etc. Each time this event is executed the field that is attached to this object through the FieldName property is updated so that you can check the new time through the field. Be cautious about using this since it will slow down the entry process.

Disp This event is called when the field that is attached to the object is to be refreshed on the screen. This can happen when a record is read, after a calculation, etc.

Post This event is called when the user moves from the current object to another. By default this event will return .True. If you return .False. This will keep the user from leaving this object. This will stop the process from continuing, This can be used to make sure settings are proper after leaving the object. To force the user to stay on the current object, if there is a problem, you may also use the Valid event instead of this.

Pre This event is called when the user moves into an object. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to access the object. If you return .False. the object that was active before they got to this object will get the focus again. This keeps the user from accessing an object that you don't want to be active. Commonly used in application where some fields are accessible sometimes (RET .TRUE.) and aren't others (RET .FALSE.).

The process by which these events are called is:

Pre - This occurs when focus changes to the object.

Change - During field entry.

Post - Called after Valid returns .True. (if there is a Valid event) and before the Pre for the next object.

Disp - Is called anytime the form/object is refreshed.


TTASTimeEnter

Navigation: Reference > Form Objects >

TTASTimeEnter

 Print this Topic Return to chapter overview

Use this object to enter/edit time or elapsed time values.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Color

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Entry

EntryBGColor

EntryFont

EntryUseDflt

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

AutoSelect If this property is checked (True) when the user activates this object, either by clicking on it, pressing the TAB key, or executing the FOCUS command, any Text that is currently displayed will be marked as selected. The user will be able to enter a new value just by typing. If the user wants to start at a certain character they will have to move the edit cursor to that character with the mouse or arrow keys. Default value is True. This can be changed at runtime.

BorderStyle

Constraints

ElapsedTime You can check this property if you want to keep track of the number of seconds in hours:minutes:seconds.milliseconds type format. If this property is not checked then the program assumes that you're entering actual time.

ParentCtl3D

ReadOnly

ReturnIsTab

TimeFieldType This determines the format of the time displayed. NOTE: If the field is defined differently then the value entered here the object will default to the size of the field.

Position

Height

Left

Top

Width

TAS Pro

DfltValue This value will be inserted automatically into the field if the field is blank when the object is chosen on the form. If you want to use a constant value surround the value in quotes, e.g., '10:15:00' etc. If you want to use a field, then just put in the field name. The default value is blank. This can be changed during runtime.

NOTE: You can't use an expression here. However, this is a perfect use of the VALUE option in the DEFINE field command. Just define a field, set the VALUE option to what ever expression you want to use, and put that field name into the DfltValue property.

FieldName

FldModified NOTE: This is a runtime only property and will not show up in the Object Inspector.

FocusOnObject

HelpStatusBar

HelpStatusBarMsg

KeyTrapHint

KeyTraps

ValidCheckOnExit

ValidExpr

ValidMsg

COMMENTS

You can change the values that display for AM and PM in the Setup program.

During runtime, the user changes from AM to PM by pressing the space bar.

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:

Change This event is called every time the user makes a change to the time of this object. That includes entering a new character, deleting a character, etc. Each time this event is executed the field that is attached to this object through the FieldName property is updated so that you can check the new time through the field. Be cautious about using this since it will slow down the entry process.

Disp This event is called when the field that is attached to the object is to be refreshed on the screen. This can happen when a record is read, after a calculation, etc.

Post This event is called when the user moves from the current object to another. By default this event will return .True. If you return .False. This will keep the user from leaving this object. This will stop the process from continuing, This can be used to make sure settings are proper after leaving the object. To force the user to stay on the current object, if there is a problem, you may also use the Valid event instead of this.
Pre This event is called when the user moves into an object. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to access the object. If you return .False. the object that was active before they got to this object will get the focus again. This keeps the user from accessing an object that you don't want to be active. Commonly used in application where some fields are accessible sometimes (RET .TRUE.) and aren't others (RET .FALSE.).

The process by which these events are called is:

Pre - This occurs when focus changes to the object.

Change - During field entry.

Post - Called after Valid returns .True. (if there is a Valid event) and before the Pre for the next object.

Disp - Is called anytime the form/object is refreshed.


TTASXPBar

Navigation: Reference > Form Objects >

TTASXPBar

 Print this Topic Return to chapter overview

This object is similar to the Tmainmenu and the Tpanel in that it can hold other objects but it has other uses also. The types of styles available are the Look and Feel of an XP/Office style bar and it 'owns' the objects placed on it. This means that if you set the Visible property of the XpBar to .False. all object that are on the panel, automatically become invisible also. The same applies to the Enabled property.

The icon for this object is on the Zip & Other page.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Appearance

Color

Cursor

ParentColor

Behavior

Enabled

TabOrder

TabStop

Visible

Entry

EntryBGColor

EntryFont

EntryUseDflt

Font

Font

ParentFont

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

List

Items These are the TXPBarItems that make up the list. This is what the user will actually see. To create new items or edit/delete existing ones you can either click on the button in the property field or, right click on the TXPBar object and choose the Item Designer option.

EVENTS

Events are XPBAR.Click and Itemsname.click

This object has two events that is called if your user clicks on the object. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click: You would not return a value from the program, just a simple RET is all that is required. So, the user clicks on the object, if the event label exists the routine is called, you return from the routine, and the user has control again.

NOTE: You can have multiple objects call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:

btnFirstButton.click:

btnSecondButton.click:

//event routine code would go here.

ret

The labels are not part of the code executed. They are just place keepers and tell the program where to go.

Example

TASXPBar1.Click:
msg 'bar'
Ret

One.click:
msg 'one'
ret

mytwo.click:
msg 'two'
ret


TTASWEB

Navigation: Reference > Form Objects >

TTASWEB

 Print this Topic Return to chapter overview

Use this object to Access any WEB Page. This object will work with any HTML Page weather it is on a local computer or the internet. And should react the same way as your currently installed version of Microsoft internet explorer.

PALETTE ICON & EXAMPLE

Appearance

Cursor

Behavior

Enabled

TabOrder

TabStop

Visible

Hint

Hint

ParentShowHint

ShowHint

Misc

HelpContext

Name

PopupMenu

Tag

Other

Anchors

FullScreen Will make the object Full screen

GotoURL This is a Runtime only parameter to change the current URL

Helpkeyword keyword for help

Helptype how to search for keyword

Offline If object is in Online of Offline modes

Sethome this the home URL (Defaults to CASSOFTWARE.com)

TheaterMode A type of Full screen mode

URLDirection – A Runtime only Paramiter:

WEBGOHome - Take you to the home URL

WEBGOBack - Take you back to the Last URL

WEBGOForward – Take you to the Previous URL (Only after using the WEBGOBack)

WEBGO - Take you to your GOTOURL

WEBSTOP - Stop the processing of the URL

WEBREFREASH – refreshes the object.

Note : Use the UrlDirection in your code with the set_object Command when set this will fire the object to do the above behaviours.

UserAgent User agent Signature.

Position

Height

Left

Top

Width

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:

There are no Events at this time.


TTASzip

Navigation: Reference > Form Objects >

TTASzip

 Print this Topic Return to chapter overview

Use this object to compress files using Zip Compression. This object will work with any standard Zip file. This is a non visual object.

PALETTE ICON & EXAMPLE

Misc

Name

Tag

Other

AddToZipFile (This is a Runtime only) This is where you add the files you Want to compress (Does except Wildcards) (does the compressing when you access the field)

AutoSave Controls whether changes to the archive are performed immediately.

BaseDirectory Supplies the default path for add and extract operations on the archive. Note: BaseDirectory is not necessarily the same as the directory of the archive.

CompressionMethodtoUse Selects the compression method used when adding items in the archive.

Deflation Option Selects the compression method used when adding or freshening items in the archive.

DOSMode Forces all new files stored in an archive to have DOS-compatible file names.

ErrClass Type of Error (IE IO Error)

ErrCode numeric error Code

ErrItem Item the Error happen

ErrType What process was happening (IE Add or Extract)

FileName Name of Zip file

LogFile Name of Log file it Login is on

Logging Create a log file by Logname

Password Adds a Passwords you Compressed files.

SpanningTheshold Specifies the maximum archive image size.

StoreOptions Determines the options for archive add operations.

TempDirectory Specifies a temporary directory to use during archive operations.

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:

There are no Events at this time.

Error Types:

Error type 'ADD'; 'DELETE'; 'EXTRACT'; 'FRESHEN'; 'MOVE';

Error Class 'INTERNAL'; 'I/0 Error';'FILER ERROR'; 'FILE CREATE ERROR'; 'OPEN ERROR';'UNKNOWN';


TTASUnZip

Navigation: Reference > Form Objects >

TTASUnZip

 Print this Topic Return to chapter overview

Use this object to used decompress files that used Zip Compression . This object will work with any standard Zip file.

PALETTE ICON & EXAMPLE

Misc

Name

Tag

Other

ExtractFromZip (This is a Runtime only) This is where you add the files you want to uncompress

( Does except Wildcards) (does the compressing when you access the field)

BaseDirectory Supplies the default path for add and extract operations on the archive.

Note: BaseDirectory is not necessarily the same as the directory of the archive.

ErrClass Type of Error (IE IO Error)

ErrCode numeric error Code

ErrItem Item the Error happen

ErrType What process was happening (IE Add or Extract)

FileName Name of Zip file

LogFile Name of Log file it Login is on

Logging Create a log file by Logname
Password Adds a Passwords you Compressed files.

PasswordRetries Specifies the maximum number of passwords to try when attempting to extract an encrypted file.

ExtractOptions Determines the options for Extracting operations.

TempDirectory Specifies a temporary directory to use during archive operations.

EVENTS

This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:

There are no Events at this time.

Error Types:

Error type 'ADD'; 'DELETE'; 'EXTRACT'; 'FRESHEN'; 'MOVE';

Error Class 'INTERNAL'; 'I/0 Error';'FILER ERROR'; 'FILE CREATE ERROR'; 'OPEN ERROR';'UNKNOWN';


General Information

Navigation: Reference > Form Objects > Common Properties >

General Information: Form Objects->Common Properties

 Print this Topic Return to chapter overview

The common properties are listed in alphabetical order.

A short paragraph is given describing the property, why that property exists, and the possible values that can be set. There are some properties that have multiple settings or subproperties and those are explained also. Whether the property can be modified at runtime or only at design time is also specified.

Links back to these descriptions is provided for each object where the property applies.


Align

Navigation: Reference > Form Objects > Common Properties >

Align

 Print this Topic Return to chapter overview

This property is used in objects that can change size to fill a certain area. By setting this value you can have the object automatically grow or shrink as the form size is changed. The options are:

alBottom Attach the object to the bottom of the form and fill from left to right side. The only change you can make is in height.

alClient Takes up the entire form. You can't make any changes in size other than changing the size of the underlying form.

alLeft Attach the object to the left side of the form and fill from top to bottom. The only change you can make is in width.

alNone Doesn't attach to any side, doesn't change the size of the object. This is the default value.

alRight Attach the object to the right side of the form and fill from top to bottom. The only change you can make is in width.

alTop Attach the object to the top of the form and fill from left to right side. The only change you can make is in height.

This is similar to using the Anchors property except the object will fill a section of the form. You can also 'stack' objects that have this property. For example, you can put a TPanel at the bottom of the form using the alBottom option, then put another TPanel on top of that, again using the alBottom option. The second TPanel will not cover-up the first one you created.


Alignment

Navigation: Reference > Form Objects > Common Properties >

Alignment

 Print this Topic Return to chapter overview

Use this property to determine where the text in this object will be displayed. The options are: taRightJustify (move text to the right side of the object), taLeftJustify (move text to the left side of the object) and taCenter (center the text in the object).

This property can be modified during runtime. The values are defined in COMPILERCONSTANTS.TXT.


Anchors

Navigation: Reference > Form Objects > Common Properties >

Anchors

 Print this Topic Return to chapter overview

This property is used to literally anchor the object to a position on the form so that if the user changes the size of the form the object will either stay where it is or move with the appropriate side or top/bottom. This is a multi part property. There are four possible values that can be set to TRUE or FALSE. If you set all four options to TRUE for a single object, it will grow if the user makes the form larger and shrink if the form gets smaller. The four possible values are:

akLeft - True or False - If this is set to True the object will stay at the same position relative to the left side of the form.

akTop - True or False - If this is set to True the object will stay at the same position relative to the top of the form.

akRight - True or False - If this is set to True the object will stay at the same position relative to the right side of the form.

akBottom - True or False - If this is set to True the object will stay at the same position relative to the bottom of the form.

The default value for this property is akLeft and akTop are set to True and akRight and akBottom or set to False. This means the object will stay in the same position relative to the top left corner of the form, and, if the form gets larger, there may be more empty space to the right or bottom. If you want the object to grow with the form (or shrink) set all four properties to True. If you want the object to anchor itself to the right side, or right side bottom of the form, set akLeft and akTop to False, and akRight and akBottom to True.

Once you have set the anchors you can see what the results will be by enlarging/shrinking the size of the form during design.

This property cannot be modified during runtime.

Also see Constraints for an additional property that can effect size during runtime.


AutoSize

Navigation: Reference > Form Objects > Common Properties >

AutoSize

 Print this Topic Return to chapter overview

If this is checked (set to .True.) the object will resize itself automatically if the objects or text, that are a part of it, grow too large for the current image size. In the case of TLabel the object will change both length and height. In the case of TTASxxx entry objects, the object will change height only.

NOTE: If this property is checked in can cause problems if your program is going to use Skins.

NOTE: If you have the AutoResize checked in the object inspector this option should not be checked or used as it could cause problems with your form.


BevelEdges

Navigation: Reference > Form Objects > Common Properties >

BevelEdges

 Print this Topic Return to chapter overview

BevelEdges

Used to get or set which edges of the control are beveled. The BevelInner, BevelOuter, and BevelKind properties determine the appearance of the specified edges.

BevelInner

Used to specify whether the inner bevel has a raised, lowered, or flat look.

BevelKind

Used to modify the appearance of a bevel. BevelKind influences how sharply the bevel stands out.

BevelInner

Used to specify whether the outer bevel has a raised, lowered, or flat look.

BevelWidth

Used to specify the width, in pixels, of the inner and outer bevels.


BorderStyle

Navigation: Reference > Form Objects > Common Properties >

BorderStyle

 Print this Topic Return to chapter overview

Use this property to draw the object on the form with a border (bsSingle) or without (bsNone).

This property can be modified during runtime. The values are defined in COMPILERCONSTANTS.TXT.


BorderWidth

Navigation: Reference > Form Objects > Common Properties >

BorderWidth

 Print this Topic Return to chapter overview

The size of the border of the tool bar in pixels. This acts as an offset to the edge of the object in that no objects or text can be placed on this object any closer to the edge than this value. This property can be modified during runtime.


Color

Navigation: Reference > Form Objects > Common Properties >

Color

 Print this Topic Return to chapter overview

If ParentColor is set to False (not checked) then the object will use the value in this property as the background. To effect the color of the text displayed in the object you have to change the color option in the Font property.


Constraints

Navigation: Reference > Form Objects > Common Properties >

Constraints

 Print this Topic Return to chapter overview

These work in conjunction with the Anchors property and restrict the maximum or minimum sizes of the object. The four possible values are:

MaxHeight - integer - The maximum height the object can be stretched to.

MaxWidth - integer - The maximum width the object can be stretched to.

MinHeight - integer - The minimum height the object can be shrunk to.

MinWidth - integer - The minimum width the object can be shrunk to.

The default values for each option is 0, which means there is no minimum or maximum value.

These values can be set during design or runtime. If you want to change them in your program you would refer to the property value as: 'Constraints.MaxHeight' or 'Constraints.MaxWidth', etc.


Ctl3D

Navigation: Reference > Form Objects > Common Properties >

Ctl3D

 Print this Topic Return to chapter overview

If this property is checked then the object is made to look 3 dimensional. If this is not checked then it will appear to be 'flat.' This value will be overridden by the ParentCtl3D if that is checked (True).

This property can be changed at runtime.


Cursor

Navigation: Reference > Form Objects > Common Properties >

Cursor

 Print this Topic Return to chapter overview

This property allows you to change the shape of the cursor as the user passes the mouse over the object at runtime. The default value is crDefault which is generally an arrow. The options are: crDefault, crNone, crArrow, crCross, crIBeam, crSizeNESW, crSizeNS, crSizeNWSE, crSizeWE, crUpArrow, crHourGlass, crDrag, crNoDrop, crHSplit, crVSplit, crMultiDrag, crSQLWait, crNo, crAppStart, crHelp, crHandPoint, crSizeAll. All of these are defined in COMPILERCONSTANTS.TXT.


Enabled

Navigation: Reference > Form Objects > Common Properties >

Enabled

 Print this Topic Return to chapter overview

This property controls whether or not the user will be able to access it or whether it will just be displayed on the form. If the object is an entry field, such as TTASEnter, the user will not be able to change the value displayed, if it is a button (TButton) they won't be able to 'click' it. This property is used all the time during a program operation. In many cases you might want to 'turn off' an object during a certain program operation, or only turn it on at a specific point in the program. In either case, this is the property to use.

The options are True (checked) and False and can be set at both design and runtime.

See also Visible.


EntryBGColor

Navigation: Reference > Form Objects > Common Properties >

EntryBGColor

 Print this Topic Return to chapter overview

If EntryUseDflt is set to False (not checked) then the object will use the value in this property as the background when the object is in focus (the user has moved to the object for data entry). To effect the color of the text displayed in the object during entry you have to change the color option in the EntryFont property.


EntryFont

Navigation: Reference > Form Objects > Common Properties >

EntryFont

 Print this Topic Return to chapter overview

If EntryUseDflt is set to False (not checked) then this property controls what the text will look like when the object has focus (the user has moved to the object during data entry). Where it appears depends on the object itself.

Each EntryFont property has 6 subproperties. These are:

Charset - Defaults to ANSI_CHARSET. This is the standard for all Western language countries. There are different Charset values for non-Western alphabets.

Color - What color the font will use when displayed. The possible colors are defined in COMPILERCONSTANTS.TXT.

Height - The height of the font in pixels.

Name - The name of the font.

Pitch - This can be fpDefault (the normal for the font chosen), fpFixed (each character has the same width), fpVariable (each character has a different width depending on the character). The options for this property are defined in COMPILERCONTSTANTS.TXT.

Size - The point size for the Font. This is generally used when you specify the size or how big the font will be.

There is a Property Editor attached to this property that will allow you to choose a font from a list and set it's subproperties. TFont can also be changed during runtime. If you want to change it in your program you would refer to the property value as: 'EntryFont.Size' or 'EntryFont.Color', etc.


EntryUseDflt

Navigation: Reference > Form Objects > Common Properties >

EntryUseDflt

 Print this Topic Return to chapter overview

If this property is set to True (box is checked) the object will use the default Font and Color when the object has focus (the user has moved to the object for data entry). However, if the property is set to False (box is unchecked) then the values in EntryBGColor and EntryFont will be used when the object has focus.


FieldName

Navigation: Reference > Form Objects > Common Properties >

FieldName

 Print this Topic Return to chapter overview

In all but a couple of the TTASxxx objects this is the property you will use to connect the object to either a DEFINEd field in the program or a file. If you don't setup this property the display property for the object (generally TEXT) will not display anything unless you set it directly. The Field Name property value should be the exact same as the field name used in the program. For example, if you use BKAR.CUSTCODE in the program you would save BKAR.CUSTCODE to this property (case doesn't matter).

There is a Property Editor attached to this property that will allow you to choose a field from the data dictionary, or, if you have a program loaded in the Source Code Editor, it can also check for DEFINEd fields in that program.

NOTE: If you want the events for the object to fire (such as .PRE, .POST, .CHANGE, etc.) but you don't want the object attached to any specific field, you may do so by entering the value of NONE in this property. This will alert the runtime that you want this object to be active without a field in the background. To the user it will appear the same as any other object on the screen.


FldModified

Navigation: Reference > Form Objects > Common Properties >

FldModified

 Print this Topic Return to chapter overview

This property will return 1 if the entry text or attached data field has been modified by the user and 0 if it has not been modified. If the property returns 1 this would generally mean the user has entered data into the object at runtime.

NOTE: This is a runtime only property and will not show up in the object inspector. The value of this property would be retrieved using the GET_OBJ_PROP() function.

NOTE: In the case of the TTASMemo this property works a little differently. Each time the user enters the object, the object makes a copy of what's presently there. Then, if you access this property, the stored version is compared to the current value. If it's different this property returns True, if not, it returns False. When the user enters the object the next time a copy will again be made and that will be compared when this property is checked. Also, when you check this property, if the field has been changed, and there is an attached field (FieldName above other than NONE), that field will be updated at the same time.


FocusControl

Navigation: Reference > Form Objects > Common Properties >

FocusControl

 Print this Topic Return to chapter overview

FocusControl Even though this object has no events attached to it, you can specify which object will get focus (become active) if the user should click on the label instead of the object you expected. This can happen when the label defines what the object is. The user may not know where to click (especially if they are new to GUI programs) and, by setting this option, you give them an extra choice. The object property is a standard drop box and, if you click on the down arrow, a list of objects on your form that can receive focus (can be made active) will be displayed.


FocusOnObject

Navigation: Reference > Form Objects > Common Properties >

FocusOnObject

 Print this Topic Return to chapter overview

This property is used in a .Pre event when you want to change the focus to an object that doesn't follow in the Tab list. This allows you to easily control where the focus changes if the object currently being accessed shouldn't be accessed. This property replaces the normal SET_FOCUS command that you would use in all other situations. However, in the .Pre event the .Valid and .Post events will execute if you use the standard SET_FOCUS command.


Font

Navigation: Reference > Form Objects > Common Properties >

Font

 Print this Topic Return to chapter overview

This property controls what the text will look like. Where it appears depends on the object itself. This always defaults to the Font property on the parent (where the object is placed) form. If you want to change the font for all objects then change the value on the form itself before placing any objects.

Each Font property has 6 subproperties. These are:

Charset - Defaults to ANSI_CHARSET. This is the standard for all Western language countries. There are different Charset values for non-Western alphabets.

Color - What color the font will use when displayed. The possible colors are defined in COMPILERCONSTANTS.TXT.

Height - The height of the font in pixels.

Name - The name of the font.

Pitch - This can be fpDefault (the normal for the font chosen), fpFixed (each character has the same width), fpVariable (each character has a different width depending on the character). The options for this property are defined in COMPILERCONTSTANTS.TXT.

Size - The point size for the Font. This is generally used when you specify the size or how big the font will be.

There is a Property Editor attached to this property that will allow you to choose a font from a list and set it's subproperties. TFont can also be changed during runtime. If you want to change it in your program you would refer to the property value as: 'Font.Size' or 'Font.Color', etc.


Height

Navigation: Reference > Form Objects > Common Properties >

Height

 Print this Topic Return to chapter overview

This property specifies the number of pixels that determine the vertical size of the object. During the design phase you can generally control the size of an object directly by clicking on it (small control blocks will be displayed around the object), grabbing one of the blocks with the mouse (click on the block and hold down the left button), and stretch or shrink the object as desired.

You can adjust this property during runtime. It takes any positive integer.

See also Left, Top and Width.


HelpContext

Navigation: Reference > Form Objects > Common Properties >

HelpContext

 Print this Topic Return to chapter overview

If you have a standard help file that is part of your application then this is the number that corresponds to the appropriate page in the help file. We recommend that you use Help & Manual from EC-Software. Their URL is: http://www.ec-software.com/.

You can adjust this property during runtime. It takes any positive integer.


HelpStatusBar

Navigation: Reference > Form Objects > Common Properties >

HelpStatusBar

 Print this Topic Return to chapter overview

If you want a message to be displayed in a TStatusBar object on the form you can place the name of that status bar object here. Click on the drop down arrow and choose the TStatusBar object from the list. The message you want to display must be put in the HelpStatusBarMsg property.

NOTE: For this process to work you must check the SimplePanel (set to .True.) property in TStatusBar. If you set the HelpStatusBar and HelpStatusBarMsg and nothing displays, check the SimplePanel property first.


HelpStatusBarMsg

Navigation: Reference > Form Objects > Common Properties >

HelpStatusBarMsg

 Print this Topic Return to chapter overview

If you want a message to be displayed in a TStatusBar object on the form you can place that message here. You must also have a TStatusBar object name in the HelpStatusBar property.

NOTE: For this process to work you must check the SimplePanel (set to .True.) property in TStatusBar. If you set the HelpStatusBar and HelpStatusBarMsg and nothing displays, check the SimplePanel property first.


Hint

Navigation: Reference > Form Objects > Common Properties >

Hint

 Print this Topic Return to chapter overview

This is a message, generally short, that will appear when the user passes the cursor over the object and stops for a moment. It is generally used to give a short explanation or help information that applies to that object.

You can set/change this property during runtime. It takes any alpha or string value.

See also ShowHint.


KeyTrapHint

Navigation: Reference > Form Objects > Common Properties >

KeyTrapHint

 Print this Topic Return to chapter overview

If the object allows you to enter KeyTraps it will also allow you to enter KeyTrapHint. Use this property to enter message lines that will be displayed to the user if they press the ALT+F1 keys. This property can be changed at runtime.

NOTE: This message will be displayed only if there are active traps for that object.

There is a Property Editor attached to this property that will allow you to easily enter/edit the lines to be displayed. The lines you enter will be displayed exactly as you enter them in a standard Windows message box.


KeyTraps

Navigation: Reference > Form Objects > Common Properties >

KeyTraps

 Print this Topic Return to chapter overview

This property gives you a quick and easy way to set keyboard TRAPs that will execute only when that object has focus. This property applies to objects that allow user entry only. By including the trap here you are programming the equivalent of turning the trap on in a PRE event and turning it off in a POST. Any trap that can be programmed through the use of the TRAP command can be added here, except for the RSRCH and RLCK traps. The only limit to the number of traps you may include are the traps that are available. Each trap you add must have a corresponding line label in the program that is currently executing. So, when you include a trap here it's the same as specifying a GOSUB in your code.

There is a Property Editor attached to this property that will allow you to easily enter/edit the traps to be included. However, you may enter the traps directly or at runtime. The property is actual a single string (alpha field) with the traps and the corresponding line label separated by the pipe (|) symbol. So, for example, if you want the F1 key to gosub to the line label GET_HELP and the F2 key to gosub to the line label DISP_RECS you could add the line directly as:

F1|GET_HELP|F2|DISP_RECS

If you have included this property in your object you may also want to include KeyTrapHint lines so that the user can tell easily which key traps are set.


Left

Navigation: Reference > Form Objects > Common Properties >

Left

 Print this Topic Return to chapter overview

This property specifies the position of the left edge of the object offset from the left side of it's parent form. If this is a form it's the location of the left edge of the form on the desk top. The far left position is 0 in all cases. During the design phase you can generally control the location of an object directly by clicking on it (small control blocks will be displayed around the object), holding the left mouse button depressed and move the object as desired. Once it's located where you want it release the left button and this value will be updated automatically.

You can adjust this property during runtime. It takes any positive integer.

See also Height, Top and Width.


Name

Navigation: Reference > Form Objects > Common Properties >

Name

 Print this Topic Return to chapter overview

Each object on the form has a Name property. The object is referred to in your program by this name. In most cases the name is assigned automatically. You have the ability to change this for any object.

This property should not be changed during runtime.

NOTE: In all cases other than in the Form itself, all Events are based on the object name. For example, if you have a TButton with the name btnOK and you want to call a routine that would be executed when the user clicks on that button the label would be: btnOK.click. However, if you change the object Name after you create the Event routine in the source code you will need to change the label and recompile the program. In fact, if you find that an Event doesn't fire when you expect it to, make sure the object names are correct.


ParentBackground

Navigation: Reference > Form Objects > Common Properties >

ParentBackground

 Print this Topic Return to chapter overview

Determines whether control uses parent's theme background.

Description

If ParentBackground is true, the control uses the parent's theme background to draw its own background. ParentBackground has no effect unless XP themes are enabled. TAS Professional powered by CAS supports XP themes.


ParentColor

Navigation: Reference > Form Objects > Common Properties >

ParentColor

 Print this Topic Return to chapter overview

If you want to use the same colors as set by the parent of the object (the form or panel on which it is placed) then this should be set as True (checked). If you set the Color property for this object this will automatically be set to False.

This property can be changed at runtime.


ParentCtl3D

Navigation: Reference > Form Objects > Common Properties >

ParentCtl3D

 Print this Topic Return to chapter overview

If you want to use the same 3D setting as the parent of the object (the form or panel on which it is placed) then this should be set as True (checked). This property will override the value in the Ctl3D for each object. The default value is True (checked).

This property can be changed at runtime.


ParentFont

Navigation: Reference > Form Objects > Common Properties >

ParentFont

 Print this Topic Return to chapter overview

If you want to use the same Font as set by the parent of the object (the form or panel on which it is placed) then this should be set as True (checked). If you set the Font property for this object this will automatically be set to False.

This property can be changed at runtime.


ParentShowHint

Navigation: Reference > Form Objects > Common Properties >

ParentShowHint

 Print this Topic Return to chapter overview

If you want to use the same Hint as set in the Hint property of the parent of the object (the form or panel on which it is placed) then this should be set as True (checked). If you set the Hint property of this object this will automatically be set to False.

This property can be changed at runtime.


PopupMenu

Navigation: Reference > Form Objects > Common Properties >

PopupMenu

 Print this Topic Return to chapter overview

When the user clicks the right mouse button over an object, depending on that object, a default pop-up menu is displayed. Using this option you can create a pop-up menu using the TPopupMenu object and attach it to this object. Then, when the user right clicks over the object, your pop-up menu will be displayed rather than the default version.

The property uses an object drop down box. This means that when you click the drop down arrow the names of any TPopupMenu objects will be displayed in the list and you will be able to choose one.

You cannot update this property during runtime.


ReadOnly

Navigation: Reference > Form Objects > Common Properties >

ReadOnly

 Print this Topic Return to chapter overview

If this is checked (set to .True.) the user will not be able to make any changes to the value displayed. This property can be changed at runtime.


ReturnIsTab

Navigation: Reference > Form Objects > Common Properties >

ReturnIsTab

 Print this Topic Return to chapter overview

In all of the TTASxxx objects that allow the user to enter a value (including TTASRadioButton and TTASCheckBox) you can set this property to allow the user to use the ENTER key as though it were a TAB. This means that users used to using the ENTER key to move from field to field will be able to continue to do so.

The property can be changed at runtime. The possible values are True (checked) (treat the ENTER key as a TAB) or False.


ShowHint

Navigation: Reference > Form Objects > Common Properties >

ShowHint

 Print this Topic Return to chapter overview

If you want to use the value set in the Hint property of the object then this should be set as True (checked). If you set the Hint property of this object this will automatically be set to True.

This property can be changed at runtime.


TabOrder

Navigation: Reference > Form Objects > Common Properties >

TabOrder

 Print this Topic Return to chapter overview

This property controls which object the user will make active if they press the TAB key. Each object that can be activated by moving from object to object will have this property. The objects are in order from 1 to the appropriate number of objects. Generally this value is automatically maintained. It is incremented automatically each time a new object is placed on the form or through the use of the Tab Order Property Editor.

This property can be changed during runtime and accepts any positive integer up to the maximum number of objects that have this property.


TabStop

Navigation: Reference > Form Objects > Common Properties >

TabStop

 Print this Topic Return to chapter overview

If this property is True (checked) the user will be able to press the TAB key and this will be one of the objects they will stop at. If you want to force the user to click the object with the mouse to activate the object then set this to False.

The options are True and False and can be set at runtime.

See also TabOrder.


Tag

Navigation: Reference > Form Objects > Common Properties >

Tag

 Print this Topic Return to chapter overview

Each object has this property. It is just a number that you can set to any integer you wish. It has no effect on any operation of the program (except in reports). You can, however, set this to any integer value you want and can be accessed during runtime.

NOTE: During design the Tag value on the Form you are editing is set to -1. DO NOT change this value. This only applies to the Form itself, not the objects you place on it.


Top

Navigation: Reference > Form Objects > Common Properties >

Top

 Print this Topic Return to chapter overview

This property specifies the position of the top edge of the object offset from the top of it's parent form. If this is a form it's the location of the top side of the form on the desk top. The far top position is 0 in all cases. During the design phase you can generally control the location of an object directly by clicking on it (small control blocks will be displayed around the object), holding the left mouse button depressed and move the object as desired. Once it's located where you want it release the left button and this value will be updated automatically.

You can adjust this property during runtime. It takes any positive integer.

See also Height, Left and Width.


ValidCheckOnExit

Navigation: Reference > Form Objects > Common Properties >

ValidCheckOnExit

 Print this Topic Return to chapter overview

If you check this option, and you have a ValidExpr for this entry field, the ValidExpr will be evaluated when the user exits the field, for any reason. This includes moving to a different field, clicking on a button, etc. If the ValidExpr returns .False. the user will not be allowed to leave the field until the expression returns .True.

Use of this option allows you to tightly control what the user can, or cannot enter. However, there is a downside to this. If the user just wants to exit the program all together by clicking on an Exit button that you provide, and the ValidExpr returns .False., they won't be allowed to exit. The solution to this is the following: In the KeyTraps property add an ESC trap. The Gosub label should probably point to an exit routine (one that includes the command QUIT), however, it isn't required. You could have a SET_FOCUS command that puts the cursor in another field. When the user presses the ESC key the program will check for the ESC Trap, and, when it finds it, will ignore the ValidExpr and will execute the trap. This will allow your user to always escape from a ValidExpr, even if it is just to exit the program.


ValidMsg

Navigation: Reference > Form Objects > Common Properties >

ValidMsg

 Print this Topic Return to chapter overview

If the user's entry fails a Valid Event (see Events for the appropriate object), the program will, by default, display the message: 'The valid check for this field returned false, please re-enter.' in a standard dialog box. If you want a different message to be displayed enter it here. Do not include quotes.

The default value is blank. This can be changed during runtime.


ValidExpr

Navigation: Reference > Form Objects > Common Properties >

ValidExpr

 Print this Topic Return to chapter overview

This is an alpha property that you can use to save an expression that will be tested when you execute the VALID_CHECK() function. The expression must resolve to True or False. If it resolves to False the ValidMsg will be displayed, if there is one, or a standard valid failure message if there isn't. Typically, you would return from the subroutine you're in if the expression returns False and, when you do, focus will be returned to the field that failed.

NOTE: If you add a ValidExpr to an object on a screen form you MUST save the screen form to disk BEFORE the program is compiled. Further, until you compile the program the ValidExpr will not be checked. It's also important to remember that information about that expression is compiled and pointers are stored in the screen form itself. This means if you save a screen form, compile the program, then save the screen form again without first loading the saved copy you will overwrite the information that was saved during compilation. It's not a big deal, however, you will have to compile the program again to update the pointers in the screen form. You can load a screen form with active ValidExpr pointers and make changes and save the screen form and those pointers will still work. However, if you make changes to the program and then recompile, you will have changed those pointers in the screen form and you'll need to make sure if you save any forms again that they've been loaded after the compilation process. This only applies to screen forms where you've used this expression.

An example of an expression you might use is part of the tutorial you receive with TAS Professional. In the Order Number field (object: numOrdNum) the expression in the ValidExpr property is SONumber<>0. When the VALID_CHECK() function is executed in the save routine the expression will be tested. If the SONumber is not 0 the expression will return True, if it is 0 it will return False and the VALID_CHECK() will fail.

If you want the ValidExpr to be checked when the user exits the field then you must have the ValidCheckOnExit checked.


Visible

Navigation: Reference > Form Objects > Common Properties >

Visible

 Print this Topic Return to chapter overview

You can control whether an object can be seen or not through the use of this property. If it's set to False then, during runtime, the object will not be seen on the form. If it's set to True (checked) it will.

This can be changed during runtime. The possible options are True (make the object visible) and False.

See also Enabled.


Width

Navigation: Reference > Form Objects > Common Properties >

Width

 Print this Topic Return to chapter overview

This property specifies the number of pixels that determine the horizontal size of the object. During the design phase you can generally control the size of an object directly by clicking on it (small control blocks will be displayed around the object), grabbing one of the blocks with the mouse (click on the block and hold down the left button), and stretch or shrink the object as desired.

You can adjust this property during runtime. It takes any positive integer.

See also Height, Left and Top.


General Information

Navigation: Reference > Form Objects > Property Editors >

General Information: Form Objects->Property Editors

 Print this Topic Return to chapter overview

CHECK BOXES

If the property uses a check box then you would click on the check box to toggle between on (a check appears) and off (it is blank). You can generally modify these values during runtime by setting the property to .True. (equivalent to putting a check in the box) or .False. (clearing the check box).

DROP DOWN LISTS

If the property uses this type of editor then a button with an arrow will be displayed at the right side of the entry area when you click on the property. Sometimes what will be displayed are constant representations, some of which are defined in the COMPILERCONSTANTS.TXT file. If it is defined you can modify the property during runtime by using the same constant name, for example, all of the cl* constants that are used for colors (clRed, clGray, etc.).

This editor is also used when a property requires a certain type of object. When you click on the down arrow a list of applicable objects that are already on the form will be displayed. If there are none available an empty list will be displayed.

NUMERIC VALUES

These are simple integer entry editors. In general the range for the property is specified in the help for that property. Very often you will be able to modify these properties during runtime.

SIMPLE STRING

For this type of property you should enter a single string of characters. Sometimes spaces are allowed (in Captions, etc.), sometimes they're not (Names and others). To edit the property you should just type in the characters that apply. Editing this property is similar to any simple text field.

SPECIAL EDITORS

Certain properties have their own specialized editors. When you click on the property a button with an ellipsis will be displayed. When you click on the button the appropriate editor will be displayed. The editor that applies to each property is linked to the help for that property.


Data Grid Columns Editor

Navigation: Reference > Form Objects > Property Editors >

Data Grid Columns Editor

 Print this Topic Return to chapter overview

This editor is displayed when you click on the button in the Columns property in the TTASDataGrid object. This is how you will create the TTASDGItems. The following is displayed when you click on the button:

For each item you add, or when you click on the appropriate line, the properties for that column will be displayed in the Object Inspector.

ACTIONS

This refreshes the properties for the object. If something you have changed effects other changes, and they don't show up automatically, you can see those by clicking on this option. In general this won't be necessary.

If the properties for the object are not displayed you can bring them to the front by clicking on this icon. Generally, if you click on the window the one of the columns will be set active and displayed.

Click on this icon to add a new column. This will always add to the end of the list. If you want to insert a column click on the appropriate line and press the INSERT key.

To delete a column click on the line representing that column and then this icon. You can also just press the DELETE key and get the same result.

NOTE: You can move columns around by dragging the appropriate line and dropping it where you want.


Data Grid Extra Fields Editor

Navigation: Reference > Form Objects > Property Editors >

Data Grid Extra Fields Editor

 Print this Topic Return to chapter overview

This editor is displayed when you click on the button in the ExtraFields property in the TTASDataGrid object. This is how you will create the TTASDGExtraFlds. The following is displayed when you click on the button:

For each field you add, or when you click on the appropriate line, the FieldName property for that field will be displayed in the Object Inspector.

ACTIONS

This refreshes the properties for the object. If something you have changed effects other changes, and they don't show up automatically, you can see those by clicking on this option. In general this won't be necessary.

If the properties for the object are not displayed you can bring them to the front by clicking on this icon. Generally, if you click on the window the one of the columns will be set active and displayed.

Click on this icon to add a new field. This will always add to the end of the list. In the case of this object position on the list means nothing.

To delete a field click on the line representing that field and then this icon. You can also just press the DELETE key and get the same result.


Edit Mask Property Editor

Navigation: Reference > Form Objects > Property Editors >

Edit Mask Property Editor

 Print this Topic Return to chapter overview

This editor is displayed when the user clicks on the button in an EditMask property in a TTASEnter, TTASDGItem or TTASDGColTemplate object. The editor, displayed below, has some standard masks and will show you what the mask will look like:

ACTIONS

Input Mask

This is the actual mask that will be saved in the property.

Character for Blanks

What character to use for blank spaces. The default is an underscore. If you want to use a space you must enter a space. A blank will be replaced with an underscore.

Save Literal Characters

If this option is checked the extra characters, such as the parentheses in the phone number, will be saved as part of the field. This means the field must be a type A (alpha) field.

Test Input

A display of what the input field would look like.

This is a list of pre-defined masks. To choose one of these click on the appropriate line. All the values will be changed to match your choice.

OK

This will return to the design mode. Any mask will be saved to the property.

Cancel

This will undo any changes made since the last time the editor was loaded.

COMMENTS

The following characters can be used in a mask:

! Non-literal characters are leading blanks. If this character is not included non-literal characters are trailing blanks.

> All characters after this are forced to upper case.

< All characters after this are forced to lower case.

<> The case is not changed from what the user enters.

\ The character immediately following this is a literal character.

L User must enter A-Z or a-z in this position.

l User may enter A-Z or a-z in this position (lower case L).

A User must enter A-Z, a-z or 0-9 in this position.

a User may enter A-Z, a-z or 0-9 in this position.

0 User must enter numeric character in this position.

9 User may enter numeric character in this position.

# User may enter numeric character or sign (+ or -) in this position.

: This represents the standard time divider. This may change depending on the user's country information.

/ This represents the standard date divider. This may change depending on the user's country information.

The mask is made up of three sections divided by semi-colons (;). The first is the actual mask, the second is either 1 (save the literal characters) or 0 (don't save the literal characters). The third part is the character to be used as the blank character.

NOTE: Make sure that there are no spaces before the leading "!" in the EditMask field. If there is your data will not display properly. If you use the built-in EditMask editor it may put an extra space at the beginning of the mask.


Field Name Editor

Navigation: Reference > Form Objects > Property Editors >

Field Name Editor

 Print this Topic Return to chapter overview

This editor is displayed when you click on the button in the FieldName property in objects that connect to fields in your program (for example: TTASEnter, TTASCheckBox, etc.). The following is displayed when you click on the button:

When the editor is first displayed you are in a standard grid with the first FD (file descriptor) in your data dictionary displayed. You can choose any FD by clicking on the drop down arrow in the Data Files entry field. Once you have found the correct field you can double click on the appropriate line and that value will be put in the FieldName property.

Another option is to display DEFINEd fields in programs that relate to this form. If you have the program loaded in the source code editor you will be allowed to choose that program in the Defined Fields in Program field. When you choose that program the grid above will be displayed. This will show all of the DEFINEd fields for that program in ascending name order. As with the data dictionary fields above, you can double click on any of the rows and the value will be put in the FieldName property.


Font Property Editor

Navigation: Reference > Form Objects > Property Editors >

Font Property Editor

 Print this Topic Return to chapter overview

This is a specialized editor that allows you to change any of the TFont values. You can accomplish the same results by clicking on the + to the left of the property name. When you click on the editor button the following will be displayed (the font depends on what you have chosen previously or your default value):

You can then choose to modify any of the options that make up the TFont object including the font type (name), style, size, color, etc. A sample of what you have chosen will be displayed. If you click OK the font information will be saved in your object.


Key Trap Editor

Navigation: Reference > Form Objects > Property Editors >

Key Trap Editor

 Print this Topic Return to chapter overview

The editor below is displayed when you click on the button in any property that displays the property KeyTraps. This would be any TTASxxx property that allows user entry, such as, TTASEnter, TTASNumEnter, etc.

To add a new KeyTrap press the ENTER key while the Trap Name is selected (as shown above). A drop down arrow will be displayed that will allow you to either choose the trap or you may enter it directly. After you enter the trap name press ENTER and the cursor will move to the Label Name. Enter it exactly as it appears in your program omitting the trailing colon, e.g., DISP_RECS: would be entered as DISP_RECS. Case does not matter, so if your label is in lower case it will still be found properly.

To exit from edit mode press the ESC key. This will allow you to move to a different line, if necessary.

To delete a KeyTrap make sure you're not in edit mode (press the ESC key) and then move the cursor to the correct line. Press the DEL key. The line will be deleted without any further action on your part.

When you are finished making entries press the Ok key and the KeyTraps will be saved to your object. If you don't want to save your changes then press the Cancel key.


Image List Editor

Navigation: Reference > Form Objects > Property Editors >

Image List Editor

 Print this Topic Return to chapter overview

This editor is displayed when you right click on the TImageList object and choose the ImageList Editor option. You will load .BMP and .ICO files using this editor that can be used in other objects (such as TMenuItem) that have Image properties. When the editor is first called (if there are no images already loaded) the following will be displayed:

OK

Choose this button when you are finished manipulating the image list and you're ready to return to designing the form.

Cancel

Undo the changes you have made and return to the design phase.

Apply

Save the changes you have made and remain in the image editor.

Add

Choose this button to add a new image to the list. When you do, a standard Open dialog (with a preview pane) will be displayed, allowing you to choose the file you want to include.

Delete

When you have images already loaded, you can click on one of those and then choose this button to remove it from the list.

Clear

This will remove all images from the list and allow you to start over again.

Save

This allows you to choose one of the images and save it to a file on the disk.

Selected Image

When you select an image it will be displayed in small form in the large panel and larger in the Selected Image panel.

Transparent Color

This is the color portion of the image that will disappear when it's displayed. Generally, you will make no changes to this value since it will be filled in automatically.

Fill Color

This will be used to fill in any spaces around the image when it's smaller than the size than the Height and Width specified in the TImageList object.

Options

Depending on the size of the image and the values you entered for Height and Width in the TImageList object, you may be able to choose: Crop - reduce the size of the image to fit the size specified; Stretch - increase the size of the image; or Center - put the image in the center of the size specified.


Load Image Editor

Navigation: Reference > Form Objects > Property Editors >

Load Image Editor

 Print this Topic Return to chapter overview

Used in TImage and others. This editor is displayed when you right click on the object and choose the Edit Image option. You will load .BMP and .ICO files using this editor, displayed below:

ACTIONS

Choose this button to load an image from disk. When you do, a standard Open dialog (with a preview pane) will be displayed, allowing you to choose the file you want to load.

This allows you to save the image displayed to a file on the disk.

This is a standard copy function. The image would be copied to the clipboard and could be pasted to another object or to a different windows program.

This is a standard paste function. An image that was copied previously to the clipboard will be pasted here.

This will clear or remove the image currently loaded.

OK

This will return to the design mode. If an image is currently loaded it will be saved to the form.

Cancel

This will undo any changes made since the last time the editor was loaded.


Menu Item Editor

Navigation: Reference > Form Objects > Property Editors >

Menu Item Editor

 Print this Topic Return to chapter overview

This editor is displayed when you right click on the TMainMenu or TPopupMenu object and choose the Menu Editor option. This is how you will create the TMenuItems. The following is displayed when you click on the button (the sample below has already had 3 menu items added):

For each item you add, or when you click on the appropriate line, the properties for that menu item will be displayed in the Object Inspector.

ACTIONS

This refreshes the properties for the object. If something you have changed effects other changes, and they don't show up automatically, you can see those by clicking on this option. In general this won't be necessary.

This moves you up one level. This would be the same as choosing the parent menu item to the one your on.

If the properties for the object are not displayed you can bring them to the front by clicking on this icon. Generally, if you click on the window the one of the menu items will be set active and displayed.

Click on this icon to add a new menu item. This will always add to the end of the list. If you want to insert a menu item click on the appropriate line and press the INSERT key. The new menu item will be on the same level as the current one.

This button will add a new menu item, the next level down. This will create a submenu for the current menu item. When the user chooses the parent the submenu will be displayed. This is how you create multi-step menus.

To delete a menu item click on the line representing that item and then this icon. You can also just press the DELETE key and get the same result.

NOTE: You can move menu items around by dragging the appropriate line and dropping it where you want.


Status Bar Panel Editor

Navigation: Reference > Form Objects > Property Editors >

Status Bar Panel Editor

 Print this Topic Return to chapter overview

This editor is displayed when you right click on the TStatusBar and choose the Panels Editor option. This is how you will create the TStatusPanel objects. The following is displayed when you click on the button (the sample below has already had 2 panel items added):

For each item you add, or when you click on the appropriate line, the properties for that menu item will be displayed in the Object Inspector.

ACTIONS

This refreshes the properties for the object. If something you have changed effects other changes, and they don't show up automatically, you can see those by clicking on this option. In general this won't be necessary.

If the properties for the object are not displayed you can bring them to the front by clicking on this icon. Generally, if you click on the window the one of the status panels will be set active and displayed.

Click on this icon to add a new status panel. This will always add to the end of the list. If you want to insert a status panel click on the appropriate line and press the INSERT key.

To delete a status panel click on the line representing that item and then this icon. You can also just press the DELETE key and get the same result.

NOTE: You can move status panels around by dragging the appropriate line and dropping it where you want.


Strings Property Editor

Navigation: Reference > Form Objects > Property Editors >

Strings Property Editor

 Print this Topic Return to chapter overview

The editor below is displayed when you click on the button in any property that displays TStrings or TStringList in the property field (in the sample below we're editing the Items property in the TTASComboBox):

ACTIONS

Choose this button to load a file from disk. When you do, a standard Open dialog will be displayed, allowing you to choose the file you want to load. The file should contain text only. If the text contains carriage return/line feed pairs (cr/lf) a separate line will be created for each.

This allows you to save the string displayed to a file on the disk. A carriage return/line feed pair is attached to the end of each line.

These two fields will allow you to choose the font type and the size of the text entered,

OK

This will return to the design mode. Any text currently loaded will be saved to the form.

Cancel

This will undo any changes made since the last time the editor was loaded.

Spell Check

This will allow you to check what you have entered.

COMMENTS

If you are entering lines for a Combo Box list or anything else that uses a drop down list, you would enter each line item on its own line, pressing the ENTER key after each entry. This property editor is also used for some TString properties, such as KeyTrapHint.


Tab Order Property Editor

Navigation: Reference > Form Objects > Property Editors >

Tab Order Property Editor

 Print this Topic Return to chapter overview

This editor gives you an easy way of resetting all the TabOrder property values for each object that allows TabStops. To display the editor below, right click on the form itself and choose Tab Order from the menu:

ACTIONS

OK

This will return to the design mode. The TabOrder properties will be updated for the new order.

Cancel

This will undo any changes made since the last time the editor was loaded.

This will move the currently highlighted object up the list so that the TabOrder property value will be lower.

This will move the currently highlighted object down the list so that the TabOrder property value will be higher.

NOTE: You can also move objects around by dragging the appropriate line and dropping it where you want.

NOTE: This doesn't effect the location of the object on the form at all. It does change the order in which the user will come to this object, during runtime, if they are pressing the TAB key. The first item in the list becomes the active item when the form is loaded.


General Iinformation: Report Objects

Navigation: Reference > Report Objects >

General Iinformation: Report Objects

 Print this Topic Return to chapter overview

Report objects come in two flavors. They can be just like Form Objects, that is objects you place on the report form; or, they can be part of the Report Form itself, generally called bands. They will determine what the report looks like when it prints.

Properties are features of objects that effect how they look, how they operate, and the information they return to you. In Report Objects these properties can be modified only at design time. There is a list of some properties that are common to many of the objects; what they are, what they're used for, their type, etc. These are defined in separate sections under Common Properties rather than over and over again each object.

Some objects are on a pallet, similar to the Form Objects, some are accessed through the menu. For each object you will see the appropriate icon on the object palate or the menu selection, a description of what the object is used for and a list of properties that are unique to that object (or haven't been previously defined in Common Properties).

There is only one event for a Report Object and it applies to only a few of the objects available. The event is OnPrint. If it is available for an object it will be described.

For more information about how objects are placed on a report, moved around, or removed please refer to the tutorial, specifically PART 4 - CREATING A TAS Professional REPORT.

The report formating tool used in TAS Professional is based on Digital-metaphors Report Builder. To get more information about how this part of the TAS Report builder works you can find more information on there website at This part of TASPRO would cost $499.00USD

http://www.digital-metaphors.com/Subpages/Downloads/Guide.html


TppDBBarCode

Navigation: Reference > Report Objects >

TppDBBarCode

 Print this Topic Return to chapter overview

Use this object to print bar codes on your report for numeric data. All data fields will use the TppDBText object.

Description

A bar code is a series of lines and spaces which represent data. A special set of rules is used to convert data into the lines and spaces of a barcode. This set of rules is called a symbology. There are many different symbologies, some for general purpose use and some for very specific applications. With TppBarCode, you can create valid bar codes for the most popular symbologies. They are:

Codabar Code 128 Code 39 EAN-13 EAN-8 FIM A,B,C Interleaved 2 of 5 PostNet UPC-A UPC-E

When creating a barcode use the BarCodeType property to specify the symbology which should be used to encode the data. Use the DataField properties to specify the database field which contains the data to be encoded.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Alignment

AutoSize

AutoSizeFont If this property is checked, along with the PrintHumanReadable property, then the characters printed along with the bars will change size as the bar code itself changes.

BarCodeType The type of bar code to print. The options are Codabar (bcCodabar), Code 128 (bcCode128), Code 39 (bcCode39), EAN-8 (bcEAN_8), EAN-13 (bcEAN_13), Interleaved 2 of 5 (bcInt2of5), PostNet (bcPostnet) UPC-A (bcUPC_A) and UPC-E (bcUPC-E).

BarColor The color used for printing the bars. Default is black.

BarWidth The width in Units of the narrow bars.

BearerBars If you have specified bcInt2of5 in BarCodeType, and you check this property, solid lines will be printed on the top and bottom of the bar code itself.

CalcCheckDigit If you check this property and specify bcUPC_A and bcEAN_13 for BarCodeType the report will automatically generate the Check Digit. If you don't check this property you must provide all digits required for the bar code, including the check digit.

Color The background color of the object. Default is white.
DataField

Font

Height

Left

Name

Orientation The direction the barcode is printed. The default value is left to right (orLeftToRight).

OnPrint

PrintHumanReadable If you want to print letters or numbers in addition to the bar code then check this property. Default value is checked.

ShiftWithParent

Tag

Top

Transparent

Visible

WideBarRatio The width of the wide bars as a multiplier of the BarWidth (the width of the narrow bars).

Width


TppDBCalc

Navigation: Reference > Report Objects >

TppDBCalc

 Print this Topic Return to chapter overview

Description

Used for simple database calculations (Sum, Min, Max, Count and Average). The value can be reset when a group breaks using the ResetGroup property.

The TppDBCalc component is a data-aware report component used to perform common report calculations and print the resulting value. The calculation is performed based on the value of the field specified in DataField Use the DBCalcType property to indicate the necessary calculation.

Calculations such as group totals are available through ResetGroup property. Each time the field value for the Reset Group changes (breaks), all associated DBCalc components are reset to zero.

Use the DisplayFormat property to control how the text is formatted. Text alignment of the caption is determined by the value of the Alignment property. You can force the control to resize to fit a changing caption by setting the AutoSize property to True.

You can control the appearance of this component (Font, Alignment, etc.) at design-time by using the Format Bar of the Report Designer. The Format Bar also allows you to set the DataField property from a drop down list box at the far left. You can also set key properties by using the speed menu. To access the speed menu, position the mouse cursor over the component and click the right mouse button.

PALETTE ICON & EXAMPLE

Alignment

AutoSize

Color The background color of the object. Defaults to white.

DataField

DisplayFormat

The DBCalcType determines what type of report information is calculated and printed on the report. This property can be set from the report control's speed menu. For report group calculations you can use the ResetGroup property to enable a calculated value to be reset to zero each time the value of the field changes.

Options are

dcCount - Count one for each group of records where the ResetGroup field value is the same

dcSum - Sum data values for each group of records where the ResetGroup field value is the same

dcMinimum - Minimum data value for each group of records where the ResetGroup field value is the same

dcMaximum - Maximum data value for each group of records where the ResetGroup field value is the same

dcAverage - Average of all data values for each group of records where the ResetGroup field value is the same

LookAhead is designed to allow you to display summary calculations in the title band, page footer calculations in the page header band, group footer calculations in the group header band and column footer calculations in the column header. When the LookAhead property is set to True, the draw command which represents the component on the rendered page will continue to update with the most recent calculation value until the report completes the generation of the associated page, group or column.

Font

Height

Left

Name

OnPrint

ShiftWithParent

Tag

Top

Transparent

Visible

Width

WordWrap If you want to allow the object to wrap sentences as though this were a memo field then check this object. If you also have AutoSize checked the object will grow in length to the appropriate number of lines that are required to print the entire object.


TppDBImage

Navigation: Reference > Report Objects >

TppDBImage

 Print this Topic Return to chapter overview

Use this object to put a picture on the report format. Loading this picture from a database or disk file This is what you would use if you want to print a picture that changes on a record level printing these pictures dynamically .

Description

The TppDBImage component is a data-aware report control that is used to print a graphical image stored in a database field, such as a BLOB field. The image that is printed is determined by the value of the DataField property. Set the Stretch property to True if you want to scale the picture to fit inside the report control.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

AutoSize

Center Center the picture in the middle of the space provided. The default setting is checked.

DirectDraw If you are having problems printing the object on your printer then check this property. It will use a different method of printing and may render the picture better. The default setting is unchecked.

Font

Height

Left

MaintainAspectRatio You can ignore this property since the memo cannot grow larger than the value you assign to it during design time

Name

OnPrint

Data Field

ShiftWithParent

Stretch You can ignore this property since the memo cannot grow larger than the value you assign to it during design time.

Tag

Top

Transparent

Visible

Width

COMMENTS

This object has a DataField property whereas TppImage has a Picture property. The DataField can be a temporary or permanent field. Use this data filed as desired and images will be pulled in dynamically.

SAMPLE

you have a database that has an alpha field lets say picture type A size 40 in your data base in this field value you would have the path to your picture. like this : c:\mytasapp\pics\mypicture.bmp

In the Report object inspector

DataField would equal picture.

when your report is printed it will read this location if there is a picture to be printed it will change each time you read another record in the detail of your report. This feature first introduced in Version 7.1 Build 2 powered by CAS. This feature may or may not be available in other version of TAS PRO.


TppDBText

Navigation: Reference > Report Objects >

TppDBText

 Print this Topic Return to chapter overview

Use this object to put data from your program into the report. All data fields will use this object, regardless of the type. The only exception to this is when you want to print numeric values as bar codes. Then you would use the TppDBBarCode object.

Description

The TppDBText component is a data-aware report control that is used to print text from a database field. The database field that is printed is the value of the DataField property. To avoid printing the same data on consecutive detail lines set the SuppressRepeatedValues property to true. When SuppressRepeatedValues is set to True you can enable the field value to reprint on the first detail line of a new page by setting the ReprintOnSubsequent property to True.

Use the DisplayFormat property to control how the text is formatted. How the text of the caption aligns within the label is determined by the value of the Alignment property. You can have the control resize automatically to fit a changing caption if you set the AutoSize property to True. Set the WordWrap property to True if you the want the text to wrap rather than be truncated to fit inside the control.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Alignment

AutoSize

Color The background color of the object. Defaults to white.

DataField

DisplayFormat

Font

Height

Left

Name

OnPrint

ShiftWithParent

Tag

Top

Transparent

Visible

Width

WordWrap If you want to allow the object to wrap sentences as though this were a memo field then check this object. If you also have AutoSize checked the object will grow in length to the appropriate number of lines that are required to print the entire object.


TppDetailBand

Navigation: Reference > Report Objects >

TppDetailBand

 Print this Topic Return to chapter overview

Description

The detail band prints multiple times on the page until all page space is utilized or an ending condition is detected.

This object is created automatically along with the TppHeaderBand and the TppFooterBand. The Detail Band is used for printing multiple records.

NOTE: TppSubReports may be placed ONLY in a Detail Band.

MENU ACCESS

Report -> Detail

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Height This is the vertical distance of the band in the appropriate units. You can adjust the Height of any band by moving the mouse to the bottom bar of the band, the mouse will turn into a double headed arrow, and, holding the left mouse button down, move the band up or down as desired.

PrintHeight

PrintPosition

Tag

Visible

COMMENTS

Each time you select the Detail option from the menu you toggle the band on and off. If you turn the band off the check mark next to the item in the Report menu will turn off and the band will disappear on the current page displayed.

NOTE: If you turn a band off and there are objects on that band, they will be deleted from the form with the band.

NOTE: The band options on the Report menu effect only the currently displayed page.


TppFooterBand

Navigation: Reference > Report Objects >

TppFooterBand

 Print this Topic Return to chapter overview

Description

The Footer Band will print at the bottom of each page.

This object is created automatically along with the TppDetailBand and the TppHeaderBand. NOTE: If you need the last page of a report to contain additional information, create a TppSummaryBand.

MENU ACCESS

Report -> Footer

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Height This is the vertical distance of the band in the appropriate units. You can adjust the Height of any band by moving the mouse to the bottom bar of the band, the mouse will turn into a double headed arrow, and, holding the left mouse button down, move the band up or down as desired.

PrintHeight

PrintOnFirstPage If this property is checked then the Footer Band will print on the first page. If it's not checked it will print on all pages after the first. The default value is checked.

PrintOnLastPage If this property is checked then the Footer Band will print on the last page. If it's not checked it will print on all pages except the last. The default value is checked.

Tag

Visible

COMMENTS

Each time you select the Footer option from the menu you toggle the band on and off. If you turn the band off the check mark next to the item in the Report menu will turn off and the band will disappear on the current page displayed.

NOTE: If you turn a band off and there are objects on that band, they will be deleted from the form with the band.

NOTE: The band options on the Report menu effect only the currently displayed page.


TppGroup

Navigation: Reference > Report Objects >

TppGroup

 Print this Topic Return to chapter overview

Use this feature to section your report. Each group can start on its own page and you can force group items to stay together.

MENU ACCESS

Report -> Groups

PROCESS

When you choose the Group menu item the following screen is displayed:

ACTIONS

Groups This is the list of fields that is available to be chosen as the group control. When the value in this field changes the report considers the group to have changed. You must choose a field of type TppDBText as your control. To get a list of fields available click on the down arrow.

Add This will add a new group to your report. You may have multiple groups and groups within groups.

Insert This will insert a new group at the cursor location. If we had chosen one or more groups above that group would be listed in the box below the listing field. You can choose an existing group by clicking on it before you click on the Insert button.

Delete This will delete the group at the cursor location. Make sure you want to do this since all fields in the group bands will be deleted if you delete the group.

Break On The radio button Custom Field must always be chosen. If you choose Data Field the group will not work.

On Group Change

Start new page - This will begin a new page when the group changes regardless of how many lines have currently be printed.

Reset page number - If you are using a TppSystemVariable to print the page number on your report this will reset that page number to 1 each time the group changes. However, it only applies if you have chosen the Start new page option.

New page when less than - This will start a new page when the number of remaining lines is less than the value entered here. This option and Start new page are mutually exclusive.

Keep group together - If you check this option the report will always see if there are enough lines remaining to print the entire group. If there aren't the report will start the group with the next page.

Reprint group headers on subsequent pages - If the group requires more than one page to print, and this option is checked, then the GroupHeader band will be reprinted for each line. If this is not checked, the GroupHeader band will be printed only once, when the group starts.

OK Save the group information you have entered.
Cancel Don't save.

COMMENTS

A group can be defined by an TppDBText field. The field doesn't even need to be printed on the report, however, it does need to be on the page.

When you click the Add button and a new group is created the group field name will be inserted into the box below the field list. The program will also create two new bands on the active page. These are GroupHeader and GroupFooter. They have the same options as the TppHeaderBand and TppFooterBand. However, when the Group Bands are created there is no space between these new bands and the one above. The only way you can tell is by the additional name that is displayed and the line appears thicker. An example is shown below:

To separate the two bands works the same way as increasing or decreasing the size of a band. Just place the mouse over the header band, and, when the mouse cursor changes to a double headed arrow, press the left mouse button down and drag the band down. If you've chosen the correct band specifier you should see an increasing space between the original header (or whatever the band was) and the new Group Header. If you don't you've probably grabbed the wrong band. Release the left mouse button, move the mouse down a little bit and (as long as you have the two headed arrow) try again.


TppHeaderBand

Navigation: Reference > Report Objects >

TppHeaderBand

 Print this Topic Return to chapter overview

This object is created automatically along with the TppDetailBand and the TppFooterBand. The Header Band will print at the top of each page.

MENU ACCESS

Report -> Header

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Height This is the vertical distance of the band in the appropriate units. You can adjust the Height of any band by moving the mouse to the bottom bar of the band, the mouse will turn into a double headed arrow, and, holding the left mouse button down, move the band up or down as desired.

PrintHeight

PrintOnFirstPage If this property is checked then the Header Band will print on the first page. If it's not checked it will print on all pages after the first. The default value is checked.

PrintOnLastPage If this property is checked then the Header Band will print on the last page. If it's not checked it will print on all pages except the last. The default value is checked.

PrintPosition

Tag

Visible

COMMENTS

Each time you select the Header option from the menu you toggle the band on and off. If you turn the band off the check mark next to the item in the Report menu will turn off and the band will disappear on the current page displayed.

NOTE: If you turn a band off and there are objects on that band, they will be deleted from the form with the band.

NOTE: The band options on the Report menu effect only the currently displayed page.


TppImage

Navigation: Reference > Report Objects >

TppImage

 Print this Topic Return to chapter overview

Description

Use this object to put a picture on the report format. This is what you would use if you want to print a logo or something similar that wouldn't change.

Use the TppImage report component to print a graphical image. The image that is printed is determined by the value of the Picture Property. Set the AutoSize property to True if you want the report control to resize to accommodate the size of the picture. Set the Stretch property to True if you want to scale the picture to fit inside the component.

From the Report Designer you can set the key properties for this component by positioning the mouse cursor over the component and clicking the right mouse button. A speed menu will be displayed.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

AutoSize

Center Center the picture in the middle of the space provided. The default setting is checked.

DirectDraw If you are having problems printing the object on your printer then check this property. It will use a different method of printing and may render the picture better. The default setting is unchecked.

Font

Height

Left

MaintainAspectRatio You can ignore this property since the memo cannot grow larger than the value you assign to it during design time

Name

OnPrint

Picture This is the picture you want to print on the report. To load a picture click on the property and then on the ellipsis button. The Load Image Editor will be displayed and you can choose the picture to be used.

ShiftWithParent

Stretch You can ignore this property since the memo cannot grow larger than the value you assign to it during design time.

Tag

Top

Transparent

Visible

Width

COMMENTS

At the current time the only way you can change this value is to edit the report format. We expect at some later date to provide you with a way to access pictures that would be loaded at runtime.


TppLabel

Navigation: Reference > Report Objects >

TppLabel

 Print this Topic Return to chapter overview

Description

Use this object to put text directly into the report. Whatever you put into the Caption property will print on the report. If you want to put data from your program into the report you would use the TppDBText or TppDBBarCode object instead.

The TppLabel component is a report control that displays text on a report. Report labels are typically used for report titles, column headings, group headings, etc. The text of a label is the value of its Caption property. How the text of the caption aligns within the label is determined by the value of the Alignment property. You can have the label resize automatically to fit a changing caption if you set the AutoSize property to True. Set the WordWrap property to True if you the want the text to wrap rather than be truncated to fit inside the control.

You can control the appearance of this component (Font, Alignment, etc.) at design-time by using the Format Bar of the Report Designer. The Format Bar also allows you to set the Caption property from an edit box at the far left. You can also set key properties by using the speed menu. To access the speed menu, position the mouse cursor over the component and click the right mouse button.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Alignment

AutoSize

Caption The text that will print on the report.

Font

Height

Left

Name

OnPrint

ShiftWithParent

Tag

Top

Transparent

Visible

Width

WordWrap If you want to allow the object to wrap sentences as though this were a memo field then check this object. If you also have AutoSize checked the object will grow in length to the appropriate number of lines that are required to print the entire object.


TppLine

Navigation: Reference > Report Objects >

TppLine

 Print this Topic Return to chapter overview

Description

Use TppLine to print vertical or horizontal lines. The orientation of the line is determined by the value of the Position property. Use the Style property to control whether a single or double line is printed. The Pen property is used to control the line's color and width. Set the StretchWithBand property to True if you want the Height of the line to stretch as the band stretches (this only occurs when a memo component is stretching and the band PrintHeight property has been set to phDynamic).

The TppLine component is very useful for giving reports a distinctive, professional look. Double Style lines are great for underscoring report totals.

Use the Report Designer's Format Bar to set the Position property and to BringToFront or SendToBack. Use the Graphics Palette to set the Pen Color (PC) and Pen.Width. To access the speed menu for this component, position your mouse cursor over the component and click the right mouse button.

Use this object to draw a line on the report. This would generally be used to put lines above totals, between values, etc.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Height The heigth of the Line on the report form. If the Line is printed it will always take the size of the object on the form.

Left The starting position of the Line indicator. If the Line is printed it will start where you have placed it on the form.

Name

OnPrint

ParentHeight If this is checked the Line will start at the top of the Band where it is placed, and stretch to the bottom. You will still be able to control the Width of the Line unless you have also checked the ParentWidth property.

ParentWidth If this is checked the Line will start at the left side of the Band where it is placed, and stretch to the far right side. You will still be able to control the Height of the Line unless you have also checked the ParentHeight property.

Pen

Position The line that is printed is actually just one side of a square. This property allows you to choose which side of the square you want to use; top, bottom, left or right.

ShiftWithParent

StretchWithParent If the band the Line is placed on contains a TppDBText object that can grow in length (AutoSize and WordWrap is checked), and the Postion property is lbLeft or lbRight, and you don't check this property, the Line will not grow as the number of lines printed grows. The default value is unchecked.

Tag

Top

Visible

Weight The thickness of the line. The smaller the number the thinner the line.

Width


TppMemo

Navigation: Reference > Report Objects >

TppMemo

 Print this Topic Return to chapter overview

Use this object to put a large amount of text directly into the report. Whatever you put into the Lines property will print on the report. If you want to put data from your program into the report you would use the TppDBText or TppDBBarCode object instead.

Description

The TppMemo component is a report control that prints multiple lines of text on a report. The text of a memo is the value of its Lines property. How the lines of text align within the memo is determined by the value of the Alignment property. The amount of space between the lines within the memo is determined by the value of the Leading property. You can enable the height of the memo to stretch automatically by setting Stretch to True and the parent Band PrintHeight property to phDynamic.

At design-time you can use the Report Designer's Format Bar to control the appearance of the report memo. Use the Object Inspector to set the value of the Lines property. Press the right mouse button to access a speed menu and set other key properties for this control.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Alignment

AutoSize

Caption If you have a value in this property when you enter the Lines text it will not display properly. Make sure you clear this value first.

Color The background color of the object. Defaults to white.

Font

Height

Leading This property controls the spacing between the lines in the memo. The larger the amount the larger the spacing.

Left

Lines This is the actual text that will print on the report. To enter the lines click on the ellipsis button and a standard string editor will be displayed.

Name

OnPrint

ShiftRelativeTo If you have objects that preceed this one, in the same band, that can change in height during printing you will want to set this value to that object. By doing that this object won't start printing until the other is done. If you don't do this it will overprint the other object. Also, if the previous object has nothing to print this one will move up as you would expect. To choose the appropriate object just click on the down arrow in the property box and choose the name of the previous object. If there are no other expanding objects in the Band you can ignore this property.

ShiftWithParent

Stretch You can ignore this property since the memo cannot grow larger than the value you assign to it during design time.

Tag

Top

Transparent

Visible

Width

COMMENTS

You should use this object instead of a series of separate TppLabels since you can move the memo around on the form easier, it can be resized as a single entity, and, if you wish to control whether or not it prints at all, that can be done easier than if it were several discrete objects.


TppRegion

Navigation: Reference > Report Objects >

TppRegion

 Print this Topic Return to chapter overview

Use the Region object to control whether items print or not and to give objects below the ability to move up if the region doesn't print. Generally you will put one or more TppDBText or TppLabel objects within a Region. Then, if you turn the Region off, none of the items within the region will print.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Brush

Caption This property will print in the upper left corner of the Region. If you don't want it to be printed you must clear the Caption property value.

Height The heigth of the Region on the report form. If the Region is printed it will always take the size of the object on the form.

Left The starting position of the Region indicator. If the Region is printed it will start where you have placed it on the form.

Name

OnPrint

ParentHeight If this is checked the Region will start at the top of the Band where it is placed, and stretch to the bottom. You will still be able to control the Width of the Region unless you have also checked the ParentWidth property.

ParentWidth If this is checked the Region will start at the left side of the Band where it is placed, and stretch to the far right side. You will still be able to control the Height of the Region unless you have also checked the ParentHeight property.

Pen

ShiftRelativeTo If you have multiple Regions in your Band, or a combination of SubReports and Regions you will want to set this value to the SubReport or Region that immediately preceeds this Region. By doing that this Region won't start printing until the other is done. If you don't do this it will overprint the other SubReport/Region. Also, if the previous SubReport/Region has nothing to print this Region will move up as you would expect. To choose the appropriate object just click on the down arrow in the property box and choose the name of the previous SubReport/Region. If there are no other SubReports or Regions in the Band you can ignore this property.

ShiftWithParent

Stretch If the Region contains a TppDBText object that can grow in length (AutoSize and WordWrap is checked) and you don't check this property, the Region will not grow as the number of lines printed grows. The default value is unchecked.

StretchWithParent If the band the Region is placed on contains a TppDBText object that can grow in length (AutoSize and WordWrap is checked) and you don't check this property, the Region will not grow as the number of lines printed grows. The default value is unchecked.

Tag

Top

Transparent Checking this property would have the same effect as setting the Brush Color to Clear. The default value is unchecked.

Visible

Width

Example

To use this at runtime you would define an alpha field size 3 with the same

define region1 type A size 3

to turn the region on for printing the on and off have to be in caps.

region1 = 'ON'

Turn the region off

region1 = 'OFF'


TppShape

Navigation: Reference > Report Objects >

TppShape

 Print this Topic Return to chapter overview

Use this object to draw a shape on the report. This could be used to draw boxes around fields, etc.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Brush

Height The heigth of the Shape on the report form. If the Shape is printed it will always take the size of the object on the form.

Left The starting position of the Shape indicator. If the Shape is printed it will start where you have placed it on the form.

Name

OnPrint

ParentHeight If this is checked the Shape will start at the top of the Band where it is placed, and stretch to the bottom. You will still be able to control the Width of the Shape unless you have also checked the ParentWidth property.

ParentWidth If this is checked the Shape will start at the left side of the Band where it is placed, and stretch to the far right side. You will still be able to control the Height of the Shape unless you have also checked the ParentHeight property.

Pen

Shape The shape you want to put on the report form. You have the option of Circle (stCircle), Ellipse (stEllipse), Rectangle (stRectangle), a rectangle with rounded corners (stRoundRect), a square with rounded corners (stRoundSquare) and a square (stSquare).

ShiftWithParent

StretchWithParent If the band the Shape is placed on contains a TppDBText object that can grow in length (AutoSize and WordWrap is checked) and you don't check this property, the Shape will not grow as the number of lines printed grows. The default value is unchecked.

Tag

Top

Visible

Width


TppSubReport

Navigation: Reference > Report Objects >

TppSubReport

 Print this Topic Return to chapter overview

Use the SubReport object to create compound reports. By placing one or more SubReports in a Detail Band (on any page) the program will look for a buffer that uses the same RB_NUM as the Tag property for that SubReport. Any records waiting (they are created with the Output_Report_Data and Update_Report_Data commands) will be printed. The Detail Band can contain a combination of text (TppLabel), objects (such as TppDBText) and SubReports.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Caption Normally a Caption property would print, however, when it's used in a SubReport it just names the object so that you can easily tell what is what on your report form.

Height The heigth of the SubReport indicator on the report form. This has nothing to do with the actual size of the bands that will print and should remain at the default value.

Left The starting position of the SubReport indicator. If the ParentWidth property is checked then this will always be 0. If the ParentWidth property is not checked then this will be the starting point on the report for the SuReport to begin, almost like putting an extra margin value in.

Name

OnPrint

ParentWidth If this is checked the SubReport indicator will stretch from one side of the report form to the other. However, if you uncheck this option you can resize the indicator. If you do this the SubReport will print in the space allotted. See the EXAMPLE section below for more information.

ShiftRelativeTo If you have multiple SubReports in your Detail Band, or a combination of SubReports and Regions you will want to set this value to the SubReport or Region that immediately preceeds this SubReport. By doing that this SubReport won't start printing until the other is done. If you don't do this it will overprint the other SubReport/Region. Also, if the previous SubReport/Region has nothing to print this SubReport will move up as you would expect. To choose the appropriate object just click on the down arrow in the property box and choose the name of the previous SubReport/Region. If there are no other SubReports or Regions in the Detail Band you can ignore this property.

Tag This is how you link the report format to your program. The number you put here must match the number you used in the Setup_Report_Buff command (and the other output commands) in your program. The Main page automatically defaults to 1. So, any SubReport you add to the report format must have a Tag property value of 2 or higher.

NOTE: If you find your report doesn't print the data you expect (or no data at all) this is the first place to look. If these numbers don't match (and the DataField names in the DB objects with the Setup_Report_Buff field names) then your report won't print properly.

Top

Visible

Width If ParentWidth is checked this will always be the width of the report form. If ParentWidth is not checked then this will be the horizontal size of the SubReport in the same Units you have specified for this report.

EXAMPLE

Probably one of the most unique uses of the SubReport is to use two or more in a Detail Band at the same level. For example, if you have a detail band with the following:

Then, assume the report is going to display a Company Name in SubReport1 and the sales for that company in SubReport2. You might get something like the following:

001 Bug-B-Gone Exterminators 104 $29.95 02/01/01 500

105 $10.95 02/15/01 500

002 Pro Musica 101 $199.50 02/14/01 500

003 Little Greenhouse

004 La Villa Restaurant 102 $350.31 02/15/01 500

Notice how company 001 has two sales, company 003 has none, and the other two have one each. It wouldn't matter how many sales each customer had, the proper lines would print. In fact, you could have a multiple line print-out on the left also, and that would work just as well.


TppSummaryBand

Navigation: Reference > Report Objects >

TppSummaryBand

 Print this Topic Return to chapter overview

This object is created automatically for all SubReports that you add to your Report Form. The Summary Band prints just once, at the end of the SubReport. Don't forget, the Footer Band created on the main page will still print on every page.

MENU ACCESS

Report -> Summary

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Height This is the vertical distance of the band in the appropriate units. You can adjust the Height of any band by moving the mouse to the bottom bar of the band, the mouse will turn into a double headed arrow, and, holding the left mouse button down, move the band up or down as desired.

NewPage If this property is checked then when this Summary Band is printed it will start on a new page. The default value is unchecked.

PrintHeight

PrintPosition

Tag

Visible

COMMENTS

Each time you select the Summary option from the menu you toggle the band on and off. If you turn the band off the check mark next to the item in the Report menu will turn off and the band will disappear on the current page displayed.

NOTE: If you turn a band off and there are objects on that band, they will be deleted from the form with the band.

NOTE: The band options on the Report menu effect only the currently displayed page.


TppSystemVariable

Navigation: Reference > Report Objects >

TppSystemVariable

 Print this Topic Return to chapter overview

This is a specialized object that you can use to put date, time or page numbers on your report.

PALETTE ICON & EXAMPLE

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Alignment

AutoSize

Color The background color of the object. Defaults to white.

Font

Height

Left

Name

OnPrint

ShiftWithParent

Tag

Top

Transparent

VarType Choose the type of variable you want to have displayed.

Visible

Width

COMMENTS

You can put TppDBText fields on the form and use those instead of this object for reporting date and time. Using this object is simpler, and you don't have to worry about the interface to your program and it's one less field you have to worry about. However, this object is the only way you can include page numbers on your report.


TppTitleBand

Navigation: Reference > Report Objects >

TppTitleBand

 Print this Topic Return to chapter overview

This object is created automatically for all SubReports that you add to your Report Form. The Title Band prints just once, when the SubReport starts. Don't forget, the Header Band created on the main page will still print on every page.

MENU ACCESS

Report -> Title

PROPERTIES

The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.

Height This is the vertical distance of the band in the appropriate units. You can adjust the Height of any band by moving the mouse to the bottom bar of the band, the mouse will turn into a double headed arrow, and, holding the left mouse button down, move the band up or down as desired.

NewPage If this property is checked then when this Title Band is printed it will start on a new page. The default value is unchecked.

PrintHeight

PrintPosition

Tag

Visible

COMMENTS

Each time you select the Title option from the menu you toggle the band on and off. If you turn the band off the check mark next to the item in the Report menu will turn off and the band will disappear on the current page displayed.

NOTE: If you turn a band off and there are objects on that band, they will be deleted from the form with the band.

NOTE: The band options on the Report menu effect only the currently displayed page.


General Information

Navigation: Reference > Report Objects > Common Properties >

General Information: Report Objects->Common Properties

 Print this Topic Return to chapter overview

The common properties are listed in alphabetical order.

A short paragraph is given describing the property, why that property exists, and the possible values that can be set. There are some properties that have multiple settings or subproperties and those are explained also.

Links back to these descriptions is provided for each object where the property applies.


Alignment

Navigation: Reference > Report Objects > Common Properties >

Alignment

 Print this Topic Return to chapter overview

Use this property to determine where the text in this object will be displayed. The options are: taRightJustify (move text to the right side of the object), taLeftJustify (move text to the left side of the object) and taCenter (center the text in the object).


AutoSize

Navigation: Reference > Report Objects > Common Properties >

AutoSize

 Print this Topic Return to chapter overview

If this is checked, the object will resize itself automatically, if the text that will print on the report grows too large for the size you specified at design time.


Brush

Navigation: Reference > Report Objects > Common Properties >

Brush

 Print this Topic Return to chapter overview

This property will control what the background will look like in those objects that use it.

Each Brush property has 2 subproperties. These are:

Color - What color will be used when displaying the background. Defaults to White.

Style - Allows you to change the style of the background. This will change the way the color appears in the object background.


DataField

Navigation: Reference > Report Objects > Common Properties >

DataField

 Print this Topic Return to chapter overview

This is the property you will use to connect your object to your program. By double clicking on the property entry box you can display the Field Name lookup that you have in the Screen Form editor. The only difference is that it will not search for Defined fields in a source file.

The field name you put in here may be different from the value saved in the data dictionary. Also, if you choose the name from the Field Name lookup the size of the field will be appended automatically to the DataField name. For example, you could have something like this:

CUSTNAME{25}

This tells the program that the field has been defined as a maximum of 25 characters. Then, if you double click on the Width property the object width will be set to the approximate size required to print the entire field. Depending on the data you print it may be too large or too small, but it should be a close approximation.


DisplayFormat

Navigation: Reference > Report Objects > Common Properties >

DisplayFormat

 Print this Topic Return to chapter overview

DisplayFormat The DisplayFormat property is used to control how data is formatted for a report. For example, '#,0' would display 10000 as 10,000. If the datafield is a date or time type, then you can use the standard formatting characters for those types ('mm/dd/yyyy', 'hh:nn:ss'). DisplayFormat differs from the TAS Professional form objects implementation in the case of string types. In order to format strings, simply type a valid EditMask into the DisplayFormat property. Report Painter will then apply the EditMask to the string value.

From the Report Painter you can access the DisplayFormat property by positioning the mouse cursor over the component and clicking the right mouse button. A speed menu containing the key properties for the component will be displayed. Select DisplayFormat... from this menu. The DisplayFormat dialog will be displayed.

NOTE: At this time the date and time formating has not been implemented. This will be inplimeted soon in future release right now we only support formating of numbers.

Display format Property Editor

To use the Built in property editor lookup. After you have placed a dbtext or dbcalc right click on the object you have placed on your report and the following menu will be displayed.

Click on the display format menu option. and the following property editor menu will be displayed. Choose the display format you wamt to use and click ok.

NOTE: if you want to add or edit these formats in this list there is a file in the Tas Professional forlder named displayformats.txt. Bye editing this file you can add to this list or make changes to the current list of formats.


Font

Navigation: Reference > Report Objects > Common Properties >

Font

 Print this Topic Return to chapter overview

This property controls what font the text will use when printing. This always defaults to the Font property on the parent report form.

Each Font property has 6 subproperties. These are:

Charset - Defaults to ANSI_CHARSET. This is the standard for all Western language countries. There are different Charset values for non-Western alphabets.

Color - What color the font will use when displayed.

Height - The height of the font in pixels.

Name - The name of the font.

Pitch - This can be fpDefault (the normal for the font chosen), fpFixed (each character has the same width), fpVariable (each character has a different width depending on the character).

Size - The point size for the Font. This is generally used when you specify the size or how big the font will be.

There is a Property Editor attached to this property that will allow you to choose a font from a list and set it's subproperties.


Height

Navigation: Reference > Report Objects > Common Properties >

Height

 Print this Topic Return to chapter overview

This property specifies the vertical size of the object in the Units you have specified. During the design phase you can generally control the size of an object directly by clicking on it (small control blocks will be displayed around the object), grabbing one of the blocks with the mouse (click on the block and hold down the left button), and stretch or shrink the object as desired.

See also Left, Top and Width.


Left

Navigation: Reference > Report Objects > Common Properties >

Left

 Print this Topic Return to chapter overview

This property specifies the position of the left edge of the object offset from the left side of the band where it is located. The far left position is 0. During the design phase you can generally control the location of an object directly by clicking on it (small control blocks will be displayed around the object), holding the left mouse button depressed and move the object as desired. Once it's located where you want it release the left button and this value will be updated automatically.

See also Height, Top and Width.


Name

Navigation: Reference > Report Objects > Common Properties >

Name

 Print this Topic Return to chapter overview

The name of the object you have placed on the Report Form. In most cases this can be ignored since you cannot access the properties of the Report Form at runtime. However, if the object has access to the OnPrint property, this is the value you will use when referring to the object in the Setup_Report_Buff command.


OnPrint

Navigation: Reference > Report Objects > Common Properties >

OnPrint

 Print this Topic Return to chapter overview

This is a special property that will display above the normal OI (object Inspector) if it applies to the object you are editing. Generally, this would be all objects that actually print and doesn't include the bands themselves.

The OnPrint process is made up of two parts:

1. Make sure the OnPrint Control Flag check box is checked.

2 Make sure that you have a defined field by the name of the object (and/or options).

EXAMPLE

In the case above, assume that the "Tax" field is in the Region named "regTax". If there's no tax on the order you may, or may not want to print the region. Now, when you're setting up the data for the report the output lines might look something like this:

Define Regtax type a size 3

Regtax = 'OFF' // make is invisible

OUTPUT_REPORT_DATA RB_NUM 1

Define RegtaxCL type a size 10

RegTaxCL = '[RED]' // Change Background of the Field to Red

OUTPUT_REPORT_DATA RB_NUM 1

Define RegtaxLT type I

RegTaxLt = 100 // Put the Tax Reg 100 to the Left

OUTPUT_REPORT_DATA RB_NUM 1

Note: If you add the Options you can control other characteristics:

Extension What it does

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

LT Changes the Left Position.

TOP Changes the Top Position

CL Changes the Font Color

WD Changes the Width

HT Changes the Height

FN Change the Font

FC Changes the Color of the Font


Pen

Navigation: Reference > Report Objects > Common Properties >

Pen

 Print this Topic Return to chapter overview

This property controls what the box that surrounds an object will look like.

Each Pen property has 3 subproperties. These are:

Color - What color the box will use when displayed.

Style - The box can be sold, variations of dashed lines, or blank - the box won't appear at all.

Width - The width of the box line in pixels.

If you don't want the box to be printed at all set either the Color to White or the Style to blank. Setting the Width to 0 will still print a very narrow line.


PrintHeight

Navigation: Reference > Report Objects > Common Properties >

PrintHeight

 Print this Topic Return to chapter overview

This property determines whether the band will always be the exact size you specified, or whether you want to allow the band to increase or decrease as necessary. The two options are phStatic (always print the same height) and phDynamic (print the height needed). Generally you will leave this as phStatic unless you have TppRegions in your band that may or may not print. In that case you would probably want this to be phDynamic so that you don't have a large blank area.

NOTE: If you have TppSubReports that are part of the band you can still make this phStatic. The SubReports each have their own band that controls how they print.


PrintPosition

Navigation: Reference > Report Objects > Common Properties >

PrintPosition

 Print this Topic Return to chapter overview

This property can be used to specify exactly where on the page the band should print. If the current print position is after the value specified here then the band will start on the following page. The position is calculated from the top of the page and is in the same units as the report.


ShiftWithParent

Navigation: Reference > Report Objects > Common Properties >

ShiftWithParent

 Print this Topic Return to chapter overview

If you have a TppDBText object in a band with the WordWrap and AutoSize both checked and, if the band the object is placed on has it's PrintHeight property set to phDynamic, this property (ShiftWithParent) will control whether this object will print in the same relative location as you have it designed.

For example, if you have a TppDBText object designed as a single line on the report form, and, another TppDBText object follows it, directly underneath. Two possibilities could occur:

1. If the ShiftWithParent property is not checked for the second TppDBText then it will print over the previous object.

2. If the ShiftWithParent property is checked the second object will print directly under the first as you expected.

The default value is unchecked.


Tag

Navigation: Reference > Report Objects > Common Properties >

Tag

 Print this Topic Return to chapter overview

Each object has this property. In some Report Objects this property will be used to connect with the Setup_Report_Buffer, Output_Report_Data and Update_Report_Data commands. If it is used in that manner the property will be covered in the object instead of here. If you're here this property can be ignored.


Top

Navigation: Reference > Report Objects > Common Properties >

Top

 Print this Topic Return to chapter overview

This property specifies the position of the top edge of the object offset from the top of the band where it is located. The far top position is 0. During the design phase you can generally control the location of an object directly by clicking on it (small control blocks will be displayed around the object), holding the left mouse button depressed and move the object as desired. Once it's located where you want it release the left button and this value will be updated automatically.

See also Height, Left and Width.


Transparent

Navigation: Reference > Report Objects > Common Properties >

Transparent

 Print this Topic Return to chapter overview

If this property is checked anything behind the object will be visible where the object has blank spaces.


Visible

Navigation: Reference > Report Objects > Common Properties >

Visible

 Print this Topic Return to chapter overview

If this property is checked the object or band will print as you would expect. Normally you would leave this checked. However, if you want to keep the item from printing, and, in the case of a band all the objects on that band, without deleting it, this is a quick and easy way to do that. Just uncheck the property and nothing will print.


Width

Navigation: Reference > Report Objects > Common Properties >

Width

 Print this Topic Return to chapter overview

This property specifies the horizontal size of the object in the Units you have specified. During the design phase you can generally control the size of an object directly by clicking on it (small control blocks will be displayed around the object), grabbing one of the blocks with the mouse (click on the block and hold down the left button), and stretch or shrink the object as desired.

See also Height, Left and Top.


General Information

Navigation: Reference > Commands >

General Information: Commands

 Print this Topic Return to chapter overview

The following format is used in documenting the TAS Professional commands.

The commands are listed in alphabetical order.

The first paragraph of each command reference section is a brief definition of each command and what it does. This provides a quick insight into the command, and what you might use it for.

Next comes a list of each part for the command. Parameters and options are separated by semi-colons; refer to the explanations below for more details on typical command elements. This is not necessarily the true syntax for the command but just a listing of options with the appropriate names.

Each command part is described, along with the purpose, valid values, default value (if applicable), consequences, and whether or not the part is required.

NOTE: Only the required items are noted as such. If it isn't marked as Required then it is optional.

NOTE: There are many commands and options in 5.1 and previous that have no usage in TAS Professional programs. In those cases we have removed those commands/options from this manual to eliminate confusion. Most of those commands are still available in this version. The TAS Professional 5.1 manual is available in PDF format if you wish to go back and investigate those commands/options.

The variable portion of a command can consist of the following:

f/c/e

Field/Constant/Expression. You can use any type of field or constant. This can consist of alpha or numeric constants, any type of field or variable field. This can also be an expression that results in the proper type of field. Some options allow you to include multiple values, e.g.:

start_value - f/c/e1,f/c/e2,...,f/c/ex (in the RDA - read array - command)

From one to eighty values may be included. Generally, the 1024 character line length rule will be broken before the maximum number of fields can be used. In any situation where different limits apply the documentation so indicates.

file_num

When a file is opened in TAS Professional the OPENV command returns the file number or handle. You will always store that in a regular field since you don't know, before you open the file, what the value will be. When you use this value in the other file commands (EXPORT, SAVE, DEL) you will add the '@' symbol before the field name. For example, in the SAVE command, if you stored the file_num value in FILE_HANDLE the command would be:

SAVE @FILE_HANDLE NOCNF

There are other open and find commands that are previous to this version, however, using the file_num is the preferred method and is the only one documented here.

flist

In any option, in almost any command that would normally allow a list of field names or expressions, you may use an array of F type pointers instead. In that case you would use the special modifier flist and follow it with the name of the F type pointer array field. For example, in the EXPORT command you need to specify a list of from fields. Instead of actually listing those fields you may set an array of F type pointers to point to each one and then in the command use the following:

EXPORT flist fptr_array

This will have the same effect within the program as though you had named each one of the fields individually.

NOTE: You must use an array of F type pointers only. P type pointers cannot be used. The array that you use must be at least one longer than the maximum number of elements you are going to use. To get around the problem of how to access a specific element in an array field using this process you should note that any single field--array element or not--can be added (the ADD command) to the field list in a program. All you need to do is include the array specifier in the field name and a slot will be created for that element. The command will return the fptr value appropriate for that particular element, and you can use it as you would any other fptr.

fn/v

Field name/Variable field. In certain commands/options you must use the actual field name or a variable field. Some options allow multiple fields, e.g.:

TO fn/v1, fn/v2,..., fn/v3 (in the RDA - read array - command)

You may include only one field reference or up to 80. Generally, the 1024 character line length rule will be broken before the maximum number of fields can be used. In any situation where different limits apply the documentation so indicates.

key_expr

You may define the key number to be used in a command in several ways:

number - The actual number of the key, as defined in the data dictionary, may be used preceded by an "at" sign (@). @3 refers to the third key in the appropriate file (the first key is 1).

key name - The name of the key as assigned in the data dictionary may be used. dict_overlay refers to the key name.

no key - If you do not want to use a key but want to access the file through the direct method then use the "no key" symbol, the number 0 preceded by an "at" sign (@). @0 tells the program to use the direct access method when searching this file. This is the default method when you have opened a non-TAS file.

label

This option is a line label. A line label is the only item on the line, is no more than 14 characters long and must end with a colon (:). A label is a form of a special alpha constant (sac). An example:

START:

This label is used within a command by using the name but dropping the colon, e.g.:

GOTO START

If you use a label name that doesn't exist within the program the compiler will give the appropriate error message at the end of the compilation process.

NOTE: In the Program Editor you have the opportunity to receive a list of label names used within the program at the appropriate times.

lexpr

An expression that will resolve to a logical value of .TRUE. or .FALSE. For example:

fld1 = 100

another example:

(fld1 = 100 .and. fld2='ABC') .o. fld3=.F.

The logical expression:

fld1=100 .or. 200

is not legal. You cannot compare to more than one value at a time. This expression should be written:

fld1=100 .o. fld1=200

sac

Special Alpha Constant. This is an alpha constant that is not surrounded by quotes. It must start with an alphabetic character (A-Z) but may contain numbers, periods or the underline character. One form of this is a line label. Another is the name of a user defined function or user defined command. Unless otherwise stated, case is ignored and the maximum length will be stated, although 14 characters is generally the maximum.

scope

Use this option, along with the scope_expr to limit the number of records accessed. The scope options are:

A (All) - Access all records, this is the default

F (First) - The program will find the first record in the file and then access the next xxx number of records depending on the scope_expr.

N (Next) - The program will start with the current record or if no record is active will find the next record in the file. It will then continue with the next xxx number of records depending on the scope_expr.

R (Rest) - The program will start with the current record or if no record is active will find the next record in the file. It will then continue until the end of the file.

scope_expr

Use this option to determine how many records to read. The options available for scope_expr are: A (all), F (first), N (next), R (rest). In the case of F and N you also specify the number of records to be read (e.g., N 100). For example, if you want to restrict a search to the first 100 records the entry for the scope_expr would be:

F 100

If the scope is set to N and a record is active the program will start with that record. If a record is not active the program will get the next record before continuing.

snc

Special Numeric Constant. This is an integer constant. Its range depends on its use. For example, when used in the DEFINE command it may be 1 to 4gb (field size), or 0 to 8 (number of decimal characters).

udf

Some options require UDFs (User Defined Functions) as the possible entry. What is expected and the required returns are described.

set_option

In this situation your choices are to include the option name or leave it off. The command documentation explains first the default situation (what will happen if you don't include the option), and then what will happen if you do include the option. Generally, including the option will keep something from happening. For example:

SAVE file_name/@file_num NOCNF NOCLR

In the SAVE command above, the NOCNF option tells the program not to ask the user before saving the record. The default case is to ask before saving. The NOCLR option tells the program not to clear the record buffer (and record number holder) after saving so that the information just entered into the record is still there, perhaps to be used as default values during the following operations. The default operation is for the program to clear both the record buffer and number holder after saving.

In the command documentation, these set_options are shown in italic, capital letters.

Each OPTION within the command will be described fully.

The true SYNTAX for the command is completely described. The command name and options are in BOLD CAPS. The user specified parts are in italics.

In some commands there is a special USER INTERFACE. In these situations it is described.

Special COMMENTS or restrictions are given where applicable.

SEE ALSO will list the commands/functions that are related to the command being explained.

If any EXPRESSION FUNCTIONS (not to be confused with the function of the command but a type of command that can be part of an expression) are included in the explanations they will be in bold face with parentheses at the end of the name, e.g., FUNCTION(). Even though the function may have arguments that can be included, it will be shown with no arguments within the parentheses. For more information on the function and what arguments may be used, please refer to that function's documentation.

NOTE: Spaces between multiple entries for an option are for appearance purposes only. For example: f/c/e1, f/c/e2,..., f/c/ex need not have any spaces between the commas and the preceding or following fields. However, options within a command need to be separated by at least 1 space.

EXAMPLES may also be given.

If any other command names are displayed (other than the title) within an explanation they are given in actual syntax in bold format followed by an explanatory title surrounded by parentheses, e.g.,

... in the RDA (Read Array) command ...


{...} (Code Process Controls)

Navigation: Reference > Commands >

{...} (Code Process Controls)

 Print this Topic Return to chapter overview

These single character commands will allow you to group appropriate code together without worrying about program flow.

x = UserUDF(y)

{

func UserUDF UUDFVar

ret UUDFVar+5

}

When the program is running it will execute the = (EQUAL) command but will skip all other commands after the = until the next command after the }. However, the commands within the braces are not invisible. They are still executed as part of the UDF. The only purpose for these controls is to keep related code together within your program.


Activate Form

Navigation: Reference > Commands >

Activate Form

 Print this Topic Return to chapter overview

Use this command to force a form active that has been previously loaded with the LOAD_FORM command.

ACTIVATE_FORM f/c/e Required - The name of the form to be activated or loaded. NOTE: This is the internal name. Get this value from the GET_FORM_NAME() function.

COMMENTS

The effect of this command would be the same as if the user clicked on an object on the non-active form. The mouse will be placed in the object listed as first on the form (see TTASForm for more information).

Sample code

define x type a size 20

x = GET_FORM_NAME()

// x = 'EditForm1'

ACTIVATE_FORM X //THIS WILL ACTIVATE X

ACTIVATE_FORM GET_FORM_NAME()//THIS WILL USE THE CURRENT FORM

SEE ALSO

ENABLE_ALL, DISABLE_ALL, RELEASE_FORM


Add

Navigation: Reference > Commands >

Add

 Print this Topic Return to chapter overview

This command will add fields to the internal field list. These fields may be a part of a file that has been opened or just for stand alone purposes. This file could have been specified in the original program or could have been opened during the execution of the program. Once the field is added you can access it almost as though it had been named in the original program. An 'F' type pointer is returned and by using the field redirector (&) you can access that field for any purpose, including = (EQUAL).

ADD f/c/e Required - The name of the field being added. Must conform to standard field name requirements.

TYPE f/c/e Required - The type of the field being added. Must conform to standard field type requirements.

SIZE f/c/e The display size of the field being added. Must conform to standard field display size requirements. If this is not included then the default values for the type of field is used.

DEC f/c/e If the field is of type N you can specify the number of decimal characters. If this isn't included the default value is 0. This could affect the displayed value of the field. Because of this, you should take great care to make sure the proper value is used.

ARRAY f/c/e The number of array elements for this field.

UP f/c/e If this is a type 'A' field you may specify whether all characters entered to it are to be automatically forced into upper case. To accomplish this, make this value 'Y'.

FILE file_num The file number/handle for the field being added if it is part of a record.

KEY f/c/e If this field is a key you can specify the key number here.

OFST f/c/e If this field is part of a record then this is the starting location within the record. The offset value for the first field in the record is 0.

NOTE: In the TAS Professional data dictionary the offsets for the fields are properly set for this option; i.e., the first field in the record has an offset value of 0.

FPTR fn/v Required - The field that will receive the pointer to the field being added. Since you cannot access the field by name (it isn't known before being added), this pointer is returned and will allow you to execute all required commands through the use of the field redirector. For example:

ADD ... FPTR fldptr[cntr] ...

where fldptr is of type F and an array. Cntr is an integer (type I) field that is set to the appropriate value. The field can be used later in an EQUAL command:

&fldptr[cntr] = 'ABC'

COMMENTS

A basic concept in every TAS Professional program is that all fields have been specified when the program is compiled. This restricts the possibilities of what might be done. To get around this limitation this command has been added. If the field being added is NOT from a file the program automatically allocates data space for it from that remaining available. This DOES NOT take space from the temporary data space used when resolving expressions.

NOTE: You need to specify, within the source file, how many 'extra' fields can be added at runtime. This is done through the use of the #ADD_FLDS compiler directive. For more information please see the section in Chapter 4, Compiler Information on Compiler Directives.


Allocate Field

Navigation: Reference > Commands >

Allocate Field

 Print this Topic Return to chapter overview

Use this command to change a field previously defined within a program. This command will work only with DEFINE'd fields. The command will allow you to change any part of the field: size, type, etc., even the number of array elements. It is generally used in situations where you don't know how large a field you might need and don't want to take up space before it is needed. Also, you can REMVA (Remove Array) an allocated field during runtime. This capability is useful when you know you need to chain to other programs and might not have enough room if the field is at a set size.

ALLOC fn/v Required - The name of the field being allocated. This field must be previously defined within the program.

TYPE f/c/e Required - The type of the field being allocated. Must conform to standard field type requirements.

SIZE f/c/e The display size of the field being allocated. Must conform to standard field display size requirements. If this is not included then the default values for the type of field are used.

DEC f/c/e If the field is of type N you can specify the number of decimal characters. If this isn't included the default value is 0. This will affect the displayed value of the field and you should take great care to make sure the proper value is used.

ARRAY f/c/e The number of array elements for this field.

UP f/c/e If this is a type 'A' field you may specify whether all characters entered to it are to be automatically forced into upper case. To accomplish this, make this value 'Y'.

COMMENTS

Typically you would include a group of single character alpha fields in a program. At time of need, these fields could be changed using this command. To see if the command succeeded, check both the size of the field and the number of array elements allocated using the appropriate functions available. These fields are allocated into available memory and DO NOT take any space away from temporary data space used while resolving expressions. You want to start with as small a field as possible since the space originally used by that field will be unusable.

SEE ALSO

REMVA, ALOCARY()


Ask

Navigation: Reference > Commands >

Ask

 Print this Topic Return to chapter overview

This command displays a standard Windows dialog box with Yes and No buttons.

ASK f/c/e Required - You may use this in two ways. It can be an A type field and the program will display the field as the message. It can also be a numeric value (any appropriate type), and the program will read the appropriate record in the ERRMSG.B file. The value you set must relate to the ERROR_NUM field in the ERRMSG record.

DFLT f/c/e The normal default response to this command is .TRUE.. This would be the case if the user pressed just the RETURN or ENTER key without entering a value. If you would like the default response to be N (.FALSE.) then this value must be set to .FALSE.

CAPTION f/c/e You can replace the caption of the box using this option. If you don't specify a caption the word "Ask" will be displayed.

USE f/c/e This option will allow you to override the buttons you have setup in the TP7SETUP program.

LEFTBUTTON f/c/e This option allows you to change the caption on the left button. NOTE: The result if the user clicks on the left button will still be True in the ASK() function.

RIGHTBUTTON f/c/e This option allows you to change the caption on the right button. NOTE: The result if the user clicks on the right button will still be False in the ASK() function.

COMMENTS

You can test the user's response to the message through the ASK() function. If the ASK() function returns .TRUE. the user answered Y to the question; if .FALSE., N.

If you change the LEFTBUTTON or RIGHTBUTTON values the button widths will be automatically reset and the buttons repositioned on the dialog box.

ASK f/c/e CAPTION f/c/e DFLT f/c/e LEFTBUTTON f/c/e RIGHTBUTTON f/c/e USE f/c/e

SEE ALSO

ASK()

EXAMPLE CODE

This code with create the dialog box that follows.

ask 'Do you want to save the record?' dflt .false.

You can override the TP7SETUP settings through the use of the USE option. If you have the Yes/No option chosen in Setup, but want to use Ok/Cancel for this question, then you would change the example above to look like:

ask 'Do you want to save the record?' dflt .false. use 'ok'

And, to go from Ok/Cancel to Yes/No you would change that to:

ask 'Do you want to save the record?' dflt .false. use 'yes'

ASK f/c/e CAPTION f/c/e DFLT f/c/e LEFTBUTTON f/c/e RIGHTBUTTON f/c/e USE f/c/e


Bell

Navigation: Reference > Commands >

Bell

 Print this Topic Return to chapter overview

This command will cause the speaker to beep.

BELL

No options


Case

Navigation: Reference > Commands >

Case

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will control whether a command, or group of commands will be executed. This is one part of a complete command structure.

CASE c Required - Must be an integer value. If the value corresponds to the result in the SELECT command, the command lines between the CASE command and the next CASE, OTHERWISE or ENDC (Endcase) command will be executed

COMMENTS

For more information on the different structured programming commands, and the CASE command in particular, please see Structured Programming Commands. If you are missing an ENDC (End Case) command in a SELECT/CASE structure you will get the If without Endif error message during the compile process.

SEE ALSO

SELECT, OTHERWISE, ENDC


Case End

Navigation: Reference > Commands >

Case End

 Print this Topic Return to chapter overview

This is the end point of the process control command SELECT/CASE/ENDC.

ENDC No options / No modifiers

COMMENTS

For more information on the different structured programming commands, and the ENDC command in particular, please see Structured Programming Commands.

NOTE: If you are missing an ENDC (End Case) command in a SELECT/CASE structure you will get the If without Endif error message during the compile process.

SEE ALSO

SELECT, ENDC, OTHERWISE


Case Otherwise

Navigation: Reference > Commands >

Case Otherwise

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will control whether a command, or group of commands will be executed. This is one part of a complete command structure.

OTHERWISE No options / No Modifiers

COMMENTS

For more information on the different structured programming commands, and the OTHERWISE command in particular, please see Structured Programming Commands.

SEE ALSO

SELECT, CASE, ENDC


Case Select

Navigation: Reference > Commands >

Case Select

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will control whether a command, or group of commands will be executed. This is one part of a complete command structure. This command is the first part of a CASE structure.

SELECT f/c/e Required - This must resolve to an integer type value that will be used as the comparison value by each of the subsequent CASE commands.

COMMENTS

For more information on the different structured programming commands, and the SELECT command in particular, please see Structured Programming Commands.

NOTE: If you are missing an ENDC (End Case) command in a SELECT/CASE structure you will get the If without Endif error message during the compile process.

SEE ALSO

CASE, OTHERWISE, ENDC


Chain

Navigation: Reference > Commands >

Chain

 Print this Topic Return to chapter overview

Use this command to execute another TAS Professional program.

CHAIN f/c/e Required - The name of the program to run. This needs to include the path also, if any.

WITH f/c1,f/c2,...,f/cx A list of field values to be passed to the program. The receiving program can test for these with the PARAM (Parameters) command.

NOTE: You may pass only actual fields or constants; expressions are not allowed. Also, see the RESET option in the DEFINE command about another way of doing this. For those who are familiar with previous versions of TAS Professional, passing constants was not allowed.

NEWRUNTIME If this is specified a new instance of TASRUNTIME will be created before the program is run. This will allow the user to continue running other programs rather than being tied up waiting for this program to finish. The perfect use of this option is when you're printing a large report that will take a long time to complete and wish to have it execute in the background.

NOTE: there are two things to consider here If you Launch a program with new runtime the chain command act's like a GOTO Absolute without using newruntime the chain command becomes a gosub

COMMENTS

The original program, upon returning from the "chained-to" program, will continue execution at the next line. All data files previously opened will still be so, and all data will be available (except for that data appearing strictly in the chained-to program). There is no limit as to the depth, i.e., how many programs can CHAIN, one to the next.

If you include WITH fields/constants in the command the receiving PARAM command in the CHAINed to program can use (and, in the case of constants, must use) different field names. See example below.

NOTE: If the program you are CHAINing from is specified as the MainMenu (see Compiler Directives) then when you CHAIN to another program you should immediately do a RET. When the CHAINed program exits it DOES NOT return to the MainMenu program. This allows you to CHAIN to multiple programs without the control listed below.

NOTE: When a 'normal' (not MainMenu) program CHAINs to another, the user cannot access the original program until the CHAINed to program exits. This protects the programmer from having to worry about what the user might do with the original program before returning from the CHAINed program. It's almost like the CHAINed to program is loaded in modal form, but only for the previous program. It doesn't effect any other programs that have been loaded, unless they're previous in the same chain.

NOTE: You must not execute a CHAIN command from within a UDF. If you do, the program will not return to the proper location, and you will probably get an AV (Access Violation).

NOTE: You must not execute a CHAIN when you are in a PRE event.

NOTE: If you have specified the NEWRUNTIME option that program will continue running until you QUIT within the program or until the user closes the screen (if appropriate).

NOTE: You can include the WITH option when you have specified NEWRUNTIME, however, the RESET and ROPEN commands will have no effect since this is a totally separate instance of TASRUNTIME.

NOTE: FAQ Question : Is there a way to cancel/ESC once you have loaded SET_PRINT_BUFF command as it seems traps cease to operate after this command. What I am trying to do is abort from initial stages of a print job.

REASON : The reason for this problem is that when you're executing lines in a TAS Pro program the user cannot have any input. This includes keyboard and form (clicking on buttons, etc). This is why you don't want to create a loop that doesn't end or RET . If you do, the user will never gain control again.

The option: NEWRUNTIME. When this option is included in the chain command it will actually create a new instance of TASRUNTIME.EXE. You can still pass values to the program using the WITH option, however, you cannot pass values back, or access files already opened, etc. And, when the program is finished (either reaches the end of processing and you use a QUIT command, or the user closes the form) The new instance of TASRUNTIME is automatically closed also. IN FACT, (VERY IMPORTANT!!!) by making this change your users will now be able to click on buttons on the form, etc. So, if you want to put a Cancel button on the form, you can.

So, what's the downside? Besides not being able to access data in other programs or previously opened files, and perhaps, running out of memory or resources, is that the form that is displayed on this new instance can get hidden behind the current main menu (depending on the size of the main menu form). Obviously, the new instance form can be moved anywhere on the desktop.

SEE ALSO

PARAM

EXAMPLE CODE

//in Program A you might have:

x = y+5

chain 'C:\TEST PATH\PROGRAMB' with x,'ABC',999

ret

//in Program B you would have:

PARAM z, s, i

chain 'bksoa.rwn' with bkarcust.code

chain 'bksoa.rwn' newruntime with bkarcust.code


Change Dictionary Path

Navigation: Reference > Commands >

Change Dictionary Path

 Print this Topic Return to chapter overview

This command will change the default dictionary path to a different location.

CDPATH f/c/e Required - The new path for the dictionary. The path is automatically terminated with a final backslash (\).

COMMENTS

This command will NOT affect the dictionary used during compilation. That value defaults to the path specified in Set Configuration.


Clear File Buffer

Navigation: Reference > Commands >

Clear File Buffer

 Print this Topic Return to chapter overview

This command will clear the internal record buffer for a particular file.

CLR file_num Required - The number/handle of the file to be cleared.

what-to-do BUFF - Both the record number holder and the record buffer are cleared. This is the default option.

REC - The program will clear just the record number holder, effectively setting the record internally as not active.

COMMENTS

If a record is active in memory, there is data in both the buffer and record number holder. If this record is saved to disk it will update the record currently at that record number. If the record number holder is cleared, the program will save a new record. Through the use of this command, if you clear just the record number holder, you can set up a process where some or all of the previous record can be used as default values for the new record and still save a new record when the SAVE command is executed.

NOTE: If you are using Pervasive (Btrieve), when a record buffer is cleared, either during this command or OPENV (Open File), SAVE or DELETE, the buffer is set to binary 0s. However, if you are using CodeBase the values will be set depending on the type of field in the record.

NOTE: If you specify the file number you must preface the variable with the '@' symbol, e.g.: @bkarcust_hndl.

Example code

Save bkarcust //this would be used with the OPEN command.

Save @bkarcust_hndl //this would be used with the OPEN command.


Clear Program Error

Navigation: Reference > Commands >

Clear Program Error

 Print this Topic Return to chapter overview

This will set the value in the internal Program Error Number field to 0.

CLRPE No options / No Modifiers

COMMENTS

The internal Program Error Number field can be set with the ERR command and read with the PERR() function.


Close File

Navigation: Reference > Commands >

Close File

 Print this Topic Return to chapter overview

This command is used to close both TAS and non-TAS files that have been previously opened using the OPENV (Open File) command.

CLOSE file_num Required - The number/handle of the file to be closed.

DEL If the file being closed is non-TAS, you can include this option and the program will delete the file from the disk.

COMMENTS

If you don't close the files before the program exits, it will be done automatically.

NOTE: If you have fields from the file you are closing on a form and that form is displayed or redisplayed, you will receive an error from TAS that the field belongs to a file that has been closed. Unless you have a specific reason to do so,

SEE ALSO

OPENV


Combo Box Items

Navigation: Reference > Commands >

Combo Box Items

 Print this Topic Return to chapter overview

Use this command to add or clear the item string list in a TTASComboBox or a TTASDataGrid column (ComboItems).

COMBO_ITEM

NAME f/c/e Required - The name of the object. If you are updating a column in a data grid this would be the name of the data grid column. You can also update a data grid column template. In that case this would be the name of the TTASDGColTemplate object.

GRID f/c/e If you are updating a data grid column this is the name of the TTASDataGrid object.

what-to-do ADD - Add a new item to the string list. The value to add must immediately follow this option.

CLR - Clear all the strings that are currently in the item list specified.

f/c/e If the option above is ADD this is the value you will add to the item list.

COMMENTS

You can also update the combo box items by using the STRINGS() function.

Example

COMBO_ITEM ADD CLR GRID f/c/e NAME f/c/e

Example 2

The example below shows code on how to read data into the combo box using a scan and the combo_item command.

umcomp.pre: //load the dropdown

COMBO_ITEM CLR NAME 'umcomp'

SCAN @um_hndl KEY UM.TYPE START MAT.UM.TYPE WHILE UM.TYPE = MAT.UM.TYPE

COMBO_ITEM ADD UM.NAME NAME 'umcomp'

ends

//This forces the dropdown to dropdown whne the user enter the combo box it has to be after the //COMBO_ITEM command you cound also trap this if you needed to like with trap F2 gosub dropdown2

set_object 'umcomp' property 'dropdown' value true

ret

dropdown2:

set_object 'umcomp' property 'dropdown' value true

ret


Company Code

Navigation: Reference > Commands >

Company Code

 Print this Topic Return to chapter overview

This command will get or set the two letter extension on files to be used as company codes (e.g., for use with Computer Accounting Solutions' accounting products).

CO f/c/e Required - The new three letter extension. If this is a GET operation then this must be a fieldname or variable field (fn/v).

what_to_do GET - The program will get the current company code value and put it into the co_code field.

SET - The program will set the company code default value to that in co_code (this is the default option).

COMMENTS

Accounting software products written in TAS Professional can handle multiple companies, and use a three character extension on files to indicate different companies' data. For example, the master inventory file for company #57 might be BKICMSTR.B57.

Once you set this value it is used as the extension for all TAS files opened unless otherwise overridden.

NOTE: You should have a set of records in FILELOC.C with the proper company code value for each company you have active. For more information about this topic, please refer to Main Menu - Utilities.

NOTE: In FILELOC.C all files have extensions of either B+the company code (for Btrieve files) or C+company code (for CodeBase files). You can specify the two characters that make up the company code with this command. You can also set the beginning company in the Set Configuration program. If you are using the Pervasive file manager (Btrieve) then the files will actually have the extension of B+company code. If you are using CodeBase the files have set extensions (DBF, DBT & MDX) but we use the C+company code in FILELOC.C to keep track of the different companies. Also, since the CodeBase files have the save extension, you must put each set of company files, if any CodeBase files are involved, in its own subdirectory.

SEE ALSO

CO()


Compiler Directive

Navigation: Reference > Commands >

Compiler Directive

 Print this Topic Return to chapter overview

This command will give the compiler instructions that are necessary only during compilation of a program.

#sac Required - This is another form of the special alpha constant. It may or may not also have a numeric constant (value) as a part. The options are:

ADD_FLDS - This is no longer needed and is ignored by the compiler. The internal field buffer will expand as necessary.

ALL_LOC - Specify that all fields defined are LOCAL. Still requires the PROC and ENDP compiler directives before this directive takes effect.

DONTCOMPILE - The program will cease attempting to compile this program and will continue with the next source file if you are compiling a group of files. This should be at or near the top of the source file and before any forms or reports are specified.

ENDP - Specifies the end of a Procedure that is started with the PROC directive. Used in connection with LOCAL

FMT - This tells the compiler that you have included screen/report forms in the TAS 3 style.

FORCERWN - The compiled programs in TAS Professional have the extension of .RWN and are 'true' Windows programs, just not compiled to .EXEs. Previous to this version the programs had the extension .RUN and very different characteristics. Any program that includes the WINFORM compiler directive is automatically compiled as a RWN program. However, there may be situations where you don't have a screen/form for a program and still want to create a RWN file. By including this compiler directive the compiler will create a RWN file.

FORMSENCRYPTED - In TAS Professional the forms are separate from the compiled program. This allows the user to make changes to the form, if desired, without having to modify the program. In some cases you may not want the user to be able to do this. If that is true, you would include this compiler directive and, following FORMSENCRYPTED you would include an alpha constant that would be used during the encryption process to lock up your forms. The longer the constant the better the encryption.

NOTE: Even if you give the encryption string to the user they still wouldn't be able to unencrypt the file due to protections in TAS Professional itself, and that we don't provide any way to unencrypt a file once it's encrypted.

NOTE: If you encrypt one form or report in the program then all must be encrypted. They will all use the same phrase. DO NOT put any spaces between the words or the characters in the encryption phrase.

INC - A named source file to be compiled and included in the run program. The difference between INC and LIB is that the file specified here is included completely in your final program, where only the parts needed are included from the LIB file.

INCX - Same as INC above, except the code has been encrypted. This will allow you to keep certain parts of your program secret while still giving the user enough code to make changes to their programs. Please refer to Encrypt File for more information about securing your source code.

LIB - Specify a library of commonly used routines. At the end of the compilation process if the compiler is still missing pieces it will look here. If an extension is not given for the library file name it is assumed to be '.LIB'. If no path is given it is assumed to be in the user's current directory.

NOTE: In previous versions you could put angle brackets (<>) around the library name and the compiler would look in the TAS Professional location for the library. That no longer works.

LIBX - Same as LIB above, except the code has been encrypted. This will allow you to keep certain parts of your program secret while still giving the user enough code to make changes to their programs. Please refer to Encrypt File for more information about securing your source code.

MAINMENU - If the program is to take the place of the default main menu in the runtime you would include this compiler directive. If there is already a program running that is effectively the main menu this directive will be ignored.

PROC - Alerts the compiler that all DEFINE fields from this point until the corresponding ENDP directive that have the LOCAL option set are available to this routine only. The routine is made up of the commands between the PROC and ENDP compiler directives. Without the PROC directive the LOCAL option will be ignored.

NOTE: If the ALL_LOC directive has been previously encountered then all DEFINEs until the next ENDP will automatically be set to LOCAL.

TDATA - Amount of temporary data to allocate for this program in bytes. This is the data used for calculations, etc. If you are doing large recursive calculations on alpha type fields you will want to increase this value. It defaults to 64k if you don't include this directive and, in most situations, that is plenty.

UDX - Both UDCs and UDFs are allowed.

WINFORM - This is the name of a Windows screen/form. Each form you load in a program has to have a separate line specifying the form name. The forms (.DFM & .DCY) should be in the same subdirectory as the source during compilation. The first WINFORM command in the program denotes the default form. This is the one loaded automatically when the program is run.

WINREPORT - This is the name of a Windows report form. The report form (.RTM & .RCY) should be in the same subdirectory as the source during compilation. This is not required for reports, however, if you use fields in your report that you don't use elsewhere in the program, you will get a "Field Not Found" error when the report is run if you don't include this directive in the program.

COMMENTS

For more information on Compiler Directives please refer to Compiler Info.

EXAMPLES


Cursor

Navigation: Reference > Commands >

Cursor

 Print this Topic Return to chapter overview

Use this command to change the cursor on the screen.

CURSOR

change_to Required -

WAIT - Will change the standard arrow cursor to an hourglass.

DFLT - Will change the cursor back to the standard arrow. Used after setting the WAIT option when whatever process that was taking so long is over.


Data Grid List File

Navigation: Reference > Commands >

Data Grid List File

 Print this Topic Return to chapter overview

This command activates a TTASDataGrid object on the form. It is appropriate when you are using the data grid for an actual file instead of an in-memory array. When you are accessing an in-memory array you would use WLISTM.

WLISTF f/c/e Required - The name of the TTASDataGrid object on the form

SETUP This option would be used when you are first specifying the file, key, etc. Otherwise, you can use one of the display options below and you can reset any of the options originally set here. When this is called the first time certain setup routines are called in the grid and need not be called again.

CLOSE Use this option to remove all the rows from the grid and disconnect the grid from the file. This would only be used if you are going to change the columns from one WLISTF command to another. A good example of this is in WTASDATAM, where the user can close the current file and open another.

FNUM f/c/e This is the file handle/number value that is returned in the OPENV command. If this is during the SETUP process then this is Required option.

NOTE: In this case you DO NOT preface the file number/handle field with the '@' symbol.

KEY key_expr Set this to the appropriate value to list the records in the file in the correct order. If this is during the SETUP process then this is Required option.

START f/c/e1,f/c/e2,...,f/c/ex The value to use as the beginning record. This is similar to doing a FINDV (Find Record) before the command. If the index you're searching on has multiple segments you may list the proper value for each segment, separating them with commas. This will allow you to specify the exact type for each of the segments. For example, suppose you're searching on an index that has two segments: a 5 character alpha and an I type field. Each record you want has the same alpha but the I field will change, and is in order. In the first record the I type field has a value of 0. The following would find the first record for that group, if it exists:

start 'ABCDE',0!

Notice that we separate the values with a comma. The only requirement is that the values be of the same type (and size) as the segments in the key. In this case we put the I type constant specifier (!) after the 0 to make sure that it is passed as an I type field.

FOR lexpr You would use this option to restrict the records displayed in this command. If the expression did not resolve to .TRUE. the record would not be displayed. Any legal expression that resolves to .TRUE. or .FALSE. can be used. Only those records that will resolve to .TRUE. will be displayed. This option will test all the records in the file.

An example of a legal expression would be:

... FOR (x=100) .and. (y=200) ...

WHILE lexpr This option also restricts the records displayed. However, the first time the expression resolves to .FALSE., the program stops checking the records in the file. Here's the benefit of this option: if the program is displaying records in a certain order (by a specific key) and the expression returns .FALSE. then the program knows that all the appropriate records have been displayed and there is no need to continue. For example: You want to display all the invoice records for a specific customer. The first record for that customer is found in the invoice file either by using the start_value option within this command, or through the FINDV (Find Record) command before executing this command. Then the WHILE expression would be:

INV_CUST_CODE = CUSTOMER_CODE

(This assumes that there is a field called INV_CUST_CODE in the invoice file and a like field in the customer file called CUSTOMER_CODE. The KEY option must be set to the proper value so that the records are read in CUSTOMER_CODE order, or you must have set the SRCH command previous to this command.) When the first invoice record for the next customer is read the program will stop deleting records.

NOTE: You must either specify a START value or have a record active before this command is executed. If you don't you may only find a single record before the WHILE kicks in.

display REDISPLAY - Redisplay starting with the first visible record on the grid and continuing from there.

REDISPLAYFROMTOP - Redisplay starting with the first record in the file.

REDISPLAYFROMEND - Redisplay starting with the last record in the file.

UPDATECURRENT - Refresh all the columns in the active record, but this doesn't get the record from disk.

REDISPLAYCURRENT - This assumes that you've changed an index or some other option. It will move the current row to the top of the visible grid and will display all the records that come after it. NOTE: If there are not enough rows to fill the grid and there are rows above what would normally be the top, those rows will be displayed and the nominal top will be moved down. The row cursor will be moved down also.

REDISPLAYACTIVE - This would be used if you have made a record active and want to redisplay the grid based on that record. It will be placed at the top of the visible grid and all records that follow it will be displayed. NOTE: If there are not enough rows to fill the grid and there are rows above what would normally be the top, those rows will be displayed and the nominal top will be moved down. The row cursor will be moved down also.

REFRESHRECORD - Refresh the active record by restoring it from the disk and redisplaying that record only. This also locks the record.

COMMENTS

You will need to execute this command at least once to activate a TTASDataGrid. Once that grid is active all other changes can take place due to the user moving from row to row or through the effect of the DATA_GRID command.

EXAMPLE

A very good example of this command and the DATA_GRID command is WTASDATAM. The source file (WTASDATAM.SRC) should be in the \TAS7 subdirectory depending on where you installed TAS Professional.


Data Grid List Memory Array

Navigation: Reference > Commands >

Data Grid List Memory Array

 Print this Topic Return to chapter overview

This command activates a TTASDataGrid object on the form. It is appropriate when you are using the data grid for an in-memory array instead of an actual file. When you are accessing an actual file you would use WLISTF.

WLISTM f/c/e Required - The name of the TTASDataGrid object on the form

SETUP This option would be used when you are first specifying the counter field, number of elements, etc. Otherwise, you can use one of the display options below and you can reset any of the options originally set here. When this is called the first time certain setup routines are called in the grid and need not be called again.

CLOSE Use this option to remove all the rows from the grid and disconnect the grid from the arrays. This would only be used if you are going to change the columns from one WLISTM command to another.

COUNTER_FLD fn/v This is the field that will be used both internally (in the grid itself) and externally (in your program) to determine which array row is being accessed. Each time the grid returns control to your program this field will have the current array row as its value. If this is during the SETUP process then this is Required option.

ACTIVE_ELEMENTS f/c/e This is the number of rows that currently exist is the array. This will be the number of rows displayed on the grid. If this is during the SETUP process then this is Required option.

MAX_ELEMENTS f/c/e This is the maximum number of rows for the array fields used. Generally, this will be the number of defined array elements for the fields. If this value isn't the same for all fields on the grid then it should be the lowest number of array elements among the fields used.

NOTE: This value must be equal to or greater than the ACTIVE_ELEMENTS value or the grid will not display the rows as you expect. The ACTIVE_ELEMENTS value will automatically be reduced to the MAX_ELEMENTS value.

NOTE: If you are allowing the user to add rows using the grid as an entry device then this value must be more than the ACTIVE_ELEMENTS value or the program will not allow any new rows to be added. Further, the user won't be able to add more than MAX_ELEMENTS in any case.

display REDISPLAY - Redisplay starting with the first visible row on the grid and continuing from there.

REDISPLAYFROMTOP - Redisplay starting with the first element in the array.

REDISPLAYFROMEND - Redisplay starting with the last element in the array.

UPDATECURRENT - Refresh all the columns in the active row.

REDISPLAYCURRENT - This assumes that you've changed multiple values in the array. It will move the current selected row to the top of the visible grid and will display all the elements that come after it. NOTE: If there are not enough rows to fill the grid and there are rows above what would normally be the top, those rows will be displayed and the nominal top will be moved down. The row cursor will be moved down also.

REDISPLAYACTIVE - This would be used if you have set the counter value and want to redisplay the grid based on that value. It will be placed at the top of the visible grid and all rows that follow it will be displayed. NOTE: If there are not enough rows to fill the grid and there are rows above what would normally be the top, those rows will be displayed and the nominal top will be moved down. The row cursor will be moved down also.

COMMENTS

You will need to execute this command at least once to activate a TTASDataGrid. Once that grid is active all other changes can take place due to the user moving from row to row or through the effect of the DATA_GRID command.

EXAMPLE

A very good example of this command is WTASDMGR. The source file (WTASDGMGR.SRC) should be in the \TAS7 subdirectory depending on where you installed TAS Professional.


Data Grid Update

Navigation: Reference > Commands >

Data Grid Update

 Print this Topic Return to chapter overview

Use this command to manipulate the columns in a TTASDataGrid object on the form.

DATA_GRID f/c/e Required - The name of the TTASDataGrid object on the form

MOVECOLUMN Move a column to the first column position. All columns after that will be moved one to the right.

SHIFTCOLUMN This will exchange two columns in the grid. The column specified by NAME will be exchanged with the column specified in TO.

CLEAR Remove all the columns from a grid. If the grid is active you should use the appropriate CLOSE option in WLISTF or WLISTM before this option.

GOEDIT Put the grid in edit mode. This means you will allow the user to change values in the columns for a particular row or record. The user must move from the row being edited to a different row (even if it means adding a new row) before the changes are saved to a record or the array element.

GOROWSELECT Change from edit mode back to row select mode. In this mode the select bar will stretch over the entire row and the user will not be able to make changes to individual column values.

NEWCOLUMN Add a new column to the grid using the TEMPLATE option to specify the column to add and NAME for the column name.

GETCOLUMN Get a copy of a column in the grid and put it in the TEMPLATE object. This will not remove the column from the grid, just gets a copy.

DELETECOLUMN Remove a column from the grid. You must specify the name of the column to be removed in the NAME option.

UPDATECOLUMN Using the TEMPLATE object update the values in the column specified in the NAME option.

GETARRAYFLDS Use this option to get an array of the field names in current column order. These values will be saved in the field specified in RECVFLD. The receiving field must have enough array elements to store all the column fields or you will receive a single field with the value 'Need more elem'.

GETARRAYCOLS Use this option to get an array of the column names in current column order. These values will be saved in the field specified in RECVFLD. The receiving field must have enough array elements to store all the column names or you will receive a single field with the value 'Need more elem'.

ADDROW Add a new row to the end of the grid list. This should be used for both Array Lists (WLISTM) and File Lists (WLISTF). NOTE: Must have GoRowSelect set to true or RWN program may hang. See Example 2

INSERTROW Insert a new row at a point in the grid list. This only applies to Array Lists (WLISTM). If you want to specify a row to be inserted before then put that row number in the NUM option (see below). If there is no NUM option specified the row will be inserted before the current active row. NOTE: Must have GoEdit set to true or insert will not occur. See Example 2

DELETEROW Delete a row from either a Array List (WLISTM) or File List (WLISTF) grid. This will allow you to delete a row (including the appropriate array elements or record) by program control. This would be the same as if the user pressed the DEL key. See Example 2

MOVETOROW Move the cursor to a specific row in the list.

NOTE: You can only move to a row displayed on the screen. This is not the method to move to a specific row in the file or array. For example, if there are only 10 rows displayed on the screen then you can only move to rows 1 through 10. If you want to move to a specific row in the file/array then make that record active and do a WLISTF .... REDISPLAYACTIVE or reset the counter value and do a WLISTM .... REDISPLAYCURRENT or REDISPLAYACTIVE.

SAVEGRIDREC Use this option to save the current active record to disk. This would save the record even if the user doesn't move to a different row. Works only with WLISTF type grids.

DELETEGRIDREC This is similar to DELETEROW above, except that you don't need to specify the Row value. It will delete the current active record and redisplay the grid. Works only with WLISTF type grids.

LOCK This option will cause the grid to ignore any auto refresh calls from the program. This would be similar to setting the NO_REFRESH property in the form to TRUE, except it only applies to the specific TTASDatagrid. To reset the grid to normal mode see the UNLOCK option.

UNLOCK This will return the data grid to normal mode (turn off the LOCK option above) in that it will automatically show updates when you read records in the program.

NAME f/c/e This is the column name. In options NEWCOLUMN, GETCOLUMN, DELETECOLUMN, MOVECOLUMN, SHIFTCOLUMN and UPDATECOLUMN this is a Required value.

TO f/c/e This is the column number. In option SHIFTCOLUMN this is the column number that will be exchanged with the column specified in NAME. This is a Required value for SHIFTCOLUMN.

NUM f/c/e In options GETCOLUMN and UPDATECOLUMN you can specify the column number instead of the column name. You must specify one or the other. In the MOVETOROW option this is the row number you want to move to.

TEMPLATE f/c/e This is the name of the TTASDGColTemplate object that will be used in options NEWCOLUMN, GETCOLUMN and UPDATECOLUMN. It is Required for those options.

RECVFLD fn/v The name of the array field Required in options GETARRAYFLDS and GETARRAYCOLS.

COMMENTS

This command can be used on both active and inactive grids. Through the use of DATA_GRID you can allow the user to determine which columns show up, in what order, and even, if you want to get that complex, what the headers are, colors, etc.

EXAMPLE

A very good example of this command is WTASDATAM. The source file (WTASDATAM.SRC) should be in the \TAS7 subdirectory depending on where you installed TAS Professional.

EXAMPLE 2

insert row and delete row

Insetrow.click:

data_grid 'Grid2' GoEdit //Or Insert will not occur

data_grid 'Grid2' InsertRow

data_grid 'Grid2' GoRowSelect

ret

deleterow.click:

data_grid 'Grid2' GoRowSelect

data_grid 'Grid2' DeleteRow // Must be in row select mode or it hangs!

data_grid 'Grid2' GoEdit

ret

Above sample2 information supplied by TAS professional End user.


Date

Navigation: Reference > Commands >

Date

 Print this Topic Return to chapter overview

This command will get or set the computer system date.

DATE fn/v Required - The date field that either contains the new date value or will be the holder.

what-to-do GET - The program will get the system date value and put it into the date_field field.

SET - The program will set the system date to that value in date_field.

COMMENTS

This command will affect just the workstation it is running on and no others if you are running on a network.

SEE ALSO

DATE(), DTOC(), DMY(), MDY(), DOM(), YEAR(), CMNTH(), MNTH(), CDOW()


Deallocate Field

Navigation: Reference > Commands >

Deallocate Field

 Print this Topic Return to chapter overview

This command will deallocate (remove from memory and allow reuse of previously allocated space) a field previously allocated using any of the allocation commands or functions.

DEALOC fn/v Required - The name of the field being deallocated. The field must have been allocated using one of the appropriate commands or functions.

COMMENTS

Once this command has been used the field being deallocated will not be able to be used in a program until it is allocated again.

SEE ALSO

ALLOC, ALOCARY()


Decrement

Navigation: Reference > Commands >

Decrement

 Print this Topic Return to chapter overview

Decrement an I or R type field.

DEC fn/v Required - The name of the field being decremented. Must be of I or R type.

COMMENTS

This is the same as subtracting 1 from the field. For example:

DEC CNTR is equivalent to:

CNTR = CNTR - 1

This command provides a more succinct method to subtract 1 from a field. This command also runs a little faster than the standard subtraction routine.

SEE ALSO

INC


Define Field

Navigation: Reference > Commands >

Define Field

 Print this Topic Return to chapter overview

This command is used to 'create' a field that will be used only within the current program (or subsequent programs that are called from this program). This is not a field that is part of a record in a standard TAS Professional file.

DEFINE sac1,sac2,...sacx Required - The name or names of the field(s) being defined. Must conform to standard field name requirements. You may define a maximum of 10 fields in one DEFINE command. Each of the fields will have the same specifications.

TYPE sac The type of the field being added. Must conform to standard field type requirements. If you don't specify a field type, the default value is N. The field name types are listed here.

SIZE snc The display size of the field being added. Must conform to standard field display size requirements. If this is not included, then the default size value for the type of field is used.

NOTE: If the field is type A or V you must supply a value. V (overlay) type fields are treated internally as A type fields so you must supply a size for these also. Internally, the overlay field will start with the next field in the list and continue for the number of characters specified. See further information about the overlay field in COMMENTS below.

DEC snc If the field is of type N you can specify the number of decimal characters. If this isn't included the default value is 0. This could affect the displayed value of the field or the ability to ENTER the correct value. Therefore you should take great care to make sure the proper value is used. The available range is 0 through 8.

ARRAY snc The number of array elements for this field. Default value is 0.

UP If this is a type A field you may specify whether all characters entered to it are to be automatically forced into upper case. To accomplish this include this option.

RESET If this option is part of this command the program will try to match the fieldname up with the identical name in the previous program, if any. If it matches it will be reset to the specifications for the field in the previous program. This means that you can use that data in the new program just as though it was there normally. When you're done, and you return to the previous program any changes made to that data are still there. This is an alternative to using the WITH option in the CHAIN command and the PARAM command in the subsequent program. If the field cannot be found in the previous program, or there is no previous program, the field is treated like a normal field within that program. It is initialized and can be used, if desired.

This feature allows you to base certain options in subsequent programs on whether or not the data is there to use it and still not have to worry about what it's going to do if you come at the program a different way. This option is used in all TAS Professional programs to pass color values from program to program so that the TASCOLOR.OVL file needs to be read only once.

If you know you're not going to use a field unless it is 'reset' to a field in the previous program you can define it as any type and size you want. For example, if you want to access a very large array in a previous program and won't use the field at all if it isn't there you should define the field as an A type size 1. If it is blank (or SIZE(fld_name,'d')=1) you will know that you didn't reach this program from a previous one, or at least from the one that was passing the data. Of course, there are other ways to find that out, including passing info about the previous field with the PARAM command. Using this approach, you can avoid taking data space in the current program that will go unused since you are accessing data in the previous program instead. It doesn't matter what type or size you specify for the subsequent field. It will always be changed to the specs of the original field if the RESET option is active.

LOCAL If this option is included in the command then the program adds the procedure number to the field information. Through the use of this option and the PROC/ENDP compiler directives you can have multiple routines with the same field names and not worry about whether or not you overwriting some other data belonging to another field. The scope of a LOCAL field is limited to the boundaries of the routine in which it appears.

The key to this whole process is to make sure the routine this field applies to has the PROC directive at the beginning (before the field is defined) and the ENDP directive at the very end (after the last RET command that applies to this routine).

INIT c1,c2,c3,. . ., cx This option will initialize the defined field to these values. Specify on the command line what values you want the defined field to be set to when the program is run. The values must be constants; other fields and expressions are not allowed. You can initialize A, N, B, I, R, D, and T type fields. Please note that P and F type fields cannot be initialized using this option. IF YOU USE THIS OPTION, IT SHOULD BE THE LAST THING ON THE COMMAND LINE. The option must appear after the type, size, and number of array elements have been specified. If you are defining an array field, you may initialize each element separately. Do this by using a list of constants, with each constant being the correct type. The program will initialize the array field starting with element 1 and going until it runs out of values. If you put more values on the line than array elements, you will get an error during compilation. These values are actually set at the time the program is started, so you can put your DEFINEs anywhere in your program, and the values will not be reset just by running over the original DEFINE command.

NOTE: 'A' type constants should be specified without surrounding quotes. 'D' and 'T' type constants do need quotes. For example:

//The following shows a non-array A type field with an INIT value

DEFINE TEST type A size 10 init ABCDEFG

//This is a D type array field with an INIT value

DEFINE DATE_FLD type D size 8 array 2 init '01/01/94' , '02/01/94'

No other field types need surrounding quotes.

VALUE f/c/e This option may be used with any valid type. This option was created especially for the TTASDataGrid columns, however, it can be used anywhere. When you specify the FieldName for the column you cannot use an expression. By using this option you can use any legal expression instead of a regular field. For example, you might use this as follows:

DEFINE xyz TYPE A SIZE 20 VALUE x+y+z

The expression can also include functions, either built in to TAS Professional or UDF type.

NOTE: This would also be used in older TAS Professional program (DOS version) where you may have specified an expression as a display or print only value in a screen/report form. In those case you would replace the expression in the screen/report format with a defined field. Then, in the VALUE option of that field you would put the expression that was a part of the format.

DUP sac Use this option to define this field to the same specs as a field in the Data Dictionary (FILEDICT). You would use the field name as the sac value. For example:

DEFINE xyz DUP dict_buff_name

In this case the field 'xyz' would be defined to be type a, size 8, without any further options in the DEFINE command. Note that you don't put any quote marks around the DUP field name. Also, you cannot use a function or expression, it must be the actual field name that exists in FILEDICT.

COMMENTS

Generally, if multiple fields are defined using the same command the fields will follow sequentially in memory. However, this is not always the case. When the field is encountered in the program the first time it is put in the program's field list. If you are using defined field overlays and you want to make sure that all the fields in the block are together you should define them at the beginning of the program before any reference is made to any of the fields in the block.

DEFINE commands are not actually executed anywhere in the program. There are used simply for creating fields that will be used within that program.

If a field is not a part of the regular file dictionary or the define field dictionary it must be explicitly defined using this command somewhere in the program.

NOTE: You can also enter fields into the Defined Field file (FILEDFLD.DBF). Use the Maintain Defined Fields program to add, change and delete fields from this file. Once a field has been entered into this file it can be used in any program, just as though it were defined in that program.

SEE ALSO

REDEF


Delete All Records

Navigation: Reference > Commands >

Delete All Records

 Print this Topic Return to chapter overview

You can use this command to delete all or a group of records from a TAS Professional file.

DALL file_num Required - The number/handle of the file to be used. If you do not include this option, the program will look for a default search file set in the SRCH (Search File) command. If that hasn't been previously set, the program will report an error and the command will be skipped. This entry will override any default value set in the SRCH command.

NOTE: You must enter something here as a place marker, so put '' (double single quotes) for this option if you want to use the SRCH file.

KEY key_expr Set this to the appropriate value to delete the records in the file in the correct order. If you do not include this option, the program will look for a default key set in the SRCH command. If a default key hasn't been previously set the program will report an error and the command will be skipped. This entry will override any default value set in the SRCH command.

START f/c/e1,f/c/e2,...,f/c/ex The value to use as the beginning record. This is similar to doing a FINDV (Find Record) before the command. If the index you're searching on has multiple segments you may list the proper value for each segment, separating them with commas. This will allow you to specify the exact type for each of the segments. For example, suppose you're searching on an index that has two segments: a 5 character alpha and an I type field. Each record you want has the same alpha but the I field will change, and is in order. In the first record the I type field has a value of 0. The following would find the first record for that group, if it exists:

start 'ABCDE',0!

Notice that we separate the values with a comma. The only requirement is that the values be of the same type (and size) as the segments in the key. In this case we put the I type constant specifier (!) after the 0 to make sure that it is passed as an I type field.

SCOPE

scope - This option may help determine how many records are deleted. The options are: A (All), F (First), N (Next) and R (Rest). For more information about the scope specifier please see the general information at the beginning of this chapter.

f/c/e - If scope is set to N or F this is the number of records to delete.

An example of this would be:

... SCOPE A... //all records in the file. This is the default scope value.

... SCOPE N 20 ... //the next 20 records in the file

FOR lexpr You would use this option to restrict the records deleted in this command. If the expression did not resolve to .TRUE. the record would not be deleted. In this option, the search continues until the program reaches the end of file and then will quit. Any legal expression that resolves to .TRUE. or .FALSE. can be used.

An example of this would be:

... FOR (x=100) .and. (y=200) ...

WHILE lexpr This option also restricts the records deleted. However, the first time the expression resolves to .FALSE., the program stops deleting records and continues to the next command. Here's the benefit of this option: if the program is deleting records in a certain order (by a specific key) and the expression returns .FALSE. then the program knows that all the appropriate records have been deleted and there is no need to continue. For example: You want to delete all the invoice records for a specific customer. The first record for that customer is found in the invoice file either by using the start_value option within this command, or through the FINDV (Find Record) command before executing this command. Then the WHILE expression would be:

INV_CUST_CODE = CUSTOMER_CODE

(This assumes that there is a field called INV_CUST_CODE in the invoice file and a like field in the customer file called CUSTOMER_CODE. The KEY option must be set to the proper value so that the records are deleted in CUSTOMER_CODE order, or you must have set the SRCH command previous to this command.) When the first invoice record for the next customer is read the program will stop deleting records.

NOTE: If there is no START value you must set the scope value to R or N xxx. If you do not do this, the program will find the first record in the file and the WHILE expression will probably fail the first time. However, if the START option is used you can ignore this requirement.

CNTR fn/v This is an I type field that will be used for passing the number of records deleted.

DISP Each time a record is read the program will redisplay the screen fields, if you specify this option. This will slow down the operation of this command, depending on how many fields are displayed on the screen.

COMMENTS

If the WHILE option is used you must watch out for the proper setting of the SCOPE, and/or START options also. If everything is supposedly set properly and yet no records are being deleted, make sure that the proper first record is in memory prior to the execution of this command or that correct use has been made of the START option. If a record is not active when this command is executed nothing will be deleted. You can use the START option instead of a FINDV (Find Record) to make sure that a record is active.

NOTE: You can delete records from a Pervasive (Btrieve) or CodeBase file only.

SEE ALSO

DEL


Delete Characters

Navigation: Reference > Commands >

Delete Characters

 Print this Topic Return to chapter overview

Use this command to delete a group of characters from an alpha field.

DELC fn/v Required - The name of the alpha field.

START f/c/e The starting position within the field. The first character in the field is at position 1. If this value isn't specified the program will set start to the first character.

NCHR f/c/e Required - The number of characters to delete from the field.

COMMENTS

This command has the same effect as though you cut out a piece of the field and put the remaining two pieces back together, filling the end of the field with spaces.


Delete File

Navigation: Reference > Commands >

Delete File

 Print this Topic Return to chapter overview

This command will delete a file from the disk.

DELF f/c/e Required - The name of the file to be deleted.

COMMENT

No error is reported if the file is not found and nothing is returned if it is.

NOTE: Warning to use this command you can not have the file you are trying to delete open make sure you close the file first.

Example

define del_ok type L

delete_file:

delf temp_file_name

ret

SEE ALSO

RENF, DELF(), RENF()


Delete Record

Navigation: Reference > Commands >

Delete Record

 Print this Topic Return to chapter overview

Delete an active record for a specific TAS Professional file.

DEL file_num Required - The number/handle of the file that contains the record to be deleted.

NOCNF If this option is included in the command, the record is deleted without asking for confirmation from the user. The default action is to ask before deleting the record. This would be useful when you're deleting records from multiple files and want to ask the Delete question only once.

GOTO label If the user answers N to the Delete question (NOCNF is not included), you can put a line label here signifying where the program should transfer control. If this is not specified the program will continue with the next line.

ERR label If you specify a label here the program will transfer control to the appropriate line if an error occurs during the command. If you don't put a label here and an error occurs it will be displayed on the screen for the user and processing will continue with the next line in the program. If you don't want an error to be displayed then specify NO_ERR as the error_label, for example:

... ERR NO_ERR ... //no quotes surround the NO_ERR specifier

NOTE: If an error occurs during the DEL command you can test for it with the FLERR() function.

COMMENTS

This command will only work with regular TAS Professional files (Pervasive/Btrieve and CodeBase). Also, the record to be deleted must be active. This means that it cannot have been cleared either through the CLR (Clear File Buffer) command or SAVE command.

SEE ALSO


Disable All Screen Objects

Navigation: Reference > Commands >

Disable All Screen Objects

 Print this Topic Return to chapter overview

Use this command to set the ENABLED property for each object on the current form, except those specified, to .FALSE.

DISABLE_ALL

EXCEPT f/c/e1,f/c/e2,...,f/c/ex The names of the objects you don't want to disable would be added here separated by commas.

COMMENTS

When you execute the LOAD_MODAL() function you effectively set all the objects on the current form to disabled (ENABLED = .FALSE.). However, this applies to all forms in the current application (instance of the runtime) so the effect is that you can't access the menu or any other programs that were loaded from the current menu until that modal form is released. This command gives you the option to have the save effect but only on the active form. For example, say the user has loaded a customer edit screen then went back to the menu and loaded a vendor edit screen. These are two completely different programs that have nothing to do with each other except that they're running in the same instance of the runtime. If, for some reason, during the customer editing routine, you load a modal form that is connected to the customer form not only would the user not be able to access the customer form, but they also wouldn't be able to access the vendor form or the underlying menu until they were finished with the modal form and it was released. In some cases you may want this to happen (login screens, etc.). However, in some cases you may just want to keep them from going back to the current active form until they're done with what ever you want them to do. In that case you would use this command in conjunction with the LOAD_FORM command and the RELEASE_FORM and ENABLE_ALL commands after they're done. They will still be able to access the vendor edit screen and the menu even though they won't be able to go back to the customer edit screen until they are finished with the new current form.

NOTE: You can also disable individual objects by setting their ENABLED property to .FALSE.


Display Error Message

Navigation: Reference > Commands >

Display Error Message

 Print this Topic Return to chapter overview

Use this command to display an error message using the standard Windows dialog box. You can also set the internal System Error Number field.

ERR f/c/e Required - You may use this in two ways. It can be set as an A type field and the program will display the field as the error message. It can also be set as a numeric value (any appropriate type) and the program will read and display the appropriate record in the ERRMSG.B file.

NUM f/c/e If this value is set it will be saved in the internal Program Error Number field. You can access this value elsewhere in the program through the PERR() function.

COMMENTS

By using the ERRMSG.B file as the storage for error messages you can easily add, change, delete, etc. any appropriate message. You should start any message numbers at 5000 or more. This will assure that no messages will have to change due to interference with records saved for system purposes and provided with the system. Obviously, the error number values don't have to be sequential.


Display Windows Menu

Navigation: Reference > Commands >

Display Windows Menu

 Print this Topic Return to chapter overview

This command activates a TPopupMenu object on the form. This would be a menu that you will display at runtime in connection with the user pressing a specific key or clicking on a button.

WMENU f/c/e Required - The name of the TPopupMenu object on the form

AT f/c/e,f/c/e Required - The column and row coordinates of the upper left corner of the Popup Menu. These are offsets from the upper left corner of the active form.

COMMENTS

This is how you get a TPopupMenu that isn't connected to an entry field to display at runtime. If the user chooses an option from the menu displayed the action within the program is the same as if this was a standard Windows type menu at the top of the screen. That is, the program will look for a line label that has the same name as the TMenuItem and the .Click event type.

After the user chooses a menu item the menu will disappear automatically. The same occurs if the user clicks anywhere outside of the menu.


Display Windows Message Box

Navigation: Reference > Commands >

Display Windows Message Box

 Print this Topic Return to chapter overview

Use this command to display a message using the standard Windows message dialog box.

MSG f/c/e Required - This is the message you want to display on the screen. It can be any type of field or expression. The program will convert it automatically to a string.

WINDOWS f/c/e By setting this value to 'info', 'conformation', 'error' or 'warn' the program will display a dialog box with an information icon or with a warning icon. The information icon is the default.

NOTE: Only the first character matters, i.e., 'I' Information ,'C', Confirmation 'E' Error, or 'W' Warning.

CAPTION f/c/e You can replace the caption of the box using this option. If you don't specify a caption the word "Information" will be displayed if this is an information message or "Warning" if it's a warning message..

EXAMPLE

The code below will display the sample dialog box.

//test UDF

#udx

#ForceRWN

define x type n

START:

x = user_func(1,3,'A')

msg 'X: '+x

quit

ret

define y,z,a type n

define do type a size 1

func user_func y,z,do

if do = 'A'

a = y+z

else_if do = 'S'

a = y-z

else_if do = 'M'

a = y*z

else_if do = 'D'

a = y/z

endif

ret a

The above is a complete program. The result, once compiled and run, would be:


Edit_RTM

Navigation: Reference > Commands >

Edit_RTM

 Print this Topic Return to chapter overview

Edit_RTM

PURPOSE

This command will launch the Tas Professional report designer executable from the TAS runtime environment.

If you would like to give your end users the ability to modify report layouts (RTM's) This command will allow you to add the report designer to any of your applications.

The report designer otherwise normally can only be used from within the TAS programming / development environment.

To be able to use this option apart from the programming/development environment, you will need to have purchased a runtime license.

EDIT_RTM f/c/e - Optional as the file name to edit..

(if omitted it just brings up the Report designer.)

EXAMPLE

EDIT_RTM ‘REPORTFILE’

NOTE: If you do not have a register version you will get a Message at runtime.


Else

Navigation: Reference > Commands >

Else

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will control whether a command, or group of commands will be executed. This is one part of a complete command structure.

ELSE No options / No Modifiers

COMMENTS

For more information on the different structured programming commands, and the ELSE command in particular, please see Structured Programming Commands.

SEE ALSO

IF, ELSE_IF, ENDIF


Else If

Navigation: Reference > Commands >

Else If

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will control whether a command, or group of commands will be executed. This is one part of a complete command structure.

ELSE_IF lexpr Required - If the ELSE_IF expression resolves to .TRUE., the command lines between the ELSE_IF command and the next ELSE_IF, ELSE or ENDIF command will be executed.

COMMENTS

For more information on the different structured programming commands, and the ELSE_IF command in particular, please see Structured Programming Commands.

SEE ALSO

IF, ELSE, ENDIF


Enable All Screen Objects

Navigation: Reference > Commands >

Enable All Screen Objects

 Print this Topic Return to chapter overview

Use this command to set the ENABLED property for each object on the current form, except those specified, to .TRUE.

ENABLE_ALL

EXCEPT f/c/e1,f/c/e2,...,f/c/ex The names of the objects you don't want to enable would be added here separated by commas.

COMMENTS

This would generally be used to re-enable objects that you disabled previously using the DISABLE_ALL command.

NOTE: You can also enable individual objects by setting their ENABLED property to .TRUE.

SEE ALSO

LOAD_FORM, RELEASE_FORM


End If

Navigation: Reference > Commands >

End If

 Print this Topic Return to chapter overview

This is the end point of the process control command IF/ENDIF.

ENDIF No options / No Modifiers

COMMENTS

For more information on the different structured programming commands, and the ENDIF command in particular, please see Structured Programming Commands.

SEE ALSO

IF, ELSE, ELSE_IF


Equal

Navigation: Reference > Commands >

Equal

 Print this Topic Return to chapter overview

Use this command to set the receiving field to the value of an expression.

fn/v = f/c/e

fn/v receiving_field - Required - The field that is going to be changed.

f/c/e expression - Required - The expression that is providing the data. This can be as simple as a numeric constant, 1, or a very complex expression that uses functions and UDFs.

COMMENTS

If the two field types are not the same the program will attempt to convert the expression to the type of the receiving_field.

NOTE: There is a special use case for this field when you are setting a property value in an object on a form. In that case you would use the following:

'@ObjectName.PropertyName.SubPropertyName' = expression

Notice that the receiving_field starts with a single quote and the @ symbol, followed by the object name, then a period (.) then the property name, and, if necessary, another period and the subproperty name followed by a single quote. An example would be:

'@Label1.Caption' = 'Change the caption of this label'

In the above example, if there is a TLabel object on the current form with the name Label1, its caption would be changed to 'Change the caption of this label'

This will only work for objects on the current form and cannot be used for the form itself. To change the current form property values you must use the SET_OBJECT command.

For more information about form objects please refer to Form Objects - General Info.


Equals Portion of

Navigation: Reference > Commands >

Equals Portion of

 Print this Topic Return to chapter overview

EQUALS PORTION OF

This is a TAS Professional 3.0 command here for compatibility only.

The preferred method is to use the =MID() function.

EQU_MID recv_field FLD parse_fld START start_val NCHR num_chrs MEM_AREA memory_area#

recv_field - fn/v - Required - The field that is going to receive the portion of the parse_fld.

parse_fld - fn/v - Required - The field that you want a part of.

start_val - f/c/e - Required - The starting character in the parse_fld. The first character in the field is at position 1.

num_chrs - f/c/e - Required - The number of characters to get from the parse_fld.

mem_area# - f/c/e - Optional - If you are actually getting the characters from a memory area then this is the number (from 1-4).

NOTE: Even if you want to use a memory area you must still specify a parse_fld, although it will be ignored during execution of the

command.

COMMENTS

This is the equivalent of the TAS Professional 3.0 command Equals Portion Of.

PROGRAM EDITOR 3.0 Commands -> Equ_Mid


Execute Program

Navigation: Reference > Commands >

Execute Program

 Print this Topic Return to chapter overview

You would use this command to execute a Windows .EXE program from within your TAS Professional program. This command is like a shell command and can use windows program associations.

EXEC f/c/e Required - This is the name of the program to be run. This must include any path if applicable.

WITH f/c/e The program will pass this value as the 'tail' of the command line. For example:

WAIT This option will stop running and wait however it will not shutoff visual events on your screen if you want to use this you will need to use the check_wait() function.

EXAMPLES

//EXAMPLE 1 This is the command using the with option

BUTTON.CLICK:

EXEC 'WORDPAD' WITH 'TEST.SRC'

ret // would be the equivalent of executing the program WORDPAD.EXE and passing a single parameter of TEST.SRC.

// End EXAMPLE1

// EXAMPLE2 \ for wait and wait_check()

// If the user was to click the exit button before you were done and you do not protect your programming

// like this you will get an error because the program would be gone.

BUTTON1.CLICK:

EXEC 'WORDPAD' with 'TEST.SRC' WAIT

ret

BUTTONEXIT.CLICK:

if wait_check() > 0

msg 'you have not finished your editing yet you can not exit from this program.'

ret .f.

endif

quit

ret .t.

// END EXAMPLE2

//EXAMPLE3 use the mail to program assocuation in windows.

// lets say you want to put a button on your program to email someone.

BUTTON.CLICK

exec 'mailto:support@cassoftware.com'

ret

//END EXAMPLE3

//EXAMPLE4 maybe you want to have a button call up your website.

BUTTON.CLICK

exec 'http://cassoftware.com'

ret

//END EXAMPLE4

//EXAMPLE5 maybe you want to have button execute a program with file windows file association. This example

// would open the zip file in windows.

BUTTON.CLICK

exec 'myzipfile.zip'

ret

//END EXAMPLE5

//Here is how you can get it to wait

testexec.Click:
exec '.\sample\testbatch.bat' wait
if wait_check() <> 0
goto testexec.click // Program will loop until batch file is done.
endif
msg 'done'
Ret

COMMENT

Control returns to the TAS Professional program immediately. It does not wait for the other Windows program to finish executing unless you use the wait option in the command.

NOTE: You can pass a P type pointer (or any other numeric value) to the program you're running. It is automatically converted to an alpha string before it is passed.

NOTE: You can only execute another Windows program with this command. It will not execute a DOS program or command. However you can execute DOS programs from a PIF file.

NOTE: one other feature of the EXEC command is that it will use windows file association.

SEE ALSO


Export Records

Navigation: Reference > Commands >

Export Records

 Print this Topic Return to chapter overview

This command will write records to a non-TAS file. Within this single command you can accomplish many tasks that would normally take many more lines of code and time to execute.

EXPORT fn/v/e1, fn/v/e2,..., fn/v/ex Required - The fields in the record that are being exported. You may also create expressions that can be exported.

MEM If you are exporting from an array in memory instead of a standard file include this option in the command.

FILE file_num Required - The number/handle of the file to be used. If you do not include this option, the program will look for a default search file set in the SRCH (Search File) command. If that hasn't been previously set, the program will report an error and the command will be skipped. This entry will override any default value set in the SRCH command.

NOTE: You must enter something here as a place marker, so put '' (double single quotes) for this option if you want to use the SRCH file.

KEY key_expr Set this to the appropriate value to delete the records in the file in the correct order. If you do not include this option, the program will look for a default key set in the SRCH command. If a default key hasn't been previously set the program will report an error and the command will be skipped. This entry will override any default value set in the SRCH command.

START f/c/e1,f/c/e2,...,f/c/ex The value to use as the beginning record. This is similar to doing a FINDV (Find Record) before the command. If the index you're searching on has multiple segments you may list the proper value for each segment, separating them with commas. This will allow you to specify the exact type for each of the segments. For example, suppose you're searching on an index that has two segments: a 5 character alpha and an I type field. Each record you want has the same alpha but the I field will change, and is in order. In the first record the I type field has a value of 0. The following would find the first record for that group, if it exists:

start 'ABCDE',0!

Notice that we separate the values with a comma. The only requirement is that the values be of the same type (and size) as the segments in the key. In this case we put the I type constant specifier (!) after the 0 to make sure that it is passed as an I type field.

SCOPE

scope - This option may help determine how many records are exported. The options are: A (All), F (First), N (Next) and R (Rest). For more information about the scope specifier please see the general information at the beginning of this chapter.

f/c/e - If scope is set to N or F this is the number of records to export.

An example of this would be:

... SCOPE A... //all records in the file. This is the default scope value.

... SCOPE N 20 ... //the next 20 records in the file

FOR lexpr You would use this option to restrict the records exported in this command. If the expression did not resolve to .TRUE. the record would not be exported. In this option, the search continues until the program reaches the end of file and then will quit. Any legal expression that resolves to .TRUE. or .FALSE. can be used.

An example of this would be:

... FOR (x=100) .and. (y=200) ...

WHILE lexpr This option also restricts the records exported. However, the first time the expression resolves to .FALSE., the program stops deleting records and continues to the next command. Here's the benefit of this option: if the program is deleting records in a certain order (by a specific key) and the expression returns .FALSE. then the program knows that all the appropriate records have been exported and there is no need to continue. For example: You want to delete all the invoice records for a specific customer. The first record for that customer is found in the invoice file either by using the start_value option within this command, or through the FINDV (Find Record) command before executing this command. Then the WHILE expression would be:

INV_CUST_CODE = CUSTOMER_CODE

(This assumes that there is a field called INV_CUST_CODE in the invoice file and a like field in the customer file called CUSTOMER_CODE. The KEY option must be set to the proper value so that the records are exported in CUSTOMER_CODE order, or you must have set the SRCH command previous to this command.) When the first invoice record for the next customer is read the program will stop deleting records.

NOTE: If there is no START value you must set the scope value to R or N xxx. If you do not do this, the program will find the first record in the file and the WHILE expression will probably fail the first time. However, if the START option is used you can ignore this requirement.

CNTR fn/v This is an I type field that will be used for passing the number of records read, and the current array number, to your program. You can also use this to count the number of records read.

NUM fn/v Required (if Mem is specified) - If MEM is specified, this is the number of elements in the array to be exported.

TO f/c/e Required - The name of the file you are exporting to. Must include the entire path, if any, and any extension. The program will use the exact name you enter.

TYPE f/c/e Required - The type of file you are exporting to. The options are:

D - dBASE III+

L - delimited

F - fixed length/SDF

X - text

Don't forget: this option entry needs to be a constant ('L', or 'D', etc.) or a field that contains a single character that matches one of the above.

NOTE: In dBASE III+ format the program will create the header information automatically. You do need to remember that maximum field name sizes in dBase III+ are 10 characters and they are 15 in TAS. When we create the dBase III+ file we truncate the trailing 5 characters. You might want to take that into consideration when you are assigning field names if you are going to export to this format regularly.

DLM f/c/e If you choose the delimited ('L') type of file, you can also choose a delimiter character. If you don't specify this value the program will put commas (,) between each field and surround alpha fields with quotes ("xxx").

QT f/c/e Text Qualifier If you choose the delimited ('L') type of file, you can also choose a Text Qualifier character the default is a quote (").

NOTE: If you want no text qualifier set this value to 255. By using this option your output file would be considered a CSV type file. This feature only available ver 7.2 or later.

APND f/c/e 'Y' or 'N' - Normally the EXPORT command will create a new file each time it is run. However, you may choose to add records to an existing file by selecting this option. The full option is APND 'Y' to append records to a current file and APND 'N' to create a new file (this is the default action and need not be specified).

NOTE: The program doesn't check to make sure that the previous records are in the same format.

DISP Each time a record is read the program will redisplay the screen fields, if you specify this option. This will slow down the operation of this command, depending on how many fields are displayed on the screen.

NAME f/c/e Adds field names to DBF exported file field names are "fieldname1,fieldname2,,,"

NOTE: This is required if you use mem. You do need to remember that maximum field name sizes in dBase III+ are 10 characters and they are 15 in TAS.

COMMENTS

If the WHILE option is used you must watch out for the proper setting of the SCOPE, and/or START options also. If everything is supposedly set properly and yet no records are being exported, make sure that the proper first record is in memory prior to the execution of this command or that correct use has been made of the START option. If a record is not active when this command is executed nothing will be exported. You can use the START option instead of a FINDV (Find Record) to make sure that a record is active.

SEE ALSO


File Protection

Navigation: Reference > Commands >

File Protection

 Print this Topic Return to chapter overview

This command is used to encrypt, or protect against unauthorized usage, a standard TAS Professional file (Pervasive - Btrieve ONLY).

OWNER f/c/e Required - This is either the 'password' provided during the original execution of this OWNER command in relation to the specific file, or the new 'password' for this file. The field must be of A type and cannot be more than 8 characters in length. If you are going to clear current protection (CLR option), then this needs to be provided so that the program can proceed. In the case of the set option (SET), then it is needed for future operations. Once it is set you will need to provide it to the OPENV (Open File) command each time the file is opened. This can be accomplished in two ways. You can store the value in a file somewhere (not very safe) or you can ask for the value before opening the file. Make sure you set the password flag in the appropriate entry field object so that the value entered will not be displayed on the screen.

FILE file_num Required - This is the number/handle of the file being set. The file must currently be opened.

what_to_do CLR - Any protection currently provided will be removed.

SET - The protection will be setup, including encryption if specified (see below).

ENC If this is a SET operation then you can choose to encrypt the file also. This means that if anyone should try to access that file through any other means (debugger, other applications that use Btrieve, etc.) they will not be able to make sense of the data. If this is being accomplished on an existing file the process may take a considerable length of time depending on the number of records in the file. To choose this option include ENC in the command.

RDOK If this is a SET operation and this option is included in the command then subsequent programs that access this file, but don't set the OWNER option during the OPENV (Open File) command, will be able to read records from this file but won't be able to update them.

NOTE: This only works if you don't encrypt the file also. The OPENV command requires the OWNER value to unencrypt records when they are read.

COMMENTS

Through the use of this command you can make sure that a file will have a certain level of protection without concern as to what the program may do, or how the user may access the file through utilities.

SEE ALSO

OPENV


Fill Field

Navigation: Reference > Commands >

Fill Field

 Print this Topic Return to chapter overview

Use this command to put a single character multiple times into a single field or multiple array elements of the same field.

FILL fn/v Required - The field to be filled. May not be a pointer (P or F), but any other type is legal. You can use the redirector and a pointer to point to a legal field.

where TRAIL / LEAD / ALL - If the field being filled is of A type you may set whether to fill the trailing (TRAIL) or leading (LEAD) characters, or all (ALL). The program will put the character_to_use in each receiving position starting with the last (and then decrementing) or the first (and then incrementing) until the program finds the first character with an ASCII value greater than a space (ASCII 32). In the case of ALL the program will replace all characters in the field.

NOTE: All displayable characters are greater than a space. The default value is TRAIL.

CHR f/c/e The fill character. This really isn't optional, however, if this value is not set by you the default is binary 0. You may use any type of field or expression, but the program will only use the first character (byte) of the resultant field/value.

TIMES f/c/e If the field being filled is an array you may stipulate how many elements to fill using this option. You may also specify the beginning array element number, if other than 1, in the fieldname in the normal fashion, for example:

FILL ThisField[5] TRAIL CHR '#' TIMES 2

The command above would fill ThisField, array element 5 and 6 with the character '#'.

COMMENTS

If the field being filled is not an A type, the program will fill the entire field with character_to_use.

If you want to use a binary fill character it can be passed as an I or B type field or through the CHR() function.

SEE ALSO

TRIM, JUST(), FILL()


Find Record

Navigation: Reference > Commands >

Find Record

 Print this Topic Return to chapter overview

Use this command to find a record in any file, either TAS (opened with the OPENV (Open File) command) or non-TAS.

FINDV sac Required - This is the type of FIND you want to execute. The options are M, G, F, L, N P, R:

M - matching - Find the exact record based on the search_value option. You can also set the appropriate key fields with the EQUAL command and then the search_value option need not be used.

G - generic - Same as match however the program will return the exact or next greatest record.

F - first - Find the first record in the file.

L - last - Find the last record in the file.

N - next - Find the next record. This assumes that you have done a search previously that successfully found a record in the file (exact, generic, first, etc.).

P - previous - Find the previous record. This assumes that you have done a search previously that successfully found a record in the file (exact, generic, last, etc.).

FNUM f/c/e This is the file handle/number value that is returned in the OPENV command. If you do not include this option, the program will look for a default file_number set in the SRCH command. If that default hasn't been previously set, the program will report an error and the command will be skipped. This entry will override any default file_number value set in the SRCH command.

NOTE: In this case you DO NOT preface the file number/handle field with the '@' symbol.

KEY key_expr Set this to the appropriate value to search the records in the file in the correct order. If you do not include this option, the program will look for a default key set in the SRCH command. If a default key hasn't been previously set, the program will report an error and the command will be skipped. This entry will override any default value set in the SRCH command.

VAL f/c/e1,f/c/e2,...,f/c/ex This is similar to setting each segment in the key to a value separately. If the index you're searching on has multiple segments you may list the proper value for each segment, separating them with commas. This will allow you to specify the exact type for each of the segments. For example, suppose you're searching on an index that has two segments: a 5 character alpha and an I type field. Each record you want has the same alpha, but the I field will change, and is in order. In the first record the I type field has a value of 0. The following would find the first record for that group, if it exists:

val 'ABCDE',0!

Notice that we separate the values with a comma. The only requirement is that the values be of the same type (and size) as the segments in the key. In this case we put the I type constant specifier (!) after the 0 to make sure that it is passed as an I type field.

ERR label If you specify a label here, the program will transfer control to the appropriate line if an error occurs during the command.

NOTE: We do not recommend using this method to check for an error. You can test for an error with the FLERR() function and create a more graceful process to continue operation rather than just a GOTO, which is the effect of this option.

FOR lexpr You would use this option to filter the records read in this command. If the expression resolves to .FALSE. the search for a record will continue until the expression returns .TRUE. for a record or the search reaches the end of the file.

NOTE: This options works with any of the FINDV types. So, for example, if you are searching for the Last record (L option above) and use the FOR filter the command will return the last record found that matches the filter you have used.

NLOCK If this option is included in the command the program will NOT lock the record upon finding it as it would normally do in a multi-user situation. The default operation is to place a lock on the record upon reading it.

KEYO If this option is included in the command the program will search only for the key. The result is that you can use this method for checking if a key value exists without having to find the entire record. This will preserve the values in your record until you are ready to save it. To test whether or not the record exists use the FLERR() function without specifying the file number. Note from User : The keyo option only works on new records that have not yet been saved.

NOCLR Normally, during a M (match) type FIND, if a record is not found the program will clear the record buffer. If you don't want this to happen then include this option. If a record was active before the FIND it will still be active. If you had data as part of a new record then that data will still be there.

COMMENTS

Generally, if an error is returned during the FINDV operation the record for that file will not be active and will be cleared (no active data). However, this is not the case for the NEXT/PREVIOUS options. If there is an active record in the buffer and the user/program attempts a NEXT or PREVIOUS and reaches the end/beginning of the file, that record will still exist and will still be active.

You can use this command to search for a value in a non-TAS file by setting the KEY to @0 (or by not including it at all) and putting the value you are searching for as a logical expression in the FOR option. For example:

FINDV f ..... FOR fld_name='ABCD'

Where fld_name is a field in the non-TAS file being searched. The command above will return the first occurrence of the value 'ABCD'.

SEE ALSO

OPENV


For

Navigation: Reference > Commands >

For

 Print this Topic Return to chapter overview

This is the first part of the FOR/NEXT loop. In this part of the command you can specify the counter, start value, stop value, and the amount to add to or subtract from the counter each time the loop is executed.

FOR(

counter - fn Required - The name of the field used as a loop counter. This can be any integer field (B, I or R).

start_value - f/c/e Required - The first value to be used in the loop. The counter field is initialized to this value the first time through.

stop_value - f/c/e Required - When the counter reaches this value the program knows to exit the loop at the NEXT command.

step_value - f/c/e Required - How much to add to or subtract from counter each time through the loop. If you wish to subtract (or decrement) counter in the loop, precede the value with the minus sign. For example, a step_value of -1 will reduce the counter value by 1 each time the loop is executed.

)

COMMENTS

All fields/values in the FOR command except counter must be integers (B, I or R).

NOTE: If the start_value is greater than the stop_value (or less than, if the step_value is a negative number) then the loop will not execute even once.

NOTE: Don't forget the parens around the values and the values themselves are separated by semi-colons; for example:

FOR(x;1;10;1)

//put code here

NEXT

For more information on the different structured programming commands, and the FOR command in particular, please see Structured Programming Commands.

SEE ALSO

FLOOP, FLOOP_IF, FEXIT, FEXIT_IF, NEXT


For Exit

Navigation: Reference > Commands >

For Exit

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will exit from a FOR/NEXT loop. This is one part of a complete command structure.

FEXIT No options / No Modifiers

COMMENTS

For more information on the different structured programming commands, and the FEXIT command in particular, please see Structured Programming Commands.

SEE ALSO

FOR, FLOOP, FLOOP_IF, FEXIT_IF, NEXT


For Exit If

Navigation: Reference > Commands >

For Exit If

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will control whether to exit from a FOR/NEXT loop. This is one part of a complete command structure.

FEXIT_IF lexpr Required - If the expression resolves to .TRUE., then the program will transfer control to the line following the appropriate NEXT command. The counter value will remain at the last value.

COMMENTS

For more information on the different structured programming commands, and the FEXIT_IF command in particular, please see Structured Programming Commands.

SEE ALSO

FOR, FLOOP, FLOOP_IF, FEXIT, NEXT


For Loop

Navigation: Reference > Commands >

For Loop

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will go back to the beginning in a FOR/NEXT loop. This is one part of a complete command structure.

FLOOP No options / No Modifiers

COMMENTS

For more information on the different structured programming commands, and the FLOOP command in particular, please see Structured Programming Commands.

SEE ALSO

FOR, FLOOP_IF, FEXIT, FEXIT_IF, NEXT


For Loop If

Navigation: Reference > Commands >

For Loop If

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will control whether to loop back to the beginning in a FOR/NEXT loop. This is one part of a complete command structure.

FLOOP_IF lexpr Required - If the expression resolves to .TRUE., then the program will transfer control to the appropriate FOR line. This would be the equivalent of executing the NEXT command.

COMMENTS

For more information on the different structured programming commands, and the FLOOP_IF command in particular, please see Structured Programming Commands.

SEE ALSO

FOR, FLOOP, FEXIT, FEXIT_IF, NEXT


For Next

Navigation: Reference > Commands >

For Next

 Print this Topic Return to chapter overview

This is the end point of the process control structure FOR/NEXT.

NEXT No options / No Modifiers

COMMENTS

For more information on the different structured programming commands, and the NEXT command in particular, please see Structured Programming Commands.

SEE ALSO

FOR, FLOOP, FLOOP_IF, FEXIT, FEXIT_IF


Format Field

Navigation: Reference > Commands >

Format Field

 Print this Topic Return to chapter overview

This command will format a numeric field for a specific look during output.

FORMAT fn/v Required - The name of the field to be formatted. Must be a numeric field.

RECV fn/v If you want to put the formatted numeric field in another field this is the name of the A type receiving field.

NEG sac L - Leading negative sign

T - Trailing negative sign

P - Parentheses

C - Trailing CR

A - Angle brackets.

NOCMA If this option is included the program will NOT include comma characters in the resulting formatted field. The default is to include comma characters.

NOFD If this option is included the program will NOT include a floating dollar sign in the resulting formatted field. The default is to include a floating dollar sign.

NOZERO If the field value is 0 don't output anything.

OFF Turn off any current formatting.

COMMENTS

If the formatted field will not fit within the display size, the command will return the field as is, without any of the formatting characters.

NOTE: To control display of fields in theTAS grid component you would use this command.

NOTE : When formatting an array you need specify only the major field name.


Gosub Label

Navigation: Reference > Commands >

Gosub Label

 Print this Topic Return to chapter overview

This command will temporarily transfer control to a subroutine. The first line of that routine must be a standard line label.

GOSUB label Required - Transfer program control to the line label.

COMMENTS

A subroutine 'called' through this approach must use the RET (Return) command when finished. Unlike a function, no data may be returned. The program will continue with the next line after the original GOSUB (once the RET command has been executed from the subroutine).

SEE ALSO

GOTO


Goto Label

Navigation: Reference > Commands >

Goto Label

 Print this Topic Return to chapter overview

This command will permanently transfer control to a different part of the program. The first line of that routine must be a standard line label.

GOTO label Required - Transfer control to the line label.

COMMENTS

This command, as opposed to the GOSUB, has no automatic way to return. You must use another GOTO to return to the next command, if desired. Generally, this command is used only in situations where you do not want to execute the lines following this command (see also {..}).

This command is not part of the regular structured commands that a programmer would use in creating a program. Much effort has been made in TAS Professional so that this command need not be used at all. However, it remains here for those times you find it the expedient choice.


Help File

Navigation: Reference > Commands >

Help File

 Print this Topic Return to chapter overview

This command will display the help file specified, and, if you also include a context value, will go right to that page.

The one command will work with both (.HLP) or (.CHM) Since the release of Windows Vista the .HLP type help files are no longer being supported.

WHELP f/c/e Required - This is the name of the help file to use. If it's not in the current subdirectory, you must also include a complete path.

TOPIC f/c/e If you specify a value here it will be searched for in the index of the help file. If found, the appropriate page will be displayed. This is checked first before the Context option.

CONTEXT f/c/e The context value of the page you want to start with. If this is set to 0 the program will start at the contents page.

COMMENTS

At the current time this command only works with Windows Help (.HLP) and (.CHM) files.

NOTE: My HTML Help file doesn't work on a network drive – I just see error messages instead of the topic pages!

Recent security updates to Windows XP have introduced some severe restrictions for accessing HTML Help files across network drives. Under Windows XP most file links in HTML Help files will now generally not work at all and HTML Help itself is also severely restricted. Without registry changes on the user's computer HTML Help now cannot be used at all on networks. More details and a fix for this problem are available New CHM Network Registration Tool: If you decide not to edit the registry you can always copy the help file to a local hard drive.

Sample

//

//******************************************************************************

// do_help - This now uses the standard Adv7Docs.CHM file. Now supports .chm

//******************************************************************************

:do_help

#proc

define do_help_field type a size 15 local

define do_help_prg type a size 8 local

define do_help_desc type a size 30 local

func do_help

do_help_desc = ''

//display any help for the option if it is available

do_help_desc = parsefile(whoami(),pfName)

if mid(up(do_help_desc),1,4) <> 'WTAS' then \

if mid(up(do_help_desc),1,3) = 'WBK' then delc do_help_desc start 1 nchr 1

// we are using the tpath INI file path because we also will be copying the .chm file

// to WS folder on there local drive.

if FILE_EXISTS(tpath()+'adv7Docs.chm')

// use the new .chm HTML Help file format

whelp tpath()+'adv7Docs.chm' topic do_help_desc

else

// use old winhelp32.exe .hlp format not supported by VISTA Op system.

whelp tpath()+'adv7Docs' topic do_help_desc

endif

ret .t.

#endp

//

::end of do_help proc


If

Navigation: Reference > Commands >

If

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will control whether a command, or group of commands, will be executed. This is one part of a complete command structure.

IF lexpr Required - If the if_expression resolves to .TRUE., the what_to_do action will be taken. If it is .FALSE. and the what_to_do action is not THEN, the program will look for the next ELSE_IF or ELSE command. If one is not found the program will transfer control to the line following the appropriate ENDIF command.

what_to_do - sac The action to take if the expression resolves to .TRUE. Possible actions include:

DO - Do the following commands until the program reaches an ELSE, ELSE_IF or ENDIF command. This is the default value and doesn't have to be specified.

THEN - Execute the following command. The command to execute in this case may follow on the same physical line or it will execute the command on the following line.

GOTO - Goto the line label specified in the goto_gosub_label.

GOSUB - Gosub the line label specified in the goto_gosub_label.

RET - Execute the RET (Return) command.

NOTE: DO NOT use this option to return a value. The RET here is just a return. If you want to return a value you would use:

IF lexpr THEN RET value

goto_gosub_label If the what_to_do option is GOTO or GOSUB then you must specify the label name here.

COMMENTS

For more information on the different structured programming commands, and the IF command in particular, please see Structured Programming Commands.

SEE ALSO

ELSE, ELSE_IF, ENDIF


If Duplicate Record

Navigation: Reference > Commands >

If Duplicate Record

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will control whether a command, or group of commands, will be executed. This is one part of a complete command structure.

IFDUP sac Required - This is the key name. The program checks the file to see if a record exists with the current (active) value in the key field(s). If it does, the what_to_do action will be taken. If it does not and the what_to_do action is not THEN, the program will look for the next ELSE_IF or ELSE command. If one is not found, the program will transfer control to the line following the appropriate ENDIF command.

what_to_do - sac The action to take if a record is found with the specified key value. Possible actions include:

DO - Do the following commands until the program reaches an ELSE, ELSE_IF or ENDIF command. This is the default value and doesn't have to be specified.

THEN - Execute the following command. The command to execute in this case may follow on the same physical line or it will execute the command on the following line.

GOTO - Goto the line label specified in the goto_gosub_label.

GOSUB - Gosub the line label specified in the goto_gosub_label.

RET - Execute the RET (Return) command.

NOTE: DO NOT use this option to return a value. The RET here is just a return. If you want to return a value you would use:

IFDUP sac THEN RET value

goto_gosub_label If the what_to_do option is GOTO or GOSUB then you must specify the label name here.

COMMENTS

Please note that the IFDUP command cannot tell if the duplicate record is active. Therefore you should not allow the user to re-enter (change) the relevant key field if the record is active. For example, you might use the following code:

EntryFieldObjectName.Pre:

RET IFNA(file_handle)

For more information on the different structured programming commands, and the IF command in particular, please see Structured Programming Commands.

NOTE: This command works with Btrieve files only. If you are checking for duplicate records in CodeBase files, use the IFDUPCB() function.

NOTE: If you have two records with the same key value the first record is not considered a duplicate but he second record will be the dupe record.

Sample

ssn.post:

ifdup bkpr.emp.ssn

msg 'The SS# you have entered is already on file for another employee please check your entry.'

ret .f.

endif

ret .t.

SEE ALSO

ELSE, ELSE_IF, ENDIF, IFNA(), ACTIVE() (IFDUPECB() Codebase)


If Record Not Active

Navigation: Reference > Commands >

If Record Not Active

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will control whether a command, or group of commands, will be executed. This is one part of a complete command structure.

IFNA file_num Required - The number/handle of the file to be checked.

what_to_do - sac The action to take if the record is not active. Possible actions include:

DO - Do the following commands until the program reaches an ELSE, ELSE_IF or ENDIF command. This is the default value and doesn't have to be specified.

THEN - Execute the following command. The command to execute in this case may follow on the same physical line or it will execute the command on the following line.

GOTO - Goto the line label specified in the goto_gosub_label.

GOSUB - Gosub the line label specified in the goto_gosub_label.

RET - Execute the RET (Return) command.

NOTE: DO NOT use this option to return a value. The RET here is just a return. If you want to return a value you would use:

IFNA file_num THEN RET value

goto_gosub_label If the what_to_do option is GOTO or GOSUB then you must specify the label name here.

COMMENTS

The IFNA() function is similar in that it checks for an active record and returns .TRUE. or .FALSE.

For more information on the different structured programming commands, and the IF command in particular, please see Structured Programming Commands.

SEE ALSO

ELSE, ELSE_IF, ENDIF, IFNA(), ACTIVE()


Import Records

Navigation: Reference > Commands >

Import Records

 Print this Topic Return to chapter overview

This command will import records from a non-TAS file and save them to a TAS Professional file. Within this single command you can accomplish many tasks that would normally take many more lines of code and more time to execute.

IMPORT fn/v1, fn/v2,..., fn/vx Required - The fields in the record that are being imported to. These must be real fields and cannot be expressions. These also means that you shouldn't include array specifiers, so, ABC[1] should be included in the list as ABC.

FROM f/c/e Required - The name of the file you are importing from. Must include the entire path, if any, and any extension. The program will use the exact name you enter.

TYPE f/c/e Required - The type of file you are importing from. The options are:

D - dBASE III+

L - delimited

F - fixed length/SDF

X - text

Don't forget: this option entry needs to be a constant ('L', or 'D', etc.) or a field that contains a single character that matches one of the above.

DLM f/c/e If you choose the delimited ('L') type of file you can also choose a delimiter character. If you don't specify this value the program will assume commas (,) between each field and alpha fields surrounded with quotes ("xxx").

MEM If you are importing to an array in memory instead of a standard file include this option in the command.

MAXA fn/v If the MEM option is included, then this is required. This is the maximum number of elements in the array to be imported to.

CNTR fn/v This is an I or R type field that will be used for passing the number of records read, and the current array number, to your program. You can also use this to count the number of records read.

TO file_num Required - The number/handle of the file to be imported to. This must be a currently opened file in your program.

SCOPE

scope - This option may help determine how many records are imported. The options are: A (All), F (First), N (Next) and R (Rest). For more information about the scope specifier please see the general information at the beginning of this chapter.

f/c/e - If scope is set to N or F this is the number of records to import.

An example of this would be:

... SCOPE A... //all records in the file. This is the default scope value.

... SCOPE N 20 ... //the next 20 records in the file

FOR lexpr You would use this option to restrict the records imported in this command. If the expression did not resolve to .TRUE., the record would not be imported. In this option, the search continues until the program reaches the end of file and then will quit. You can also use this to perform the same task if MEM is specified. Use the counter_field as the array specifier in the expression.

DISP Each time a record is read the program will redisplay the screen fields, if you specify this option. This will slow down the operation of this command, with the amount of slow-down depending on how many fields are displayed on the screen.

NOTE : As of VER 7.1 Build 6 the buffer for import has been changed from 1022 and is now 2046.

SEE ALSO

EXPORT

Example

//Example from cashbox pro

define import1_hndl type I

btninport.click:

set_object get_Form_Name() property 'No_Refresh' value .t.

datafile = GET_FILE('TXT','.\data','Get Wand Data','TXT files only (TXT)|*.TXT')

if datafile = '' then ret

openv 'IMPORT1' fnum import1_hndl lock N type c

import TEMP_MAC,TEMP_BOXOLD,TEMP_NEWBOX,TEMP_DATE from datafile type 'L' to @import1_hndl

set_object get_Form_Name() property 'No_Refresh' value .f.

ret

The above code was used to import data in this format.

1234,12345,1101,dateand time string
1234,12345,1101,dateand time string

1234,12345,1101,dateand time string


Increment

Navigation: Reference > Commands >

Increment

 Print this Topic Return to chapter overview

Increment an I or R type field.

INC fn/v Required - The name of the field being incremented. Must be of I or R type.

COMMENTS

This is the same as adding 1 to the field. That is:

INC CNTR

is equivalent to:

CNTR = CNTR + 1

This command provides a more succinct method of adding 1 to a field. This command also runs a little faster than the standard addition routine.

SEE ALSO

DEC


Inherited

Navigation: Reference > Commands >

Inherited

 Print this Topic Return to chapter overview

This command will temporarily transfer control to a subroutine that has been hidden by a duplicate label, added through a runtime compilation.

INHERITED f/c/e Required - The label name that has hidden one or more previous labels. If there is no previous label then nothing will happen.

COMMENTS

A subroutine 'called' through this approach must use the RET (Return) command when finished. Unlike a function, no data may be returned. You might want to call the previous routine at the beginning of the new routine, at the end, or sometime in the middle. All are acceptable.

NOTE: If you have compiled the same routine multiple times, that label may end up being called the number of times you've compiled the code. Each time it is called, a different section of code will be executed. Once compiled, that code is never cleared.

EXAMPLE

btnExit.click:

//this could be a new routine called by some code compiled at runtime.

//something would happen here

inherited 'btnexit.click' //notice that you don't include the colon (:) as part of the label name.

ret


Initialize TAS File (Btrieve)

Navigation: Reference > Commands >

Initialize TAS File (Btrieve)

 Print this Topic Return to chapter overview

TAS FILE (Btrieve)

This command is used to create (initialize) TAS Professional Btrieve(tm) files.

INIFLE filename SPECS specifications CNF

filename - f/c/e - Required - The name of the file to be created. The file name must include the

standard file name, the extension, and the file path, if any.

specifications - fn/v - Required - This is the field containing the information Btrievetm will use

to create the data file.

CNF - Optional - If this option is included in the command the program will confirm that the

user wants to create the file before trying to create it. However, if the file already exists, the

program will alert the user that the file exists and confirm that they wish to initialize it

irregardless of this option.

COMMENTS

You must have a full copy of the developer's version of Btrieve(tm) available from Novell before attempting

to use this command. The requirements for properly setting up the specifications buffer are beyond

the scope of this document.

Also See CreateBtv() This is a new function used to create (initialize) TAS Professional Btrieve(tm) files.


Insert Characters

Navigation: Reference > Commands >

Insert Characters

 Print this Topic Return to chapter overview

Use this command to replace temporary place-keeping symbols in an A type field with other A type fields. The general use of this command will be in inserting names, addresses, amounts, etc. into stock paragraphs, letters, etc. that can then be printed with this personal information in it.

INSERT f/c/e1, f/c/e2,..., f/c/ex Required - The fields/expressions that will be used when replacing the place-keeper values. The first field will replace place-keeper 1, the second field place-keeper 2, etc. Each INSERT value must be of A type. The place-keeper value is '\*'+number, i.e., \*1 or \*2, etc. Each INSERT field may be used multiple times within the into_field.

INTO fn/v Required - The name of the field that contains the place-keeping values that need to be replaced. Must be an A type field.

COMMENTS

The process is to remove the place-keeping characters and then insert the appropriate INSERT field. If the total size of the 'new' value is beyond the size of the field the overflow characters at the end will be deleted.

EXAMPLE

Assume that the value of field X is:

Now is the \*3 for all good \*2 \*1 come to the aid of their party. Now is the \*3 for all good \*2 \*1 come to the aid of their party. Now is the \*3 for all good \*2 \*1 come to the aid of their party.

After the execution of the command:

INSERT 'to','men','time' INTO X

The value of field X will now be:

Now is the time for all good men to come to the aid of their party. Now is the time for all good men to come to the aid of their party. Now is the time for all good men to come to the aid of their party.

SEE ALSO

DELC


Justify Field Value

Navigation: Reference > Commands >

Justify Field Value

 Print this Topic Return to chapter overview

This will move the characters in an A type field, starting with the first non-space character, to the beginning of the field, to the end or will center the characters.

JUST fn/v

which_way - sac LEFT / RIGHT / CENTER - Move the characters to the LEFT in the field, to the RIGHT, or CENTER them. LEFT is the default value.

COMMENTS

When you use the function JUST() the program puts the field in the temporary data space. If you are trying to JUST() a field that is larger than that space you will get the message that the program is out of room in the temporary data area. This command is provided to you so that you can JUST() a field larger than the temporary data area within its own space. Using this command you will not run out of memory.

NOTE: This command will NOT work with CodeBase fields. You must use the JUST() function.

SEE ALSO

TRIM()


Label

Navigation: Reference > Commands >

Label

 Print this Topic Return to chapter overview

A label is not a true command. However, it is used as the beginning of any routine that is called by Goto, Gosub and object Events, etc. A label is defined as a string terminated by a colon (:). A sample label might be:

ThisIsATest:

It does not have to start at the beginning of the line, however, it does have to be the first item on the line. You can have a regular command after the label if desired.

There is a special type of label that is used for object Events. In this case the label starts with the object name, a period (.), and the event name. So, in the case of a button where the TButton's Name property is btnOK, the CLICK Event would be:

btnOK.Click:

For more information about object Events please refer to the specific object.

During compilation, if a label is referred but not defined you will receive an error to that effect and the process will not complete.


Load Form

Navigation: Reference > Commands >

Load Form

 Print this Topic Return to chapter overview

Use this command to load a specific form from the disk and make it active.

LOAD_FORM f/c/e Required - The name of the form to be loaded. Must include complete path if it is not in the current path.

COMMENTS

This command is used instead of the CHAIN command when you want to have multiple forms active within a single program at the same time. Unless you disable the current form before executing this command (DISABLE_ALL) the user will be able to move from one form to another by just clicking on an object in the non-active form.

SEE ALSO

ENABLE_ALL, RELEASE_FORM, ACTIVATE_FORM


Load Picture

Navigation: Reference > Commands >

Load Picture

 Print this Topic Return to chapter overview

This command will load a picture (either file or field) into a TImage object that exists on a form.

LOAD_PICTURE f/c/e Required - This is the name of the TImage object. The object must exist on the current form.

FILE f/c/e If you are loading the picture from a file on the disk this is the file name. Must include complete path if it is not in the current path and the file extension.

FIELD fn/v If you are loading the picture from a field this is the field name. NOTE: At the current time you can only store a picture in a field as a .BMP file format.

COMMENTS

You cannot load a picture using the standard SET_OBJECT command referring to the Picture property, you must use this command. Also, you must specify either the FILE or FIELD option in the command. You cannot have both.

Sample

loadpic:

If BKPR.EMP.NOTES[7] <> ''

If FILE_EXISTS(bkpr.emp.notes[7])

// you need To check To make sure

// the file exists before you load

/ a picture Or you will Get an error.

LOAD_PICTURE 'image1' FILE BKPR.EMP.NOTES[7]

Set_Object 'image1' property 'visible' value true

endif

ret

Else

Set_Object 'image1' property 'visible' value false

ret

endif


Move Data

Navigation: Reference > Commands >

Move Data

 Print this Topic Return to chapter overview

This command is used to move data from one field to another without regard to the type of the data, array elements, etc. This is a quick and easy way to move large array fields to holders or back.

XFER

FROM fn/v Required - The From field. This can be any field or pointer, including array element specifier.

TO fn/v Required - The To field. This can be any field or pointer, including array element specifier.

NCHR f/c/e Required - The number of characters/bytes to move.

REC_BUFF If you specify this option the command will use the FROM value as the from file handle and the TO value as the to file handle. You don't need to specify the NCHR value since the program will check the size of the record and use that automatically. NOTE: This only works with CodeBase records.

COMMENTS

This is a very powerful command that will allow you to move large array fields or group of fields with a single command. However, it's your responsibility to make sure that the number of characters/bytes moved does not extend past the from or to fields.

VERY IMPORTANT: The data structure of a Btrieve record is siginificantly different than that of a CodeBase record. If you are used to programming with Btrieve files it is recommended that you DO NOT use this command when moving a large group of data from/to a CodeBase file field, or group of fields. The field sizes and the way they are stored, may be completely different than that in a Btrieve file. You are better off using a different method when dealing with CodeBase file fields. You can, however, use the REC_BUFF option to move the entire record from one CodeBase file to another when they both have the same FD. It's up to you to make sure this is true. The command will not check.

Example Using xfr in codebase where we have two files sharing same schema and rec_buf

openv 'myfile1' fnum file1_hndl lock N
openv 'myfile2' fnum file2_hndl lock N

scan @File1_hndl key @0 //read all records using natural order
clr @file2_hndl buff // This has to be on the loop
xfer from file1_hndl to file2_hndl Rec_Buff
save @file2_hndl nocnf //save the history
ends

EXAMPLE

(*

The following code is used in the WTASDMGR. It is used

when the key information is loaded from the disk and

prepared to be displayed in the appropriate grid.

The first part of the source shows the records being

read and moved from individual array elements and

moved to a holder than can handle all the segments

for a single key.

*)

for(cntr;1;24;1)

fexit_if Key_name[cntr]=''

if Key_name[cntr]<>akey_name[dict_key_actv] then AddKey = True

if AddKey

if dict_key_actv<>0

//we need to move the individual segments into the holder

xfer from seg_fld_name[1] to seg_fld_hldr[dict_key_actv] nchr 360

updta seg_fld_name clr

endif

inc dict_key_actv

akey_name[dict_key_actv] = Key_name[cntr]

akey_order[dict_key_actv] = iif(Key_order[cntr]='A','Ascending','Descending')

akey_dups[dict_key_actv] = Key_dups[cntr]

akey_mods[dict_key_actv] = Key_modifiable[cntr]

key_cntr=1

endif

AddKey = False

seg_fld_name[key_cntr]=Key_field[cntr]

inc key_cntr

next

//setup the field names for key 1

if dict_key_actv<>0 then

xfer from seg_fld_name[1] to seg_fld_hldr[dict_key_actv] nchr 360

(*

The second part moves the key segments from the holder back into

the appropriate array when it's needed.

*)

dgKeySpec.Move:

if GridsActive then wlistm 'dgKeySegment' close

dict_knum_actv=0

updta seg_fld_name clr

xfer from seg_fld_hldr[key_grid_cntr] to seg_fld_name[1] nchr 360

for(cntr;1;24;1)

fexit_if seg_fld_name[cntr]=''

inc dict_knum_actv

next

wlistm 'dgKeySegment' active_elements dict_knum_actv max_elements 24 \

counter_fld knum_grid_cntr setup

ret


Navigator

Navigation: Reference > Commands >

Navigator

 Print this Topic Return to chapter overview

Use this command to set the appropriate file number/handle and key for the TTASNavigator object on the form.

NAVIGATOR f/c/e Required - The name of the TTASNavigator object on the form.

FNUM f/c/e Required - This is the file number/handle value that is returned in the OPENV command.

NOTE: In this case you DO NOT preface the file number/handle field with the '@' symbol.

KEY key_expr Required - Set this to the appropriate value to search the records in the file in the correct order.

NLOCK If this option is included in the command the program will NOT lock the record upon finding it as it would normally do in a multi-user situation. The default operation is to place a lock on the record upon reading it.

NOTE : The NLOCK was not supported till version 6.17

COMMENTS

Once this command has been executed the user can click on the appropriate buttons and change, save, or delete records in the file as set using this command.


No Valid Message

Navigation: Reference > Commands >

No Valid Message

 Print this Topic Return to chapter overview

Use this command to turn off the standard internal Valid Message that will display automatically when the VALID_CHECK() function returns .False.

NOVLDMSG No options / No Modifiers

COMMENTS

Normally, when you execute the VALID_CHECK() function you want the message you have saved in the ValidMsg property, or the standard message to display. However, there are times when you may want to display a special message. In that case you would execute this command BEFORE the VALID_CHECK(). Each time you enter a new field the NoValidMessage flag is reset. This will allow you to choose which situations you want the standard Valid Message to be displayed, and which you don't.


On Goto/Gosub

Navigation: Reference > Commands >

On Goto/Gosub

 Print this Topic Return to chapter overview

Use this command to transfer control to a line label depending on a value. This is almost like a flat CASE command.

ON f/c/e Required - The value to test. Must resolve to a numeric value.

do_what - sac GOTO / GOSUB - Required - GOTO or GOSUB to the appropriate label.

label1,label2,...,labelx Required - The list of line labels used to determine where to transfer control. The first label corresponds to a value of 1, the second to 2, etc. If the expression resolves to a value of 0 or greater than the number of labels-1 then control is transferred to the last label in the list. The line labels are separated by commas.

EXAMPLE

ON X GOSUB Line1, Line2, Line3, ErrorLine

SEE ALSO

GOSUB, GOTO


Open File

Navigation: Reference > Commands >

Open File

 Print this Topic Return to chapter overview

This command will set up a file so that you may access data from it or write records to it from within your program.

OPENV f/c/e Required - The name of the file to be opened. You may specify the entire file name including disk drive specifier, path, filename and extension. If this is a TAS Professional file then the extension defaults to .B (other extensions are provided by the extension option (EXT) or are specified by a previously set default - see CO or the SETUP program). The filename can be a field, expression or alpha constant. If a path is specified in FILELOC.B and not here, that value will be used. If a path is included here it will be used no matter what's in FILELOC.B for this file.

FNUM fn/v Required - After the program opens a file (of any type) it returns a value that represents the number of the file opened. It is used by all the other commands that access the file for any purpose. This must be an I type field.

TYPE sac TDFXBC - The type of file being opened. The options are: T - TAS Professional, D - dBASEIII+ (non-CodeBase), F - Fixed length records (SDF), X - Text type, B - non-TAS Professional Btrieve files and C - Codebase. TEXT is for files such as letters, or others that have records that are not all the same size. Each TEXT record is terminated by a CR/LF (carriage return/line feed - 0Dh/0Ah) pair. In FIXED files all records are of the same length; they are also terminated with CR/LF pairs. D is for files created by dBASE III+ or those that fit the same requirements. You must still set the size for the D files, although the program knows where the data actually starts and can keep track of the number of records.

NOTE: D type files are different than CodeBase in that we don't use indexes, don't open memo files, and the layout isn't a part of FILEDICT.B. In most cases you will find it much more expedient to open these as CodeBase files since you will have more flexibility and capability than under just plain dBASEIII+. However, if you don't have index files and you don't have any memo files you will find it just as easy to open the file as a type T as a type D.

NOTE: What you have specified in your SETUP program determines whether you open Pervasive (Btrieve) files for type T or CodeBase (DBF) files. TAS Professional programs will work the same regardless of the file type! However, in the case of Pervasive (Btrieve) type files the extension will be B+company code. CodeBase will always be DBF (main data file), DBT (memo file) and MDX (index file).

EXT f/c/e If you wish to open a copy of the file with an extension other than the current default value (.B or whatever the company_code value is set to), you may specify up to 3 characters here.

NOTE: In all non-TAS files (T, D, F, X and B) you must specify the extension if you haven't done so in the file name. In T and C type files the first character of the extension must be B.

LOCK sac NRFXOD - The type of locking to use. N - none, R - record, F - file, X - read-only, O - Opportunistic locking and D - Deny access to others (exclusive access). The default is N - none if multi-user is not checked in the SETUP program and R if it is. R type locking will only lock a record at a time. You can only have one record locked in a file at one time. Multiple record locks are not available. When you use F type locking (File), no one else will be able to open the file for any purpose other than read-only (X type locks). Also, if any one has the file open before you try to set F type locking you will get an error when you try to open the file (see OPEN()). Use D (deny access) when you are going to re index the file or create a temporary index. If you have the lock set to D other users won't be able to open the file at all.

NOTE: This option is ignored for non-TAS files.

NOTE: In Btrieve files F and D type locks are the same. In CodeBase files the F type lock will only keep another user out if they try to lock the record, where D will keep another user out regardless.

NOTE: Opportunistic locking: This means the record is not locked unless you execute the REC_LOCK() function or, if you have a TTASNavigator attached to the file, if your user clicks on the Edit button or your code "clicks" on the button (see the ClickBtn property in TTASNavigator). The benefit of this is that you can allow your user to view records that may be edited (and locked) without locking them when read. Also, if you save a new record, all the appropriate locks will be set internally.

OWNER f/c/e A maximum 8 character code to be specified if the file is protected with the OWNER command. This applies to Pervasive (Btrieve) files only.

PATH f/c/e You may specify the path for this file if you wish to override the value in the FILELOC.B file.

NOTE: The path value must end with a backslash character (\).

FD f/c/e You may specify the file descriptor name for this file if it is not in FILELOC.B but the actual file layout is defined in the Data Dictionary. This allows you to compile a program using one data dictionary and then run it on a system that has a different data dictionary without having to worry whether or not that FD exists in the new dictionary.

SIZE f/c/e In the case of a non-TAS Professional file you must specify the maximum size of the record. In the case of a text or fixed length type file this must also include the final CR/LF pair (2 extra characters).

NOTE: If the non-TAS file is defined in the data dictionary you do not need to include this value.

BUFF fn/v In the case of a non-TAS Professional file you must specify the buffer that will hold the record when it is read, unless it is defined in the file Data Dictionary. You may use multiple fields to make up a buffer; however, you would specify just the first field in this case. You may also define a buffer in a program for a TAS Professional file. To use the buffer in the program instead of the normal buffer created in memory specify the name of the first field here just as you would with a non-TAS file.

If you are specifying a buffer for a non-TAS file don't forget to include the extra CR/LF bytes at the end of the record in both the size of the buffer and the size of the record if stipulated in this command.

NOTE: Non-TAS files that are defined in the data dictionary allocate their own buffers automatically just like regular TAS files.

CREATE If this option is included in the command the program will automatically create a new file upon opening. If the file exists it will be deleted. This only applies to file types: F and X.

NOTE: If the file doesn't exist it will be created automatically regardless of whether or not this option is included. If the file doesn't exist prior to the OPENV command the new file will have a size of 0 bytes. This can be checked using the FLSZE() (file size) function after the file is opened or the FILE_EXISTS() function before.

NOCLR Normally the buffer is cleared when a non-TAS Professional file is opened. If you have data in it already, and do not want to clear it then include this option in the command.

ADDALLFLDS If you specify this option the program will load all the fields from the data dictionary when the file is opened. This is only necessary if you have not specified any of the fields from this file within the program itself when it was compiled.

NOTE: During compilation the fields that make up any files used in the program will be automatically added to the field list. This will allow you to add fields to the screen form or report form after the program has been compiled and without recompiling.

DUPECHECK This will open a second version of the same file so it can be used in the ifdupcb() function. This only applies to codebase type files.

NOTE : if you are trying to use the ifdupcb() function and do not have this set in the openv the ifdupcb() will not work.

COMMENTS

If the file is defined in the File Data Dictionary any fields that are a part of it cannot be accessed in the program until the file is opened. Any attempt to do so will generate a warning error at runtime.

With this command you may open dBaseIII+, Text, and Fixed Length records and treat them as though they were standard TAS Professional files. This means you can do standard searches on the files, read and write records at will and in general treat them just as though they were Btrieve files. ALL commands that access files can be used to access these non-TAS files also (except the DEL and DALL commands). You would also use this command to open non-TAS Btrieve files where the file layout is a group of defined fields in memory (predefined or added during operation) instead of a standard defined record in the data dictionary. This command brings a level of flexibility to file handling not found in other 4GLs.

You can also define non-TAS Professional files in the file Data Dictionary. Make sure you set the proper file type when initializing the file. When a file is in the file Data Dictionary all the rules that apply to a standard TAS Professional file also apply to it, including setting up the file name, etc. This gives you the ability to access non-TAS files as easily as regular TAS files.

NOTE: The maximum number of files that may be open at one time is 256. This limit applies across all programs that are currently active.

NOTE: In TAS Professional 5.1 and previous, there was an ERR option. That option is ignored in TAS Professional (Windows GUI) programs. to check this use the flerr() function

NOTE: If you are using TAS 5.1 type programs using the where you mount screens and reports with the MOUNT Command. WARNING: Do not execute an OPENV after doing a MOUNT command it will not execute. To find out more about the tas 5.1 command please look this command up in the tas 5.1 manual.

BYTES,
PCHR
ASC

If you want to have a BYTE stay a byte avoid converting a BYTE (which is a numeric field) to an A type field as the A type field will convert any nondisplayed CHAR between 0-31 into a 32.

When reading a binary table use READ instead of FINDV next.

Also see DEFINE, PCHR, ASC, READ

SEE ALSO

CLOSE, FINDV, SAVE, DEL, ROPEN READ WRITE


Output Report Data

Navigation: Reference > Commands >

Output Report Data

 Print this Topic Return to chapter overview

This command is used to output data to a buffer previously created with the Setup Report Buffer command.

OUTPUT_REPORT_DATA

RB_NUM f/c/e Required - The Report Buffer Number. This is the same number you used for creating the buffer in the Setup Report Buffer command.

COMMENTS

This command cannot be used until you create a buffer with the Setup Report Buffer command. For each line or group of lines that you have on the report you would create a record by saving data to the buffer using this command. So, for example, if you were creating a simple report of customer codes and names you would probably setup a single buffer with just the two fields, and for each customer you wanted to be part of the report, you would execute this command with the field list made up of the code and name. See the example below for what that program code might look like.

You would also use this command if you are saving data multiple times to the same record. However, if you are updating separate values within an existing buffer record you would use the Update Report Data command instead of this one.

The program, WTASDMGR.SRC, contains a complete printing routine that displays a multi-level printing process. It starts at the label tbPrint.Click. WTASDMGR.RTM is the actual report format that is used. We provide the program in source format, documented internally, so that you can see first hand a multi-level report.

SEE ALSO

PRINT_REPORT

EXAMPLE

(* The following is a what a simple report might look like that

prints a customer code and name from the file BKARCUST.

This report assumes that the file has been opened someplace

else and that the handle field name is bkarcust_hndl.

The first step is to create the buffer for the data we will save.

Notice that we use '_' in the setup and '.' in the output. *)

setup_report_buff rb_num 1 reportname 'simple'

(* The SCAN command will loop through the file starting at

the beginning and retrieving each record in customer code order. *)

scan @bkarcust_hndl key bkar.custcode

output_report_data rb_num 1

ends

// at the end of the scan we execute the report

print_report

// to clear the report buffer

setup_report_buff rb_num 1 reportname 'simple'

ret


Passing Parameters

Navigation: Reference > Commands >

Passing Parameters

 Print this Topic Return to chapter overview

This is the command used to receive values from a previous program in which the with option was set in the CHAIN command.

PARAM fn/v1,fn/v2,...,fn/vx The names of the fields that will be used to receive the values from the with option in the CHAIN command. If the receiving field type does not match the type of the giving field, the value will be converted automatically to the receiving field type. Fields are separated by commas.

COMMENTS

If the program containing this command is run directly, or there are no values to pass, the fields in the PARAM command will be blank.

NOTE: You can also pass Memory fields from one program to the next using the RESET option in the Define command. Also you can pass and entire database PARAM @myfile_hndl

SEE ALSO

CHAIN DEFINE RESET


Play AVI File

Navigation: Reference > Commands >

Play WAV File

 Print this Topic Return to chapter overview

This command will 'play' an WAV file through the speakers if the computer is set up properly.

PLAYWAV f/c/e Required - The name of the WAV file including the full path, if any. If you don't include the extension, the program will automatically add '.WAV' to the end.

COMMENTS

If the file is not found nothing will happen.


Pointer Set

Navigation: Reference > Commands >

Pointer Set

 Print this Topic Return to chapter overview

You use this command to get the internal pointer value for the field.

pointer_field -> target_field

pointer_field - fn/v Required - The receiving field. The internal pointer value for target_field will be saved into this field. If you are saving the pointer for a non-array field it may be saved into either a type F or P field. However, if the pointer is for an array field, the result must be saved into a type P field or an inaccurate value will be saved.

target_field - fn/v Required - The field being pointed at.

COMMENTS

The difference in receiving fields comes from the way fields are accessed in TAS Professional. An F type pointer keeps track of the field type and address in the field list buffer. Only 5 bytes are required for this type of field. The P type pointer uses the actual location in memory and keeps track of the type, size, decimal characters, etc. of the field being pointed to. The P type is necessary when pointing to an array field since the array value is not kept in an F type pointer. For more information about the layout, size, and specifications of TAS Professional fields please see System Specification - Field Types.

Through the use of this command you can access fields indirectly either in a TAS Professional program or an external program.

NOTE: You must keep at least one space on both sides of the pointer command symbol.


Post Message

Navigation: Reference > Commands >

Post Message

 Print this Topic Return to chapter overview

This command will put a Windows message on the stack so that, when it comes up in the loop, the routine named will be called.

POSTMSG f/c/e Required - The label you want to call. The routine must end in a RET.

COMMENTS

Windows is basically a list of messages. That list is constantly being updated and added to. This command brings you to that level of Windows without forcing you to deal with the complexity. Even though there are lots of different messages in Windows, this is only one. When you execute this command, a message is added that tells Windows to run a routine in your program. If the routine doesn't exist the command will do nothing. Also, you want to include this command just before you do a return.

Why is this here? Because sometimes there's no other solution. Sometimes what you want to happen won't until you return to Windows. And, if you're not done, you need some way of coming back. This is the method.


Print Report

Navigation: Reference > Commands >

Print Report

 Print this Topic Return to chapter overview

This command will start the actual printing process for data that has been setup previously.

PRINT_REPORT

USE_PRINTER f/c/e If you specify a printer name here the report will print directly to that printer without any further user action. You can also specify the printer as 'ASK' and the program will skip the preview screen and display the printer dialog box (as shown below) to allow them to choose a printer or print to disk.

PRINT_TO_FILE f/c/e If you want to print directly to a file instead of the printer or preview enter the file type here. The options are: ptfRTF, ptfPDF, ptfCSS2, ptfHTML, ptfJPG, ptfExcel, ptfQuattro, ptfLotus, ptfRETF, ptfText, ptfBMP. These constants are in the CompilerConstants.txt file.

NAME f/c/e If you choose the PRINT_TO_FILE option above you can also specify the file name here. If you don't include this option the file name will be the name of the current program with the appropriate extension. If you don't specify a path the command will use the same path as the current program. In all cases, the extension will be changed to the appropriate type for that file, for example, ptfPDF will always be .PDF.

NOPRINTWHRDIALOG If you specify this option the program will not display the Print Where dialog to the user. This would generally apply when you are printing to a file and don't want to have any further user interaction with the program.

COPIES f/c/e Specify the number of copies you want to print here if this report is going to the printer. The default value is 1.

COMMENTS

The reporting process within your program should be similar to the following:

1. Setup the printer data buffer (SETUP_REPORT_BUFF).

2. Add data to that buffer (OUPUT_REPORT_DATA).

3. Adjust that data if necessary (UPDATE_REPORT_DATA).

4. And finally, print the report (PRINT_REPORT).

When this command is executed, the user will have the ability to choose where to send the report. The options include:

1. Any printer that you have access to, connected to your computer or over a network.

2. You can also output to the following file formats: Excel, HTML, PDF, RTF and others. Each of these is available to your user at runtime. All they have to do is choose the appropriate format and enter a file name. See the example below.

You can print the report multiple times without having to access the data again by executing this command multiple times. For example, if you wanted to print this report twice on two different printers you might do the following:

PRINT_REPORT USE_PRINTER 'HP2000C'

PRINT_REPORT USE_PRINTER 'HP LaserJet 1100'

The first time the report will print on the printer named "HP2000C" and the second time on the printer named "HP LaserJet 1100." It doesn't matter where those computers are, as long as they are registered on your computer.

NOTE: If you want to print directly to the default printer use this.

print_report NOPRINTWHRDIALOG use_printer 'default'

The default preview screen is maximized if this need to be changed you can add this to the taspro.ini to control window state Height and Width.

[Report Preview]

WindowState=wsNormal

;WindowState=wsMaximized

Height=700

width=950

Note: If you are chaining to your print program with a newruntime you may need to do this to prevent Zorder problems.

set_object get_form_name() property 'Visible' value false //make your print selection screen invisible. print_report
set_object get_form_name() property 'Visible' value true //make your print selection screen visible.

SEE ALSO


Quit Program

Navigation: Reference > Commands >

Quit Program

 Print this Topic Return to chapter overview

Provide a process for exiting a program.

QUIT No Options / No Modifiers

COMMENTS

TAS Professional will NOT automatically exit a program. You must execute a QUIT command or the user must click the close button on the main screen for the program. The QUIT command doesn't actually do anything immediately. It tells the runtime that you want to exit this program as soon as possible. When you RET (return) from the routine you are running the main screen (and all sub-screens) for that program will be closed, the open files will be closed, and the program will be removed from memory.

If you CHAINed to this program from another that previous program's active screen will be brought to the front and you will be able to continue with that program.

If this was the MainMenu then the runtime will exit completely.

NOTE: You may not quit a program when a modal form is active. You must first exit from that form. An error will be displayed should you try.

EXAMPLE

If you have a button called btnQUIT then the following might be your code:

btnQuit.Click:

quit

ret

You might also have an OnClose routine for this form. If so it might be something like this:

CheckOnClose:

if x>1

msg 'The program cannot close yet. You need to do...'

ret .false.

endif

//if we're here then we can close

ret .true.

In that example above when the form gets the message to close (QUIT) it will call the subroutine above. If the variable x has a value greater than 1 the routine returns .FALSE. which tells the form that it can't close and the program stays active. The routine also sends a message to the user to tell him/her that the program isn't finished yet. The label 'CheckOnClose' is something you would set in the form object itself, please refer to TTASForm.


RANDOMIZE

Navigation: Reference > Commands >

RANDOMIZE

 Print this Topic Return to chapter overview

RANDOMIZE

PURPOSE

This command will generate a random seed to be used in the RNDM() function. Call this command once before calling single or multiple RNDM() functions.

RANDOMIZE There are no required parameters for this function

COMMENTS

EXAMPLE

Define I type I

Start:

Randomize

i=1

While i<100

  msg Rndm()

  inc i

endw

ret


Read From Non-TAS File

Navigation: Reference > Commands >

Read From Non-TAS File

 Print this Topic Return to chapter overview

This command will cause the program to read a specific number of characters from a non-TAS file at a certain location.

READ fn/v Required - The file number value. This is the same value as that received in the OPENV (Open Variable) command. The file must have been previously opened

START f/c/e The first byte position to read from. The first character position in the file, for this command, is 1. If no start value is given or the value is 0 the program will use the current internal file position value. (When the file is opened the position value is automatically set to 1.) This must be an R type field.

NCHR f/c/e The number of characters to read. If this is not supplied the program will use the size value stated in the OPENV (Open Variable) command.

TO fn/v Normally the characters read would be saved in the buffer specified in the OPENV (Open Variable) command. However, you may use this option to specify a different buffer field to be used during the execution of this command.

COMMENTS

The internal file position value will be set to the first character following the characters read. For example, if the start value is set at 10 and the number of characters to be read is 10, the position after the READ command will be 20.

SEE ALSO

WRITE, OPENV


Read Records To An Array

Navigation: Reference > Commands >

Read Records To An Array

 Print this Topic Return to chapter overview

The command is used for reading a group of records into array fields in memory. Within this single command you can accomplish many tasks that would normally take many more lines of code and time to execute.

RDA fn/v/e1, fn/v/e2,..., fn/v/ex Required - The fields in the record that are being read. You may also create expressions that can be transferred to the receiving (TO) fields. The first field in this list is paired to the first field in the TO list, the second to the second, etc. There must be the same number of fields in this list as in the TO list.

NOTE: You cannot use constants in the from list but you can use expressions. For example, you can read the record number for each record into an array of record numbers by using the RCN() function as one of the from fields and the appropriate R type array field as the corresponding to field.

TO fn/v1, fn/v1,..., fn/vx Required - These are the recipient fields. They must be array fields of the same type as the respective from (RDA) field. The first from field is paired with the first TO field, the second to the second, etc. There must be the same number of TO fields as from fields.

FILE file_num Required - The number/handle of the file to be used. If you do not include this option, the program will look for a default search file set in the SRCH (Search File) command. If that hasn't been previously set, the program will report an error and the command will be skipped. This entry will override any default value set in the SRCH command.

NOTE: You must enter something here as a place marker, so put '' (double single quotes) for this option if you want to use the SRCH file.

KEY key_expr Set this to the appropriate value to read the records in the file in the correct order. If you do not include this option, the program will look for a default key set in the SRCH command. If a default key hasn't been previously set the program will report an error and the command will be skipped. This entry will override any default value set in the SRCH command.

START f/c/e1,f/c/e2,...,f/c/ex The value to use as the beginning record. This is similar to doing a FINDV (Find Record) before the command. If the index you're searching on has multiple segments you may list the proper value for each segment, separating them with commas. This will allow you to specify the exact type for each of the segments. For example, suppose you're searching on an index that has two segments: a 5 character alpha and an I type field. Each record you want has the same alpha but the I field will change, and is in order. In the first record the I type field has a value of 0. The following would find the first record for that group, if it exists:

start 'ABCDE',0!

Notice that we separate the values with a comma. The only requirement is that the values be of the same type (and size) as the segments in the key. In this case we put the I type constant specifier (!) after the 0 to make sure that it is passed as an I type field.

SCOPE

scope - This option may help determine how many records are read. The options are: A (All), F (First), N (Next) and R (Rest). For more information about the scope specifier please see the general information at the beginning of this chapter.

f/c/e - If scope is set to N or F this is the number of records to delete.

An example of this would be:

... SCOPE A... //all records in the file. This is the default scope value.

... SCOPE N 20 ... //the next 20 records in the file

FOR lexpr You would use this option to restrict the records read in this command. If the expression did not resolve to .TRUE. the record would not be read. In this option, the search continues until the program reaches the end of file and then will quit. Any legal expression that resolves to .TRUE. or .FALSE. can be used.

An example of this would be:

... FOR (x=100) .and. (y=200) ...

WHILE lexpr This option also restricts the records read. However, the first time the expression resolves to .FALSE., the program stops reading records and continues to the next command. Here's the benefit of this option: if the program is reading records in a certain order (by a specific key) and the expression returns .FALSE. then the program knows that all the appropriate records have been read and there is no need to continue. For example: You want to read all the invoice records for a specific customer. The first record for that customer is found in the invoice file either by using the start_value option within this command, or through the FINDV (Find Record) command before executing this command. Then the WHILE expression would be:

INV_CUST_CODE = CUSTOMER_CODE

(This assumes that there is a field called INV_CUST_CODE in the invoice file and a like field in the customer file called CUSTOMER_CODE. The KEY option must be set to the proper value so that the records are deleted in CUSTOMER_CODE order, or you must have set the SRCH command previous to this command.) When the first invoice record for the next customer is read the program will stop reading records.

NOTE: If there is no START value you must set the scope value to R or N xxx. If you do not do this, the program will find the first record in the file and the WHILE expression will probably fail the first time. However, if the START option is used you can ignore this requirement.

CNTR fn/v This is an I type field that will be used for passing the number of records read, and the current array number, to your program. You can also use this to count the number of records read.

DISP Each time a record is read the program will redisplay the screen fields, if you specify this option. This will slow down the operation of this command, depending on how many fields are displayed on the screen.

COMMENTS

If the WHILE filter option is used you must be careful to set scope and/or the START value options properly. If you think you've set everything properly and yet no records are being read, make sure that the proper first record is in memory prior to the execution of this command or that correct use has been made of the START value option. The last record read before exiting the command is still in the record buffer after the program leaves this command.

You must make sure you won't exceed the number of elements in the array. If there is a chance this might happen, you should use the scope to insure this doesn't happen. For example:

... scope n 300 ...

This would limit the command to the next 300 records in the file.

SEE ALSO

WRTA


Record Number Get/Set

Navigation: Reference > Commands >

Record Number Get/Set

 Print this Topic Return to chapter overview

This command will either return the record number (position) of an active record, or will use the value supplied to read a record.

RCN fn/v Required - The number/handle of the file to be used.

RCN fn/v Required - The field that will either hold the results of a GET or provide the value for a SET. This must be an R type field.

do_what GET / SET - GET the current record number, or SET the value in the record_number_field (the second RCN value) into the appropriate location and read the record.

NLOCK Normally, in multi-user mode, when a record is read it is automatically locked so that other users cannot read it until you are finished with it. If this is a SET operation and you don't want to lock the record upon reading it then include this option in the command.

NOTE: If you include this option and another user reads the record and then you try to save the record back to disk you will get an error message telling you that this has occurred. You need to read the record again before saving it back to disk.

Example

RCN @BoxCount_hndl rcn RecNum Set

SEE ALSO

RCN()


Redefine Field

Navigation: Reference > Commands >

Redefine Field

 Print this Topic Return to chapter overview

This command is used to change a field that has been previously defined. This field may be a part of a standard TAS Professional file. However, the changes will only apply during the execution of the program.

REDEF fn/v Required - The name of the field being redefined. Must be a standard TAS Professional field name.

TYPE f/c/e The new field type. If you don't specify a field type, the program will use the current value. The field name types are listed here.

SIZE f/c/e The new display size. If the type is A then this is required and is both the display and internal size.

DEC f/c/e If the type is N then you can also define the number of decimal characters. The maximum number is 8 and must be at least 2 less than the size value.

FILE fn/v If the field being redefined is part of a TAS Professional file then this is the number/handle for that file. The file must be opened before a field can be redefined.

OFST f/c/e If the field being redefined is part of a TAS Professional file then you can specify the new offset within the file buffer.

NOTE: In almost every other instance in TAS Professional the first number will always be 1. However, in this case the first character of the record is number 0.

UP f/c/e This value must resolve to Y or N. If the value is Y, then any entries made to this field will be forced to upper case characters.

LOC fn/v If you specify a fieldname here, the program will use the location (offset) of that field for this one.

COMMENTS

The original size (internal) of the field being redefined must be large enough to cover the internal size of the new field. The program does not check that this is true, and you can end up crossing from one field to another or otherwise destroying your memory space. This is VERY important and could produce AV errors if not caught.

You should consider using the ADD command before using this one. It is much more flexible and doesn't have the restrictions on original size.

SEE ALSO

DEFINE


Refresh Form

Navigation: Reference > Commands >

Refresh Form

 Print this Topic Return to chapter overview

Refresh the fields on the form.

REFRESHFORM No Options / No Modifiers

COMMENTS

In almost all cases, when you retrieve a record from a file, or execute an expression of any kind, the program will automatically refresh the current form. However, if you have made a call to a TLL using the TLLFC function or CALL_PRG() and you have accessed a record in the current program it will not be displayed until something else happens. In that case you can use this command to make the fields show up properly.


Related File Search Setup

Navigation: Reference > Commands >

Related File Search Setup

 Print this Topic Return to chapter overview

Use this command to setup a relationship between TAS files.

REL fn/v Required - This is the file number/handle of the slave, or the file that will be searched each time a master record is found.

KEY key_expr Required - This is the slave key that will be used when searching the slave file. It must be a legal key name or number within the slave file.

MSTR fn/v Required - The file number/handle of the master. When a record is found in this file the program will automatically check for a record in the slave file.

NOTE: To turn off a relationship set the slave handle and key and do not specify the MSTR and FLDLST values.

FLDLST fn/v1,fn/v2...fn/vx Required - This is similar to setting each segment in the key to a value separately. If the index you're searching on has multiple segments you must list the proper master field name that correlates to each index segment in the slave file.

NOTE: These must be real fields since they should be field names from the master file.

NOTE: If you are turning off a relationship then don't specify this FLDLST value.

COMMENTS

This command basically checks for any related records each time a record is found. If a relation has been setup the program will loop through the list of relations until it finds one where the master file handles match. It will then search the slave file, using the field list supplied, for the matching record. If it is not found the slave buffer will be cleared.

You can have multiple relations for a single master. You can also have cascading master/slave/master/slave relationships.

NOTE: A maximum of 32 relationships can be setup in any one program.

SEE ALSO

OPENV, FINDV


Release Form

Navigation: Reference > Commands >

Release Form

 Print this Topic Return to chapter overview

Use this command to release a form previously loaded.

RELEASE_FORM f/c/e Required - The name of the form to be released or cleared from the screen. This is the "internal" name of the form, not the name you loaded it with. You should get that name when you first load the form. An example is shown below.

ACTIVATE f/c/e You can specify which form to make active once the form being released is gone. If you don't specify a form name here the program will automatically make the original form for this program active.

COMMENTS

This command is generally used to remove forms that were loaded with the LOAD_FORM command. However, if you specify the main form for the current program it is treated as though you executed the QUIT command.

NOTE: When a program is QUIT all forms currently loaded are released automatically. You don't need to execute this command for each form you have previously loaded.

NOTE: You would not use this command in conjunction with the LOAD_MODAL() function. A form loaded that way is automatically released.

SEE ALSO

ENABLE_ALL, DISABLE_ALL, ACTIVATE_FORM

EXAMPLE

The following are two forms, FORM1.DFM and FORM2.DFM. FORM1.DFM has two buttons, btnLoad and btnRelease.

The following code is used to load and release the forms:

#winform Form1

#Winform Form2

define temp_name type a size 60

btnLoad.click:

load_form 'Form2'

temp_name = get_form_name()

ret

btnRelease.click:

release_form temp_name

ret

Notice that when FORM2 is loaded the program gets the 'internal' name of the form so that it can be referenced later. In fact, it's used in the release command.


Remark

Navigation: Reference > Commands >

Remark

 Print this Topic Return to chapter overview

This command allows the programmer to include a message or remark within the program that will have no effect on the program.

REM sac Anything you want. Everything after the REM is ignored by the compiler and is for your use only.

COMMENTS

There are two other characters you can use instead of REM. A double forward-slash (//) or, if you are going to remark out several lines in a block, put a parenthesis followed by an asterisk ((*) at the beginning of the remark block and the reverse, an asterisk followed by a parenthesis at the end (*)). Some examples:

REM All of the following remarks are legal

// This is a legal remark

MSG 'TEST' // This is a legal remark after a command.

You cannot put a remark on a command line if the command is continued. For example:

MSG 'THIS IS A TEST'+ \ // this is not a legal remark

' ALSO' // this is a legal remark

A remark cannot be put on the continued line since the continuation character (\) must be the last character on the line. Please note that a continuation character is treated as such, even if it appears on a line after a remark character.

If you want to remark out a block do this:

(* This is a block that has been remarked out.

It is often used when writing documentation within the

program so that you, or the next person, can figure

out what you were doing.

Don't forget to put the ending remark symbol also! *)

NOTE: Within the source code editor remarks can be displayed in a different color.


Remove Array

Navigation: Reference > Commands >

Remove Array

 Print this Topic Return to chapter overview

This command will deallocate an array previously allocated using the ALLOC (Allocate Field) command or ALOCARY() function. The memory used will be released to be used again.

REMVA fn/v Required - The name of the field that had been previously allocated.

COMMENTS

This command will not remove any fields that have been defined in the original program, only those that have been allocated with the ALOCARY() function, or ALLOC (Allocate Field) command while the program is running.


Rename File

Navigation: Reference > Commands >

Rename File

 Print this Topic Return to chapter overview

Use this command to rename any file on the disk.

RENF f/c/e Required - The current file name including path and extension.

TO f/c/e Required - The new file name including path and extension.

COMMENTS

Unlike the DOS REN command you can move a file from one path to another by changing the path value in the to option. No error is reported if the file is not found or couldn't be renamed, and nothing is returned if the command is successful.

NOTE: If the file is in use by yourself or another user you will not be able to rename it.

SEE ALSO

DELF, DELF(), RENF()


Reopen File

Navigation: Reference > Commands >

Reopen File

 Print this Topic Return to chapter overview

Use this command to attach a file opened in a previous program to the current program.

ROPEN f/c/e Required - This is the number of the file in the previous program. This value can be passed to a subsequent program through the use of the reset option in the DEFINE command or as a PARAM (Parameter).

ADDALLFLDS If you specify this option the program will load all the fields from the data dictionary when the file is opened. This is only necessary if you have not specified any of the fields from this file within the program itself when it was compiled.

NOTE: During compilation the fields that make up any files used in the program will be automatically added to the field list. This will allow you to add fields to the screen form or report form after the program has been compiled and without recompiling.

COMMENT

If a record was active when the new program is run then that data will be available. Any action taken by the subsequent program will still be there when it returns to the previous program. This includes any records deleted, added, etc. Also, if a file error occurs in this program and it returns to the previous program with no other actions to that file, the error will still be in effect and you will be able to test for it using the FLERR() function.

You may use any fields from a reopened file in this program just as though that file was opened normally. The file, however, cannot be closed with the CLOSE command and will not be closed automatically when the program quits.

SEE ALSO

OPENV


Replace Fields in File

Navigation: Reference > Commands >

Replace Fields in File

 Print this Topic Return to chapter overview

The programmer can use this command to change the values in fields in a file in some or all records.

REPL fn/v1, fn/v2,..., fn/vx Required - This is the list of fields whose values will be replaced in this command.

If the MEM option is set then the program assumes that each field is an array field. In this command you must use regular array fields. When used in this option you would use just the field name portion, with no array element specified (ABC instead of ABC[X]). The program will automatically increment the array element number. You can specify the beginning array element number by setting this value in the NUM.

NOTE: A maximum of 80 fields/expressions/constants or any combination thereof may be included in a single field_list group.

WITH f/c/e1, f/c/e2,..., f/c/ex Required - These are the values that will be used as replacements. Each item on this list matches the item in the same position on the REPL list above.

MEM If you are replacing values in a field array in memory instead of a standard file include this option in the command line.

NUM fn/v If the MEM option is included, then this is Required - If MEM is specified then this is the number of elements in the array to be replaced.

FILE @file_num Required - The number/handle of the file to be used. If you do not include this option, the program will look for a default search file set in the SRCH (Search File) command. If that hasn't been previously set, the program will report an error and the command will be skipped. This entry will override any default value set in the SRCH command.

NOTE: You must enter something here as a place marker, so put '' (double single quotes) for this option if you want to use the SRCH file.

KEY key_expr Set this to the appropriate value to read the records in the file in the correct order. If you do not include this option, the program will look for a default key set in the SRCH command. If a default key hasn't been previously set the program will report an error and the command will be skipped. This entry will override any default value set in the SRCH command.

START f/c/e1,f/c/e2,...,f/c/ex The value to use as the beginning record. This is similar to doing a FINDV (Find Record) before the command. If the index you're searching on has multiple segments you may list the proper value for each segment, separating them with commas. This will allow you to specify the exact type for each of the segments. For example, suppose you're searching on an index that has two segments: a 5 character alpha and an I type field. Each record you want has the same alpha but the I field will change, and is in order. In the first record the I type field has a value of 0. The following would find the first record for that group, if it exists:

start 'ABCDE',0!

Notice that we separate the values with a comma. The only requirement is that the values be of the same type (and size) as the segments in the key. In this case we put the I type constant specifier (!) after the 0 to make sure that it is passed as an I type field.

SCOPE

scope - This option may help determine how many records are read. The options are: A (All), F (First), N (Next) and R (Rest). For more information about the scope specifier please see the general information at the beginning of this chapter.

f/c/e - If scope is set to N or F this is the number of records to delete.

An example of this would be:

... SCOPE A... //all records in the file. This is the default scope value.

... SCOPE N 20 ... //the next 20 records in the file

FOR lexpr You would use this option to restrict the records read in this command. If the expression did not resolve to .TRUE. the record would not be read. In this option, the search continues until the program reaches the end of file and then will quit. Any legal expression that resolves to .TRUE. or .FALSE. can be used.

An example of this would be:

... FOR (x=100) .and. (y=200) ...

WHILE lexpr This option also restricts the records read. However, the first time the expression resolves to .FALSE., the program stops reading records and continues to the next command. Here's the benefit of this option: if the program is reading records in a certain order (by a specific key) and the expression returns .FALSE. then the program knows that all the appropriate records have been read and there is no need to continue. For example: You want to read all the invoice records for a specific customer. The first record for that customer is found in the invoice file either by using the start_value option within this command, or through the FINDV (Find Record) command before executing this command. Then the WHILE expression would be:

INV_CUST_CODE = CUSTOMER_CODE

(This assumes that there is a field called INV_CUST_CODE in the invoice file and a like field in the customer file called CUSTOMER_CODE. The KEY option must be set to the proper value so that the records are deleted in CUSTOMER_CODE order, or you must have set the SRCH command previous to this command.) When the first invoice record for the next customer is read the program will stop reading records.

NOTE: If there is no START value you must set the scope value to R or N xxx. If you do not do this, the program will find the first record in the file and the WHILE expression will probably fail the first time. However, if the START option is used you can ignore this requirement.

CNTR fn/v This is an I type field that will be used for passing the number of records read, and the current array number, to your program. You can also use this to count the number of records read.

NOTE: If you have specified MEM above (you are replacing values in array fields) then you can also set the starting array element number here. Normally, this would be 1 (0 is also set, automatically to 1), but can be set to a different value if desired. However, this will apply to ALL array fields in the list.

DISP Each time a record is read the program will redisplay the screen fields, if you specify this option. This will slow down the operation of this command, depending on how many fields are displayed on the screen.

COMMENTS

This command provides you with an easy and quick method to replace the values in a group of fields from a file or an in memory array. This will also work with fixed length non-TAS files.


Return

Navigation: Reference > Commands >

Return

 Print this Topic Return to chapter overview

You would use this command to end a subroutine called with the GOSUB command, a UDF/UDC or an event called from an object on a form.

RET f/c/e If this is a return from a UDF, or certain form object events, you may specify a value to be returned.

A value can only be returned in the case of a UDF. In the case of a UDC or a return from a subroutine called through the GOSUB command the RET should not be followed by a value. In any case it will have no effect.

PROGRAM EDITOR prg Control -> Goto/gosub -> Ret

SEE ALSO

GOSUB, UDC, UDF

EXAMPLE

SHORT.SUB:

X = USER_FUNC()

QUIT

RET

FUNC USER_FUNC

//This is a simple function, it just returns the number 1

RET 1

The value of X will be set to 1 in the example above.

Another example would be in the OnClose event in a form. This example assumes you have set the label name to CheckClose:

CheckClose:

//Make sure the user has entered a value into XYZ

Ret XYZ<>''

In this example the program will evaluate whether XYZ is blank first and will return .TRUE. if it has something in it, or .FALSE. if not. You could've also just returned the appropriate value, e.g:

CheckClose:

//I don't want to close now.

RET .FALSE.

Obviously, you would want to change the label for the OnClose event at some time or the user would never be able to exit out of the program (short of Alt-Ctrl-Del), but that is beyond this section and is covered more fully in the Form Objects section.


Save Form

Navigation: Reference > Commands >

Save Form

 Print this Topic Return to chapter overview

Use this command to save to a DFM file on disk, a previously loaded form.

SAVE_FORM f/c/e Required - The name of the form to be saved. This is the "internal" name of the form, not the name you loaded it with. You can get that name with the GET_FORM_NAME() function which can be used as the value here.

TO f/c/e Required - This is the name of the disk file the form will be saved to. It can be the same name as the original or a different name that will have the effect of making a copy.

COMMENTS

This command gives you a very easy way to save a form after you've made changes to it using the SET_OBJECT command or the '@object_name.property' form of the EQUAL command. Any change you make to the form will be saved with the form, including all current data displayed in the objects, any changes made to those objects, etc. Through the use of this option you could easily setup a program that would allow the user to click on a field to have it removed from the form, set the VISIBLE property for that field to FALSE, save the form, and the field will not show up when it is subsequently loaded at a later time.

NOTE: This command will work with the active form only.

NOTE: If you save the form to the same name as the original form, the original form will be over-written and cannot be recovered.

SEE ALSO

LOAD_FORM


Save Record

Navigation: Reference > Commands >

Save Record

 Print this Topic Return to chapter overview

This command is used to save records to any file, TAS or non-TAS.

SAVE fn/v Required - This is the file number/handle where the record will be saved.

NOCNF The normal process is for the program to confirm with the user that it is okay to save the record. If you do not want the program to confirm first, include this option in the command line. In that case the program will just save the record without any indication to the user. This is useful when you are saving records to multiple files or when you're saving many records to one or more files. You may also want to use your own confirm process instead of the standard one that is a part of the runtime (see example below)

NOCLR Normally, after TAS Professional saves a record, it automatically clears the record and record number buffers. This makes sure that everything is ready to create a new record. However, if you include this option in the command line you will leave both the record buffer and number active. If your desire is to use the data already entered as the default for the next record, you can use the CLR (Clear Record Buffer) command (record option). Make whatever changes are necessary to the data, and when the next SAVE command is executed for this particular file, it will save the data as a new record and not just overwrite the last record saved.

NOTE: If you are running in a multi-user environment the record will continue to be locked after it is saved. If you clear the record buffer (CLR) then the lock will be released without losing the data in the record.

NOTE: If you are adding or changing records in a CodeBase file and you are looping through the file at the same time, such as updating a group of records in the file, one after another, you MUST use the NOCLR option or you will not find the next record properly.

UNLOCK If you have included the NOCLR option you can include this one to unlock the record. After the save operation if you have NOCLR the record will still be locked. If you use the CLR command (as described above) that will unlock the record also. However, you may want to have the same record in memory (no changes to buffer or record number) but not locked. In that case use this option.

NOTE: If you unlock the record and, at a later time, try to save the record again without re-finding it first, you may get an error that the record has been changed by another user, or, even worse, you may overwrite changes made by another user. Make sure you use this option only in situations where you are sure you're not going to want to save the record again.

GOTO label This is the line you want to transfer control to if the user answers No to the confirm question. If you do not specify a label here the program will continue with the line directly after this SAVE command.

ERR label If you specify a label here, the program will transfer control to the appropriate line if an error occurs during the command. If you specify NO_ERR as the label name, then no error will be displayed if one occurs. You can still test for an error after the command using the FLERR() function.

COMMENTS

A major feature of TAS Professional is the ability to treat non-TAS files as though they were TAS files. This is true here also. If a record is not active for a non-TAS file the program will automatically append it to the end of the file. Also, you can use the FINDV (Find Variable) command to get a record, make changes to it, and save it back to the same location within the file. This is always true with Fixed Length Records, however, in other types (non-TAS) if the record length changes you may end up destroying the integrity of the file.

SEE ALSO

OPENV

Note: If you are saving a record using a file handle using the openv command your save command needs to have an ampersand '@' here is an example.

Examples

SAVE @bkarinvl_hndl

These are example is if your using to files that share the same schema.

Btreive Example

openv 'myfile1' fnum file1_hndl lock N
openv 'myfile2' fnum file2_hndl lock N

scan @File1_hndl key @0 //read all records using natural order
save @file2_hndl nocnf //save the history
ends

Codebase Example

openv 'myfile1' fnum file1_hndl lock N
openv 'myfile2' fnum file2_hndl lock N

scan @File1_hndl key @0 //read all records using natural order
clr @file2_hndl buff // you need to clr the rec_buff
xfer from file1_hndl to file2_hndl Rec_Buff
save @file2_hndl nocnf //save the history
ends

More on codebase

scan @boxcount_hndl key MACHINE_ID

sloop_if OPENED = .t.

EXCEPTION = .t.

if exnote = ''

EXNOTE = exnote_error

OPENDATE = date()

OPENETIME = time()

USR_CODE = user

endif

save @boxcount_hndl nocnf noclr

//in codebase we have to use the noclr in the save in a scan.

// otherwise the scan looses the record to get the next record..

// and we get a codebase error -910

ends


Scan Records in File

Navigation: Reference > Commands >

Scan Records in File

 Print this Topic Return to chapter overview

This command combines the work of a WHILE/ENDW loop and the FINDV (Find Record) command into one super command. This is actually the starting point of a control structure.

SCAN file_num Required - The number/handle of the file to be used. If you do not include this option, the program will look for a default search file set in the SRCH (Search File) command. If that hasn't been previously set, the program will report an error and the command will be skipped. This entry will override any default value set in the SRCH command.

NOTE: You must enter something here as a place marker, so put '' (double single quotes) for this option if you want to use the SRCH file.

KEY key_expr Set this to the appropriate value to read the records in the file in the correct order. If you do not include this option, the program will look for a default key set in the SRCH command. If a default key hasn't been previously set the program will report an error and the command will be skipped. This entry will override any default value set in the SRCH command.

START f/c/e1,f/c/e2,...,f/c/ex The value to use as the beginning record. This is similar to doing a FINDV (Find Record) before the command. If the index you're searching on has multiple segments you may list the proper value for each segment, separating them with commas. This will allow you to specify the exact type for each of the segments. For example, suppose you're searching on an index that has two segments: a 5 character alpha and an I type field. Each record you want has the same alpha but the I field will change, and is in order. In the first record the I type field has a value of 0. The following would find the first record for that group, if it exists:

start 'ABCDE',0!

Notice that we separate the values with a comma. The only requirement is that the values be of the same type (and size) as the segments in the key. In this case we put the I type constant specifier (!) after the 0 to make sure that it is passed as an I type field.

SCOPE

scope - This option may help determine how many records are read. The options are: A (All), F (First), N (Next) and R (Rest). For more information about the scope specifier please see the general information at the beginning of this chapter.

f/c/e - If scope is set to N or F this is the number of records to read.

An example of this would be:

... SCOPE A... //all records in the file. This is the default scope value.

... SCOPE N 20 ... //the next 20 records in the file

FOR lexpr You would use this option to restrict the records read in this command. If the expression did not resolve to .TRUE. the record would not be read. In this option, the search continues until the program reaches the end of file and then will quit. Any legal expression that resolves to .TRUE. or .FALSE. can be used.

An example of this would be:

... FOR (x=100) .and. (y=200) ...

WHILE lexpr This option also restricts the records read. However, the first time the expression resolves to .FALSE., the program stops reading records and continues to the next command. Here's the benefit of this option: if the program is reading records in a certain order (by a specific key) and the expression returns .FALSE. then the program knows that all the appropriate records have been read and there is no need to continue. For example: You want to read all the invoice records for a specific customer. The first record for that customer is found in the invoice file either by using the start_value option within this command, or through the FINDV (Find Record) command before executing this command. Then the WHILE expression would be:

INV_CUST_CODE = CUSTOMER_CODE

(This assumes that there is a field called INV_CUST_CODE in the invoice file and a like field in the customer file called CUSTOMER_CODE. The KEY option must be set to the proper value so that the records are read in CUSTOMER_CODE order, or you must have set the SRCH command previous to this command.) When the first invoice record for the next customer is read the program will stop reading records.

NOTE: If there is no START value you must set the scope value to R or N xxx. If you do not do this, the program will find the first record in the file and the WHILE expression will probably fail the first time. However, if the START option is used you can ignore this requirement.

DISP Each time a record is read the program will redisplay the screen fields, if you specify this option. This will slow down the operation of this command, depending on how many fields are displayed on the screen.

NLOCK If this option is included in the command the program will NOT lock the record upon finding it as it would normally do in a multi-user situation. The default operation is to place a lock on the record upon reading it.

REV If this option is included, the SCAN will be performed in reverse order.

COMMENTS

This command, together with the other parts of the control structure, could easily become your most used command when accessing records in any file. With just two commands, SCAN and ENDS (Endscan) you can create a loop that will automatically provide to the commands within that loop just the records necessary for the operation and no others. When the last record in the file, or the last appropriate record, has been read, the program will automatically transfer control to the line after the appropriate ENDS command and continue with the program. The SLOOP, and SLOOP_IF commands will transfer control back to the beginning of the loop and the next record will be found without any other Find command! This single structure can replace many lines of code in your programs.

The SEXIT, and SEXIT_IF [****]commands will exit the loop. This single structure can replace many lines of code in your programs.

For more information on the different structured programming commands, and the SCAN command in particular, please see Structured Programming Commands.

SEE ALSO

SEXIT, SEXIT_IF, SLOOP, SLOOP_IF, ENDS

Example

This example would scan the bkarinvl_hndl file and link up records in three other files by using the findv command. Then sending data to a report. When it finished it would print the report. This also shows how to create a function that can be used to filter the data for you.

btnprint.click: // the event

scan @bkarinvl_hndl key bkar.invl.invnm start fromso //Scan the records

findv m fnum bkarinv_hndl key BKAR.INV.SONUM value bkar.invl.invnm // find the inv header

findv m fnum bkicmstr_hndl key bkic.prod.code value bkar.inv.pcode

findv M fnum bkicloc_hndl key bkic.loc.key value bkar.invl.pcode,BKAR.INV.LOC

sloop_if bkar.invl.invnm = 0 // Loop back if true if you used a sexit or sexit_if you would ends

sloop_if .n. filter1()

output_report_data rb_num 1 // send data to report

'@progressbar1.position' = REC_PERCENTAGE(bkarinvl_hndl) //update the progress bar

ends // Stop scanning

print_report //Print the report

ret

you could also use this scan line and take out the sloop_if using a for or a while

scan @bkarinvl_hndl key bkar.invl.invnm start fromso for filter1()

or

scan @bkarinvl_hndl key bkar.invl.invnm start fromso while filter1()

func filter1

if fromso <> 0

if fromso < bkar.invl.invnm

ret .f.

endif

endif

ret .t.

if thruso <> 0

if bkar.invl.invnm > thruso

ret .f.

endif

endif

// you could add more filters if needed for your application here.

ret .t.

Note : If using this type filter in a scan fields in this checking have to be in file your scanning.

Example Using scan and xfer in codebase where we have two files sharing same schema and rec_buf

openv 'myfile1' fnum file1_hndl lock N
openv 'myfile2' fnum file2_hndl lock N

scan @File1_hndl key @0 //read all records using natural order
clr @file2_hndl buff // This has to be on the loop
xfer from file1_hndl to file2_hndl Rec_Buff
save @file2_hndl nocnf //save the history
ends

More on codebase

scan @boxcount_hndl key MACHINE_ID

sloop_if OPENED = .t.

EXCEPTION = .t.

if exnote = ''

EXNOTE = exnote_error

OPENDATE = date()

OPENETIME = time()

USR_CODE = user

endif

save @boxcount_hndl nocnf noclr

//in codebase we have to use the noclr in the save in a scan.

// otherwise the scan looses the record to get the next record..

// and we get a codebase error -910

ends


Scan End

Navigation: Reference > Commands >

Scan End

 Print this Topic Return to chapter overview

This is the end point of the process control command SCAN/ENDS.

ENDS No options / No Modifiers

COMMENTS

For more information on the different structured programming commands, and the ENDS command in particular, please see Structured Programming Commands.

SEE ALSO

SCAN, SLOOP, SLOOP_IF, SEXIT, SEXIT_IF


Scan Exit

Navigation: Reference > Commands >

Scan Exit

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will exit from a SCAN loop. This is one part of a complete command structure.

SEXIT No options / No Modifiers

COMMENTS

For more information on the different structured programming commands, and the SEXIT command in particular, please see Structured Programming Commands.

SEE ALSO

SCAN, SEXIT_IF, SLOOP, SLOOP_IF, ENDS


Scan Exit If

Navigation: Reference > Commands >

Scan Exit If

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will control whether to exit from a SCAN loop. This is one part of a complete command structure.

SEXIT_IF lexpr Required - If the expression resolves to .TRUE. then the program will transfer control to the line immediately following the appropriate ENDS (Endscan) command.

COMMENTS

For more information on the different structured programming commands, and the SEXIT_IF command in particular, please see Structured Programming Commands.

SEE ALSO

SCAN, SEXIT, SLOOP, SLOOP_IF, ENDS


Scan Loop

Navigation: Reference > Commands >

Scan Loop

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will loop back to the beginning in a SCAN/ENDS loop. This is one part of a complete command structure.

SLOOP No options / No Modifiers

COMMENTS

For more information on the different structured programming commands, and the SLOOP command in particular, please see Structured Programming Commands.

SEE ALSO

SCAN, SEXIT, SEXIT_IF, SLOOP_IF, ENDS


Scan Loop If

Navigation: Reference > Commands >

Scan Loop If

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will control whether to loop back to the beginning in a SCAN/ENDS loop. This is one part of a complete command structure.

SLOOP_IF lexpr Required - If the expression resolves to .TRUE. then the program will transfer control to the appropriate SCAN line. This would be equivalent to executing the ENDS (Endscan) command.

COMMENTS

For more information on the different structured programming commands, and the SLOOP_IF command in particular, please see Structured Programming Commands.

SEE ALSO

SCAN, SEXIT, SEXIT_IF, SLOOP, ENDS


Search File

Navigation: Reference > Commands >

Search File

 Print this Topic Return to chapter overview

This command will set the default search file and key that can be used in any other command that refers to a file and key.

SRCH fn/v Required - This is the number/handle of the file to be specified as the default value.

KEY key_expr Required - Set this to the appropriate value to read the records in the file in a particular order.

NOTE: If you do not want to specify any key but want to search sequentially through the file, set the null key. For example:

KEY @0 ( 0 is the number zero and not the letter 'O')

COMMENTS

By using this command the programmer can set the default values to be used by any other command that accesses data in files. For more information on the file keys please refer to Commands General Information.

To reset the SRCH value execute the command without a file or key specified. For example:

SRCH

This will turn off this feature. If you have a command that expects to use the default file/key an error will be returned when that command (SCAN, DALL, etc.) is executed.


Set Btrieve File Active

Navigation: Reference > Commands >

Set Btrieve File Active

 Print this Topic Return to chapter overview

If you have two or more TAS Pro 5.1 files that all use the same buffer (i.e., the same file descriptor

name or schema), and you need to switch from one to the other when searching for a particular record

(FIND command), then you need to use this command to make the switch.

SETACT file_descriptor_name FILE file_name

file_descriptor_name - sac - Required - The FD name (or schema for 3.0 users) for the files to be switched. The name can be a maximum of 8 characters. Must be the actual FD name.

file_name - sac - Required - The name of the file that needs to be SETACT. The name can be

a maximum of 8 characters. Must be the actual file name.

COMMENTS

We recommend that you use the OPENV (Open Variable) and FINDV (Find Variable) commands

which obviate the need for this command. However, the SETACT command is included here for

compatibility with Previous versions of TAS Professional.

EXAMPLE

curphist:

FILENAME="BKPRHIST"

setact bkprcurp file bkprhist

BKPR.CURP.EMPNM = OLD.CODE

nextcurp1: //this is the prhistory file

find M srch BKPR.CURP.EMPNM err invl1 NOCLR

BKPR.CURP.EMPNM=NEW.CODE

save BKPRhist nocnf

goto nextcurp1

The above example uses the open command and find command both of these commands also still work however we do recomend using the openv and findv commands.

See Also


Set CodeBase File Active

Navigation: Reference > Commands >

Set CodeBase File Active

 Print this Topic Return to chapter overview

This command will point the fields in a program at a specific CodeBase file. This would be used ONLY IF there are two or more CodeBase files that have been opened in a program using the same FD and, you want to access the fields in the files using the field names.

SETCBACTIVE f/c/e Required - This is the file handle you wish to set active.

COMMENTS

When a CodeBase file is opened the buffer for that file is maintained by CodeBase, not in TAS Pro. So, if you open two CodeBase files that use the same FD (or set of fields) the first file opened in the program gains control of those fields. If you find a record in the file that is not active you will not be able to see the results in the fields. The best way to think about this is that the fields are connected to a specific buffer. The active buffer is the first file opened. If you want to connect the fields to a different buffer you must use this command to force a reconnect. NOTE: This command will not connect fields to a file that doesn't have the same FD.


Set Focus

Navigation: Reference > Commands >

Set Focus

 Print this Topic Return to chapter overview

This command will set an object on the current form/screen as active.

SET_FOCUS f/c/e Required - This is the name of the object you want to set active. The object must exist on the current form and must be able to accept user input.

COMMENTS

When a form is loaded the program will automatically set the first object active as you have specified when designing the form. In some cases you might want to set a different object active, or when you return from a TAS routine you might want the user to automatically start with a certain object without forcing them to click on that object. This command has the same effect as if the user moved their mouse cursor to the object and left-button clicked on it.

SEE ALSO

last_obj()


Set All Objects Property Value

Navigation: Reference > Commands >

Set All Objects Property Value

 Print this Topic Return to chapter overview

This command will allow you to update property values of all the objects on a form using a single command.

SET_ALL_OBJECTS

PROPERTY f/c/e Required - The property name of the object.

VALUE f/c/e Required - The new value for the property you want to change.

USE_FORM f/c/e Generally, you will be changing a property of an object on the current form. However, if you want to access a different form you would put that form's pointer value here. You can get this value by using the FORM_PTR() function.

NOTE: Unless you're specifically accessing an object on a form OTHER THAN your current form you will not need to use this option.

TAG f/c/e By setting this value you can control which objects the command effects. If you set this value then only those objects where the TAG property value matches will be updated.

COMMENTS

Use this command to quickly and easily update a group of objects. You can control which objects are updated by setting the TAG value and setting the TAG properties in the appropriate objects to the same value.

SEE ALSO

SET_OBJ_PROP(), SET_OBJECT


Set Object Property Value

Navigation: Reference > Commands >

Set Object Property Value

 Print this Topic Return to chapter overview

This command will allow you to update property values of objects on a form.

SET_OBJECT f/c/e Required - The object name you want to access.

PROPERTY f/c/e Required - The property name of the object.

VALUE f/c/e Required - The new value for the property you want to change.

USE_FORM f/c/e Generally, you will be changing a property of an object on the current form. However, if you want to access a different form you would put that form's pointer value here. You can get this value by using the FORM_PTR() function.

NOTE: Unless you're specifically accessing an object on a form OTHER THAN your current form you will not need to use this option.

COMMENTS

This command is similar to the '@object.property' option in the EQUAL (=) command. However, this command can be used on forms also, where the EQUAL command variation cannot. You can also specify on which form the object exists, you cannot do that using the EQUAL command.

Example of Set_Object

set_object 'button1' property 'caption' value 'My Button Caption'

or

'@button1.caption' = 'My Button Caption'

SEE ALSO

SET_OBJ_PROP(), SET_ALL_OBJECTS, EQUAL (=), Tips GET_OBJ_PROP(1,2,3)


Setup Report Buffer

Navigation: Reference > Commands >

Setup Report Buffer

 Print this Topic Return to chapter overview

This command is used to create the report buffer used in the other report commands.

SETUP_REPORT_BUFF

RB_NUM f/c/e Required - The Report Buffer Number. This must start at 1 (in any report the first page - main - automatically starts at 1) and there are a maximum of 15 available. Each level is going to have to be a different number with the sub-levels linking back to a master.

REPORTNAME f/c/e If you are setting up Report Buffer Number 1 then you must include the name of the report here. This is the name of the RTM file to use. If it's not in the current subdirectory, you must also include a complete path.

LINK_TO f/c/e If this is a sub-level buffer, you would put the master buffer RB_NUM here.

COMMENTS

The program, WTASDMGR.SRC, contains a complete printing routine that displays a multi-level printing process. It starts at the label tbPrint.Click. WTASDMGR.RTM is the actual report format that is used. We provide the program in source format, documented internally, so that you can see first hand a multi-level report.

These buffers will be the ones you refer to in Output Report Data and Update Report Data.

NOTE: You must start with RB_NUM 1. This initializes the buffers for a new report.

NOTE: This command must not be in the START (or OnStart) event for the form. It can be anywhere in the normally executed code and is generally immediately before the report data collection routines are executed.

NOTE: When a buffer is created the program scans through the report format and makes sure that any DataFields on that page are included. It also will include a space in the buffer if you have defined a field in your program where the name matches the name of an object used on that page. This is how you control whether or not that object will appear while a specific record is printing. The field in your program should be defined as a type A and size of 3. Then, during the data collection process (OUTPUT_REPORT_DATA and UPDATE_REPORT_DATA commands), if you save 'ON' to the field the object will be printed, if you save 'OFF' it won't be printed. You must also check the OnPrint Control Flag checkbox for the object before this will have the desired effect. For an example of this please refer to the Tutorial, PART 4 - CREATING A TAS Professional REPORT.

SEE ALSO

PRINT_REPORT

EXAMPLE

A step-by-step example of setting up a new report is provided in the Tutorial.

Note : if you want to re use the report buffer and clear it for another report re issue the the command

Sample code

(* The following is a what a simple report might look like that

prints a customer code and name from the file BKARCUST.

This report assumes that the file has been opened someplace

else and that the handle field name is bkarcust_hndl.

The first step is to create the buffer for the data we will save.

Notice that we use '_' in the setup and '.' in the output. *)

setup_report_buff rb_num 1 reportname 'simple'

(* The SCAN command will loop through the file starting at

the beginning and retrieving each record in customer code order. *)

scan @bkarcust_hndl key bkar.custcode

output_report_data rb_num 1

ends

// at the end of the scan we execute the report

print_report

// to clear the report buffer

setup_report_buff rb_num 1 reportname 'simple'

ret


Sort Array

Navigation: Reference > Commands >

Sort Array

 Print this Topic Return to chapter overview

This command will sort an array of fields in ascending or descending order. You can combine sort fields and can also move associated fields, even though they aren't part of the sort field.

SORTA fn/v/e Required - The field to be sorted. This can also be an expression containing several fields. The counter_field must be used as the array element specifier in the field or expression. For example:

cust_state[cntr]+cust_zip[cntr]

or

cust_state[cntr]

NUM f/c/e Required - The number of elements to sort. The actual maximum number of array elements must be at least number_of_elements+1.

MOVE fn/v1, fn/v2,..., fn/vx Required - A list of array fields to be moved along with the field to be sorted. You must include at least the sort field itself. You may also include any other array fields that you want to be ordered in the same fashion as the sort field. The counter_field MUST NOT be specified as the array element in these fields. For example:

cust_state, cust_zip ,cust_sales, etc...

NOTE: This is a command change from previous versions of TAS Professional. If your array doesn't sort properly, check this first.

CNTR fn/v Required - This is the field that you will use in the command as the array specifier. It must be of type I.

which_way_to_sort ASC / DSC - Use ASC for ascending (names and numbers get larger as the array element number increases) or DSC for descending (names and numbers get smaller as array element number increases).

Sample

define MfgStrtDate type D size 8 array 100
define MfgGroup type I size 3 array 100
define MfgQty type N size 6 array 100

If you use the following code the sort adds the items instead of treating them independently.
Will not sort correctly.

sorta MfgGroup[aCntr] + MfgStrtDate[aCntr] num aCntr move MfgGroup,MfgStrtDate,MfgQty cntr aCntr dsc

This will sort correctly. use the str() function in this command.

sorta str(MfgGroup[aCntr]) + dtos(MfgStrtDate[aCntr]) num aCntr move MfgGroup,MfgStrtDate,MfgQty cntr aCntr dsc

To effect proper sort you may need to use dtos() for dates or ttos for time. You may also if using a time fld conver this to a record??

SEE ALSO

RDA, WRTA


Spell Checking

Navigation: Reference > Commands >

Spell Checking

 Print this Topic Return to chapter overview

Check_Spelling

This Command will allow you to Spell check any Entry Box or memo on the Screen *

Check_Spelling

Setup (optional) - Brings up the TAS Professional powered by CAS Spell Checking Setup Dialog.(This is for setup up were the Dictionary is and Such)

Object f/c/e (optional) – Object to spell check

Use_form f/c/e (optional) – Form to spell check or the Form the Object or TAG's are on.

TAG f/c/e (optional) - spell check every object with This TAG number.

NOTE : At this time spell checking is only support for the TASEnter,TASmemo, Memo , and TASComboEnter Object.

Example : We have included a sample program to show you how to use this powerfull feature in your TAS Professional programs. This example program is located in the sample folder program name is spellchecktest.src , spellchecktest.dfm. If you do not have this sample code please feel free to contact us by email and request this code. at support@cassoftware.com

Related topic


Stuff Characters Into a Field

Navigation: Reference > Commands >

Stuff Characters Into a Field

 Print this Topic Return to chapter overview

This command will either overwrite a field or insert a field into another field.

MID fn/v Required - The receiving field. Must be of type A.

START f/c/e Where to start adding the new characters. The first character in the receiving_field is character 1. If no value is given the value will default to 1.

NCHR f/c/e The number of characters to add. If no value is given the program will use the internal size of the FLD value.

FLD f/c/e Required - The characters that will be put into the receiving field. Any type of field may be used; however, the field is not automatically converted to type A. It will be added in its natural form.

INS If this option is specified the program will insert the characters, moving the current characters to the right starting with the character at the start location. The characters at the end of the field, if any, will be deleted. The default is to overwrite the characters at the current location.

EXAMPLE

Assume you have a field X that has the value of:

'ABCDEFGHIJK'

and is 11 characters long (it's full). If you execute the following two commands (not sequentially) you will get:

MID X START 4 NCHR 2 FLD '12' INS

'ABC12DEFGHI'

MID X START 4 NCHR 2 FLD '12'

'ABC12FGHIJK'

SEE ALSO

REPLACE()


Time Get/Set

Navigation: Reference > Commands >

Time Get/Set

 Print this Topic Return to chapter overview

Get the current system time, or reset it to a new value.

TIME fn/v Required - The T type field that will either receive the current time (GET) or contain the value to be used in setting the time (SET).

do_what Required - GET / SET

GET means to obtain the current time and put it into time_field.

SET means to set the time using the value in time_field.

COMMENTS

This command will affect just the workstation it is running on and no others if you are running on a network. This has the same effect on the computer as if you typed in DATE at the DOS prompt and entered the value or adjusted the Windows time.

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


Trace

Navigation: Reference > Commands >

Trace

 Print this Topic Return to chapter overview

This command is used to create a listing of every command executed and each time the user clicks on a object that has a CLICK event.

TRACE

START f/c/e Use this to turn on the trace mode. You must supply a file name that will be created and written to. The program will remain in trace mode, even if you chain to other programs or exit from the program that calls this command.

NOTE: If you specify an existing file it will be overwritten automatically without any response from the user.

WRITE f/c/e Once you have started the trace process by executing the START option you can add your own information to the file using this option. You would generally use this to write out field values, or other items to watch, since you will know exactly where the user is in the program at any time.

STOP This will stop the trace process and will close the text file. If you wish to continue the trace process somewhere else you will have to use the START option again.

COMMENTS

This command can produce a lot of information about what's happening in your program. Generally you would use this when you want to know what's happening when a user clicks on a button or a menu choice, etc. You would also, generally, use this in connection with the Compile in Debug Mode option (Defaults Tab) in the compiler. If you do, the process will include the actual line number of each command as it's executed. A typical line would look like the following:

IF PrgLineNum: 275 \ADV60\PROGRAM2.RWN

The first part is the actual command, in this case an IF. The second part is the line number within the source file, line 275. The last part is the name and location of the program being executed. If the user clicks on an object the following will be saved:

User Clicked: sortmenu4 Label Found \ADV60\PROGRAM1.RWN

It tells you that the user clicked on an object, the name of that object is sortmenu4. It also tells you that a label was found in the current program and what the name of that program is. If the label is not found the line will look like this:

User Clicked: sortmenu4 Label NOT Found \ADV60\PROGRAM1.RWN

EXAMPLE

The following is a piece of a debug file for a TAS Professional program. Notice that in PROGRAM2 we didn't use the Compile in Debug Mode option in the compiler and the line numbers are all 0. You may also notice that the last command in PROGRAM2 is a RET and then PROGRAM1 starts. PROGRAM2 was called with a CHAIN and eventually returned to PROGRAM1.

SET_OBJECT PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

SET_FOCUS PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

RET PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

RET PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

RET PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

= PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

RET PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

FINDV PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

RET PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

IF PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

RET PrgLineNum: 0 C:\ADV60\PROGRAM2.RWN

GOSUB PrgLineNum: 141 C:\ADV60\PROGRAM1.RWN

SET_OBJECT PrgLineNum: 247 C:\ADV60\PROGRAM1.RWN

IF PrgLineNum: 248 C:\ADV60\PROGRAM1.RWN

SET_OBJECT PrgLineNum: 249 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 250 C:\ADV60\PROGRAM1.RWN

UPDTA PrgLineNum: 251 C:\ADV60\PROGRAM1.RWN

ON PrgLineNum: 252 C:\ADV60\PROGRAM1.RWN

SCAN PrgLineNum: 252 C:\ADV60\PROGRAM1.RWN

IF PrgLineNum: 253 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 255 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 256 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 257 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 258 C:\ADV60\PROGRAM1.RWN

IF PrgLineNum: 259 C:\ADV60\PROGRAM1.RWN

IF PrgLineNum: 261 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 262 C:\ADV60\PROGRAM1.RWN

ELSE PrgLineNum: 263 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 264 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 265 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 266 C:\ADV60\PROGRAM1.RWN

FINDV PrgLineNum: 267 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 268 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 269 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 270 C:\ADV60\PROGRAM1.RWN

ELSE PrgLineNum: 271 C:\ADV60\PROGRAM1.RWN

ON PrgLineNum: 272 C:\ADV60\PROGRAM1.RWN

SCAN PrgLineNum: 252 C:\ADV60\PROGRAM1.RWN

ON PrgLineNum: 273 C:\ADV60\PROGRAM1.RWN

SCAN PrgLineNum: 273 C:\ADV60\PROGRAM1.RWN

IF PrgLineNum: 275 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 278 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 279 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 280 C:\ADV60\PROGRAM1.RWN

= PrgLineNum: 281 C:\ADV60\PROGRAM1.RWN


Transaction

Navigation: Reference > Commands >

Transaction

 Print this Topic Return to chapter overview

Using this command you can be assured that an entire set of file updates will be completed. Otherwise, they can be rolled back to an original state.

TRANSX sac Required - B / C / R

B - Begin; this option is used at the beginning of the transaction.

C - Commit; will finalize the transaction and permanently update the files.

R - Rollback; will return the files to the state before the original Begin command.

ERR fn/v Required -You must provide a field that will be used to receive any error number provided by the routine. If the command step is successful the value returned is 0. This field must be of type I.

COMMENTS

The correct transaction process is:

TRANSX B && begin

...

all file updates done here

...

TRANSX C && commit

However, if an error occurs while the file updates are being accomplished (between the TRANSX b and TRANSX c steps) you would use the command:

TRANSX R && rollback

and any updates that were completed after the TRANSX b but before the TRANSX c would be undone.


Trap

Navigation: Reference > Commands >

Trap

 Print this Topic Return to chapter overview

This command is used to set internal traps so that if a certain key is pressed the program will take an appropriate action.

TRAP trap_name_list - sac Required - The name of the trap. These are listed below. You may include multiple trap names for a single trap command. Each of the traps will be set to the same values. This is generally used when you are setting a group of traps to IGNR (ignore) or DFLT (default).

do_what - sac GOSUB / DFLT - Required - The options are: DFLT - Default; don't call a subroutine when the user presses that key (or key combination). GOSUB - transfer control to the line label indicated (typically the beginning of a subroutine) when the user presses that key; you need to make sure the routine is terminated with a RET.

IGNR / RET_FALSE / RET_TRUE - These options apply to the RLCK (Record Lock) trap only. The trap is checked if a record the user is trying to read is locked by another user. IGNR - The user will receive a message the record is locked and will remain in a loop until the record becomes available. RET_FALSE - The trap will return a value of .FALSE. to the locking routine which will immediate exit the search loop and return the value of 84 (record locked) or 85 (file locked) in the FLERR() function. RET_TRUE - The trap will return a value of .TRUE. to the locking routine and the search loop will execute again. This would be the equivalent of setting the trap to IGNR except that the user won't even get a message that the record is locked.

label Required if GOSUB is specified. You must specify the label name so the program will know where to transfer control.

COMMENTS

Traps are event driven rather than process commands. Nothing actually happens when the command is executed until the appropriate key is pressed or the action occurs. By setting a TRAP you a doing the equivalent of specifying a ShortCut property in a TMenuItem object without having to create it.

NOTE: When the TRAP command is executed the program sets a flag in the active form that tells it to watch the keys being entered on that form. So, if you set a TRAP in the program it will only be effective when the form that is currently active remains active. If you load a different form that TRAP (or group of traps) will no longer be active until you return to the previous form. This is also true if you load a temporary form and set a trap while that form is loaded. Once you exit from that form the trap will no longer be active. HOWEVER, if you turn on the watching process by specifying a single TRAP ALL the traps currently active, will be active for the new form also. Due to this, you should use the XTRAP command to set the group of traps to the appropriate DO_WHAT option before loading a new form and reset them after the form exits.

NOTE: In several of the form objects that allow user entry you can set traps (KeyTraps) that are specific to that object. This has the same effect as though you set the traps in program code without having to actually write that code. This is a very quick and easy way to add TRAPs to your program and are the preferable method instead of using the actual command. However, the RLCK and RSRCH traps cannot be set this way.

The traps available are:

TRAP NAME What it does

F1 - F10 Executes trap if user presses key
SF1 - SF10 Executes trap if user presses SHIFT & key
CTL_F1-CTL_F10 Executes trap if user presses CTRL & key
ALT_F1-ALT_F10 Executes trap if user presses ALT & key

NOTE: ALT-F4 Has been disabled since this is a command in Windows(R) to close a window. We have trapped this so that this can not happen since you could have processes going that could cause data corruption as of 11/07/07

CTL_PG_UP Executes trap if user presses CTRL & Page Up key
CTL_PG_DN Executes trap if user presses CTRL & Page Down key
CTL_HOME Executes trap if user presses CTRL & Home key
CTL_END Executes trap if user presses CTRL & End key
CTL_A - CTL_Z Executes trap if user presses CTRL & key
ALT_A - ALT_Z Executes trap if user presses ALT & key
ESC Executes trap if user presses Escape key
UPAR Executes trap if user presses up arrow (^) key
DNAR Executes trap if user presses down arrow key
LT_A Executes trap if user presses left arrow (<-) key
RT_A Executes trap if user presses right arrow (->) key
HOME Executes trap if user presses HOME key
END Executes trap if user presses END key
PG_UP Executes trap if user presses Page Up key
PG_DN Executes trap if user presses Page Down key
INSRT Executes trap if user presses Insert key
DEL_KEY Executes trap if user presses DEL or Delete key
WD_LT Executes trap if user presses the CTRL (control) and left arrow (<-) keys at the same time
WD_RT Executes trap if user presses the CTRL (control) and right arrow (->) keys at the same time
TAB Executes trap if user presses the TAB key
BCK_TAB Executes trap if user presses the SHIFT and TAB key at the same time

RSRCH Executes trap when a record is read from any file. Use the LAST_FILE() function in connection with this trap to determine which file was accessed.

RLCK Executes trap when a record to be read is locked by another user. See IGRN / RET_FALSE / RET_TRUE options above for additional do_what options for this trap. You can also use the GOSUB option. In that case you need to return .TRUE. (stay in the search loop) or .FALSE. (exit from the search loop). If you don't return a value it defaults to .TRUE. If this trap is set the user will not receive any messages about the record being locked unless you display one.

L_EXIT Executes trap if record is locked and user answers N (No) no system's offer to retry. See below. The L_EXIT trap works in the following manner: if the user tries to access a record that is locked and gets the system message about retrying and answers No (N), this trap will be executed. The only option that applies is the GOTO option. If that option is set, when the user answers N, the system will transfer control to the label specified in the command.

ENTER_KEY Executes trap if user press the ENTER key.

MOUSE_MOV Executes trap if the user moves the mouse. Updates the mouse x/y coordinates.
MOUSE_LBD Executes trap if the user presses the left button down on the mouse. Updates the mouse x/y coordinates.
MOUSE_LBU Executes trap if the user releases the left button on the mouse after it's been pressed down. Updates the mouse x/y coordinates.
MOUSE_RBD Executes trap if the user presses the right button down on the mouse. Updates the mouse x/y coordinates.
MOUSE_RBU Executes trap if the user releases the right button on the mouse after it's been pressed down. Updates the mouse x/y coordinates.

NOTE: See Mouse_Row() and Mouse_Col() to retrieve the mouse coordinates

EXAMPLE

You can see an example of this command in action in the WTASFLOC.SRC program.


Trap Operations

Navigation: Reference > Commands >

Trap Operations

 Print this Topic Return to chapter overview

This command can be used to save, restore or change the entire set of traps. Use this command to store the current traps when you're changing forms or something similar where you want to keep the current

XTRAP what_to_do - sac SAVE / RSTR / CHG Required - SAVE - save the trap values to the save_to_field. RSTR - restore the trap values from the save_to_field. CHG - change the trap values only.

FLD fn/v If you specify SAVE or RSTR above this is the required field that is used to save the trap information. The total size for all traps is 1000 bytes.

change_traps - sac NOCHG / DFLT What to do with the traps. NOCHG - make no changes (this is the default option). DFLT - reset traps to their default values.

COMMENTS

Use this command to store the current traps when you're changing forms or something similar where you want to keep the current settings but don't want them to be active while the new form is loaded.


Trim Field

Navigation: Reference > Commands >

Trim Field

 Print this Topic Return to chapter overview

This will change the leading or trailing spaces in an A type field to binary 0s.

TRIM fn/v

trim_what TRAIL - Trim trailing characters. This is the default option.

LEAD - Trim leading characters.

COMMENTS

When you use the function TRIM() the program puts the trimmed field in the temporary data space. If you are trying to TRIM a field that is larger than that space you will get the message that the program is out of room in the temporary data area. This command is provided to you so that you can TRIM a field larger than the temporary data area within its own space. Using this command you will not run out of memory.

NOTE: This command will NOT work with CodeBase fields. You must use the TRIM() function.

SEE ALSO

TRIM()


Unlock All Records/Files

Navigation: Reference > Commands >

Unlock All Records/Files

 Print this Topic Return to chapter overview

Use this command to easily unlock all locked records or files.

ULKALL No options / No modifiers

COMMENTS

If no records/files are locked, nothing will be done.


Upcase Field

Navigation: Reference > Commands >

Upcase Field

 Print this Topic Return to chapter overview

This will change all or some subset of all the characters in an A type field to upper case.

UP fn/v Required - The name of the field to be changed to upper case.

ALL If this option is included in the command line then all of the characters in the field will be changed to upper case. If it is not specified then only those characters not surrounded by quote marks (single or double) will be changed to upper case.

COMMENTS

When you use the function UP() the program puts the upcased field in the temporary data space. If you are trying to UP a field that is larger than that space you will get the message that the program is out of room in the temporary data area. This command is provided to you so that you can UP a field larger than the temporary data area within its own space. Using this command you will not run out of memory.

SEE ALSO

UP()


Update Array Field

Navigation: Reference > Commands >

Update Array Field

 Print this Topic Return to chapter overview

This command is used to change all or several of the values in an array or group of arrays. It will quickly and efficiently add or subtract values, or insert or delete a specific element number in an array.

UPDTA fn/v1, fn/v2,..., fn/vx Required - The names of the array fields to be changed. You may set the array element spec to the first element number to be updated, or in the case of INS/DEL, the location to start the insertion/deletion.

do_what Required - INS / DEL / ADD / SUB / CLR

ADD - Add a value to an array of values. The type of the value being added needs to be the same as the type of the array field(s). The value specified will added the number of times specified, starting with the array element indicated in array_field_list.

SUB - Subtract a value from an array of values. The type of the value being subtracted needs to be the same as the type of the array field(s).

INS - Insert a number of lines with value being the number. In this case the program will move out the elements from the starting element number so that there are effectively value number of elements available for new values.

DEL - Delete a number of lines with value being the number. In this case the program will move in the elements from the starting element number so that value number of element values will be overwritten.

CLR - Clear the array element values, with the number of elements affected determined by times. If numerical, date, time, etc. set to 0; if alpha set to spaces.

TIMES f/c/e In the case of ADD/SUB/CLR this is the number of elements to update. If this isn't included the program will automatically use the number of elements in the array field. This is ignored in INS/DEL since the program always uses the number of array elements specified by value.

VAL f/c/e Required - This option is required in all but CLR. It is the value to be added or subtracted or the number of elements (lines) to insert or delete.

COMMENTS

Note that in the INS and DEL mode that the times value doesn't need to be set. The program will automatically continue moving in or out element values until it reaches the end of the array for that particular field.

SEE ALSO

RDA, WRTA, SORTA

EXAMPLES

ADD - Add a value to an array of values. For example, if the following were true:

Element # FLD1

1 250

2 300

3 100

4 125

5 190

and the following were executed:

UPDTA FLD1[2] ADD VAL 10 TIMES 3

the following would result:

Element # FLD1

1 250

2 310

3 110

4 135

5 190

SUB - Subtract a value from an array of values. For example, if the following were true:

Element # FLD1

1 250

2 300

3 100

4 125

5 190

and the following were executed:

UPDTA FLD1[2] SUB VAL 10 TIMES 3

the following would result:

Element # FLD1

1 250

2 290

3 90

4 115

5 190

INS - Insert a number of lines with value being the number. For example, assume the following:

Element # FLD1 FLD2 FLD3

1 ABC 250 9/23/90

2 NCC 300 12/10/90

3 QHI 100 10/11/90

4 0 0/ 0/ 0

5 0 0/ 0/ 0

If the following is executed:

UPDTA fld1[2],fld2[2],fld3[2] INS VAL 2

the result would be:

Element # FLD1 FLD2 FLD3

1 ABC 250 9/23/90

2 0 0/ 0/ 0

3 0 0/ 0/ 0

4 NCC 300 12/10/90

5 QHI 100 10/11/90

DEL - Delete a number of lines with value being the number. For example, assume the following:

Element # FLD1 FLD2 FLD3

1 ABC 250 9/23/90

2 NCC 300 12/10/90

3 QHI 100 10/11/90

4 0 0/ 0/ 0

5 0 0/ 0/ 0

If the following is executed:

UPDTA fld1[2],fld2[2],fld3[2] DEL VAL 1

the result would be:

Element # FLD1 FLD2 FLD3

1 ABC 250 9/23/90

2 QHI 100 10/11/90

3 0 0/ 0/ 0

4 0 0/ 0/ 0

5 0 0/ 0/ 0

CLR - Clear the array element values. For example, assume the following is true:

Element # FLD1 FLD2 FLD3

1 ABC 250 9/23/90

2 NCC 300 12/10/90

3 QHI 100 10/11/90

4 RST 75 8/22/90

5 UVW 350 6/15/89

If the following is executed:

UPDTA FLD1[2],FLD2[2],FLD3[2] CLR TIMES 3

the following will result:

Element # FLD1 FLD2 FLD3

1 ABC 250 9/23/90

2 0 0/ 0/ 0

3 0 0/ 0/ 0

4 0 0/ 0/ 0

5 UVW 350 6/15/89


Update Report Data

Navigation: Reference > Commands >

Update Report Data

 Print this Topic Return to chapter overview

This command is used to update data in a buffer previously written to with the Output Report Data command. This is commonly used to update data in headers and footers, probably especially footers. Why is it needed? Because until the data is read (and likely printed in the details section(s), summary data is not available.

UPDATE_REPORT_DATA

RB_NUM f/c/e Required - The Report Buffer Number. This is the same number you used for creating the buffer in the Setup Report Buffer command.

FLDLST f/c/e1,f/c/e2..f/c/ex Required - The list of fields that will be updated in the buffer. This command is different from Output Report Data in that it puts the name of the field first and the value second for each field you want to update. For example, using the same sample we used in Output Report Data let's say we want to update the customer name and the customer code for some reason. In this case you might do the following:

update_report_data rb_num 1 fldlst 'bkar.custname','bkar.custcode'

The program will check in report buffer 1 for the field name 'bkar.custname' (this must match the name you used in the report format in the DataField property). If the field exists in the buffer it will then take the current value for the field in your program (file or defined field) and save that in the appropriate location in the buffer for the current report buffer 'record.'

NOTE : The field names in the fldlst must be surrounded in quote marks. If you omit the quotes, you will receive no error message either while compiling or at runtime, and the report data will not be updated.

COMMENTS

This command cannot be used until you create a buffer with the Setup Report Buffer command and you've saved at least one record to that buffer with the Output Report Data command. This command will only work on the last buffer record saved. Once you execute the Output Report Data command that effectively hides any previous records saved and they can no longer be updated.

SAMPLE

update_report_data rb_num 1 fldlst 'bkar.custname','bkar.custcode'

SEE ALSO

PRINT_REPORT


User Defined Command

Navigation: Reference > Commands >

User Defined Command

 Print this Topic Return to chapter overview

This will define the beginning of (or entry to) a User Defined Command (UDC).

CMD sac Required - This is a special alpha constant. It is the name you give to this command. It may be up to 32 characters long. It must not be the same as any line label used anywhere else in the program.

udc_parameters fn/v1,fn/v2,...,fn/vx The values being passed to the UDC. A maximum of 20 fields may be specified. The field names are separated with commas.

COMMENTS

This command allows you to create your own commands within TAS. It is similar to using a GOSUB, however, you can pass values at the same time. The UDC does not allow you to return a value. For that, you should refer to the UDF (User Defined Function).

NOTE: You must include the compiler directive #UDX before the first user defined command is referenced in the program. This alerts the compiler that there are UDCs (or UDFs) in your code and, when it runs into a command it doesn't recognize, it adds it to the label list rather than generating an error message.

NOTE: In the command line itself (that calls the UDC) you may use fields, constants and expressions.

NOTE: Make sure you don't use the UDC in the program as you would a function. For example, don't make the example, SmallCmd, listed below, look like this:

SmallCmd('A',99,x+1)

If you do you will get an error that a label was used but not found in your program.

SEE ALSO

FUNC

EXAMPLE

SmallCmd 'A', 99, x+1

//more code here

ret

cmd SmallCmd sc1, sc2, sc3

#proc

Define sc1 type a size 1 local

Define sc2 type i size 2 local

Define sc3 type i size 4 local

//Do what ever you want here.

#endproc

ret


User Defined Function

Navigation: Reference > Commands >

User Defined Function

 Print this Topic Return to chapter overview

This is the command that defines a User Defined Function, or UDF. A UDF may be used in any situation that would allow a regular (standard) function. Some options in some commands require that a UDF be used.

FUNC sac Required - This is the name you give to this function. It is a special alpha constant. It may be up to 32 characters long. It must not be the same as any line label used anywhere else in the program.

function_parameters - fn/v1,fn/v2,...,fn/vx The values, if any, being passed to the UDF. A maximum of 20 fields may be specified. The field names are separated with commas.

COMMENTS

You must include the compiler directive #UDX before the first user defined function is referenced in the program. All functions end with the command RET (Return). You may return a single value of any type, including an expression. Fields within the UDF are not automatically local unless you use the #PROC/#ENDPROC compiler directives and DEFINE the fields as local. Through this process the UDF may be made reentrant.

Any legal TAS Professional command, EXCEPT CHAIN, may be used in conjunction with a UDF.

NOTE: You must not execute a CHAIN command from within a UDF. If you do, the program will not return to the proper location, and you will probably get an AV (Access Violation).

EXAMPLE

//test UDF

#udx

#ForceRWN

define x type n

START:

x = user_func(1,3,'A')

msg 'X: '+x

quit

ret

define y,z,a type n

define do type a size 1

func user_func y,z,do

if do = 'A'

a = y+z

else_if do = 'S'

a = y-z

else_if do = 'M'

a = y*z

else_if do = 'D'

a = y/z

endif

ret a

The above is a complete program. The result, once compiled and run, would be:


WAIT

Navigation: Reference > Commands >

WAIT

 Print this Topic Return to chapter overview

WAIT

PURPOSE

This command provides a simple way to suspend program execution for a given number of milliseconds.

WAIT f/c/e Required - The number of milliseconds that should be paused.

COMMENTS

A simple way to suspend program execution without having to using more lines of code than necessary.

EXAMPLE

define seconds_n Type I size 3

start:

  seconds_n = 4000 // will wait 4000 milliseconds.

  Wait seconds_n

ret


While

Navigation: Reference > Commands >

While

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will control whether a command, or group of commands will be executed. This is one part of a complete command structure.

WHILE lexpr Required - If the expression resolves to .TRUE., the command lines between the WHILE command and the next LOOP_IF, EXIT, EXIT_IF or ENDW (Endwhile) command will be executed.

COMMENTS

For more information on the different structured programming commands, and the WHILE command in particular, please see Structured Programming Commands.

SEE ALSO

EXIT, EXIT_IF, LOOP, LOOP_IF, ENDW

Sample

// FYI problem to change this if you try to change using a scan the program will only change one record.

// reason for this is that the key position some how changes when saved and your at the end of your while.

// Below is a while loop using a findv. If you try to scan and it will not work try this example.

while .t.

findv m fnum custsale_hndl key cust_sale_code value old_cust

if flerr(custsale_hndl) <> 0 .o. cust_sale_code <> old_cust then exit

'@progressbar1.position' = REC_PERCENTAGE(custsale_hndl)

CUST_SALE_CODE = new_cust

save @custsale_hndl nocnf

endw

close @custsale_hndl


While End

Navigation: Reference > Commands >

While End

 Print this Topic Return to chapter overview

This is the end point of the process control structure WHILE/ENDW.

ENDW No options / No Modifiers

COMMENTS

For more information on the different structured programming commands, and the ENDW command in particular, please see Structured Programming Commands.

SEE ALSO

WHILE, LOOP, LOOP_IF, EXIT, EXIT_IF


While Exit

Navigation: Reference > Commands >

While Exit

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will exit from a WHILE loop. This is one part of a complete command structure.

EXIT No options / No Modifiers

COMMENTS

For more information on the different structured programming commands, and the EXIT command in particular, please see Structured Programming Commands.

SEE ALSO

WHILE, LOOP, LOOP_IF, EXIT_IF, ENDW


While Exit If

Navigation: Reference > Commands >

While Exit If

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will control whether to exit from a WHILE loop. This is one part of a complete command structure.

EXIT_IF lexpr Required - If the expression resolves to .TRUE. then the program will transfer control to the line following the appropriate ENDW (Endwhile) command.

COMMENTS

For more information on the different structured programming commands, and the EXIT_IF command in particular, please see Structured Programming Commands.

SEE ALSO

WHILE, LOOP, LOOP_IF, EXIT, ENDW


While Loop

Navigation: Reference > Commands >

While Loop

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will loop back to the beginning in a WHILE/ENDW loop. This is one part of a complete command structure.

LOOP No options / No Modifiers

COMMENTS

For more information on the different structured programming commands, and the LOOP command in particular, please see Structured Programming Commands.

SEE ALSO

WHILE, LOOP_IF, EXIT, EXIT_IF, ENDW


While Loop If

Navigation: Reference > Commands >

While Loop If

 Print this Topic Return to chapter overview

This is a process control command, i.e., it will control whether to loop back to the beginning in a WHILE/ENDW loop. This is one part of a complete command structure.

LOOP_IF lexpr Required - If the expression resolves to .TRUE. then the program will transfer control to the appropriate WHILE line. This would be the equivalent of executing the ENDW command.

COMMENTS

For more information on the different structured programming commands, and the LOOP_IF command in particular, please see Structured Programming Commands.

SEE ALSO

WHILE, LOOP, EXIT, EXIT_IF, ENDW


Write Records From An Array

Navigation: Reference > Commands >

Write Records From An Array

 Print this Topic Return to chapter overview

This command is used for writing to a group of records from array fields in memory. Within this single command you can accomplish many tasks that would normally take many more lines of code and more time to execute.

WRTA f/c/e1, f/c/e2,..., f/c/ex Required - The fields in the array whose values are to be saved. You may also create expressions that can be transferred to the receiving (TO) fields. The first from field is paired to the first TO field, the second to the second, etc. There must be the same number of from fields as TO fields.

TO fn/v1, fn/v1,..., fn/vx Required - These are the recipient fields in the record to be saved. They must be of the same type as the respective from fields. The first from field is paired with the first TO field, the second to the second, etc. There must be the same number of TO fields as from fields.

RECA fn/v If you want to update current records then you must provide an array of record numbers so this command can read the appropriate record before updating the fields and saving it back. The record number can be obtained through the use of the RCN() function.

NOTE: If you read these records using the RDA (Array Read) command you may make one of the from fields the function RCN() and the corresponding TO field an R type array field to hold the record number.

MAXA f/c/e Required - The number of array elements (or records) to be written.

CNTR fn/v This value is updated by the program during operation so that you may use expressions in the from field list. Use this field as the array specifier where appropriate. Must be of type I.

FILE fn/v The handle/number of the file to be used. If you do not include this option, the program will look for a default search file set in the SRCH (Search File) command. If a default file hasn't been previously set, the program will report an error and the command will be skipped. This entry will override any default value set in the SRCH command.

FOR lexpr You would use this option to restrict the records written in this command. If the expression did not resolve to .TRUE., the record would not be written and the program would continue to the next array element. The process continues until all array elements (number_of_elements) have been checked and written if appropriate.

DISP If you include this option, each time a record is ready to be written the program will redisplay the screen fields as appropriate. This will slow down the operation of this command, with the amount of slow-down depending on how many fields are displayed on the screen.

SEE ALSO

RDA


Write To A Non-TAS File

Navigation: Reference > Commands >

Write To A Non-TAS File

 Print this Topic Return to chapter overview

This command will cause the program to write a specific number of characters to a non-TAS file at a certain location.

WRITE f/c/e Required - The file handle/number value. This is the same value as that received in the OPENV (Open File) command. The file must have been previously opened.

START f/c/e The first byte position to write to. The first character position in the file, for this command, is 1. If no start value is given or the value is 0 the program will use the current internal file position value. (When the file is opened the position value is automatically set to 1.) This must be an R type field.

NCHR f/c/e The number of characters to write. If this is not supplied the program will use the size value stated in the OPENV (Open File) command.

FROM fn/v Normally the characters read would be written from the buffer specified in the OPENV (Open File) command. However, you may use this option to specify a different buffer field to be used during the execution of this command.

COMMENTS

After execution, the internal file position value will be set to the first character immediately following the characters written. For example, if the start value is set at 10 and the number of characters to be written is 10, the position after the WRITE command will be 20.

NOTE: If you are saving sequential records to a non-TAS file use the SAVE command instead.

SEE ALSO

OPENV, READ


WTree

Navigation: Reference > Commands >

WTREE

 Print this Topic Return to chapter overview

This command activates a TTASTreeView object on the form. It is appropriate when you are using the TTASTreeView for an in-memory array instead of an actual file.

WTREE f/c/e

Required - The name of the TTASTreeView object on the form

SETUP

This option would be used when you are first specifying the counter field, number of elements, etc. Otherwise, you can use one of the display options below and you can reset any of the options originally set here. When this is called the first time certain setup routines are called in the tree view and need not be called again.

CLOSE

Use this option to remove all the rows from the tree and disconnect the tree from the arrays. This would only be used if you are going to change the columns from one WTREE command to another.

COUNTER_FLD fn/v This is the field that will be used both internally (in the tree itself) and externally (in your program) to determine which array row is being accessed. Each time the tree returns control to your program this field will have the current array row as its value. If this is during the SETUP process then this is Required option.

FILE This will load a Text file from disk to load the TreeView. (used in Setup)

NAME This works like the Counter_fld. But give you the Text of the Selected Text..(Used Setup)

Insert Insert a TasTreeNodeTemplate Object into the TreeView

Object Used for giving the name of the TASTreeNodeTemplate

Display

REDISPLAY - Redisplay starting with the first visible row on the tree and continuing from there.

REDISPLAYFROMTOP - Redisplay starting with the first element in the array.

REDISPLAYFROMEND - Redisplay starting with the last element in the array.

UPDATECURRENT - Refresh all the columns in the active row.

REDISPLAYCURRENT - This assumes that you've changed multiple values in the array. It will move the current selected row to the top of the visible tree and will display all the elements that come after it.

NOTE: If there are not enough rows to fill the tree and there are rows above what would normally be the top, those rows will be displayed and the nominal top will be moved down. The row cursor will be moved down also.

REDISPLAYACTIVE - This would be used if you have set the counter value and want to redisplay the tree based on that value. It will be placed at the top of the visible tree and all rows that follow it will be displayed.

NOTE: If there are not enough rows to fill the tree and there are rows above what would normally be the top, those rows will be displayed and the nominal top will be moved down. The row cursor will be moved down also.

COMMENTS

EXAMPLE

See Also TTASTreeView


General Information

Navigation: Reference > Functions >

General Information: Functions

 Print this Topic Return to chapter overview

The following format is used in documenting the TAS Professional Functions.

The functions are listed in alphabetical order.

The function NAME and STRUCTURE is the first part of each definition. For example:

ALC_FLD(1,2)

ALC_FLD is the name of the function, in this case it stands for AllocateField

1 & 2 are the two options and make up the structure of the function. They will be defined in the PARTS section.

NOTE: If there are no options there will be no numbers between the parentheses.

The PURPOSE of each function is a brief definition of what it does. This provides a quick insight into the function, and why the programmer might use it.

The PARTS of each function are listed by number.

Each function part is described, along with its purpose, valid values, default value (if applicable), consequences, and whether or not the part is required.

NOTE: If the part is not required and you don't want to include it all you have to do is leave it out. If you need to save the place for a further option then include the comma. For example:

FUNC1 has parts 1,2,3 & 4

parts 1 & 2 are required, 3 & 4 are optional

If you don't need 3 and 4 you may use:

FUNC1(xxx,yyy)

If you need 4 but not 3 you may use:

FUNC1(xxx,yyy,,zzz)

Notice the extra comma to save the

place of part 3.

The programmer entry portion can consist of the following:

f/c/e

Field/Constant/Expression. You can use any type of field or constant. This can consist of alpha or numeric constants as well as any type of field or variable field. You can also use an expression that results in the proper type of field.

fn/v

Field name/Variable field. In certain functions you must use the actual field name or a variable field.

file_num

In commands you are told to put an ampersand (@) before a field name that contains the file number/handle. In functions this is NOT necessary. In all functions that require a file number/handle you will see the option referred to as a f/c/e. You would still use the same field name as in a file_num option, just don't preface the field with the @.

key_expr

You may define the key number to be used in a command in several ways:

number - The actual number of the key, as defined in the data dictionary, may be used preceded by an ampersand (@). @3 refers to the third key in the appropriate file (the first key is 1).

key name - The name of the key as assigned in the data dictionary may be used. dict_overlay is an example of a key name.

no key - If you do not want to use a key but want to access the file through the direct method then use the no key symbol, the number 0 preceded by an ampersand ('@'). @0 tells the program to use the direct access method when searching this file. This is the default method when you have opened a non-TAS file.

lexpr

An expression that will resolve to a logical value of .TRUE. or .FALSE. For example:

fld1 = 100

another example:

(fld1 = 100 .a. fld2='ABC') .o. fld3=.FALSE.

The RETURN TYPE and what is being returned is given.

Special COMMENTS or restrictions are given where applicable.

EXAMPLES may be included that will show you the function as part of a piece of code.

Functions may be nested up to 10 deep:

F1(F2(F3(F4(F5(F6(F7(F8(F9(F10())))))))))

Fx in this example represents a TAS Professional function name. A Function may be used in any expression.

SEE ALSO will list the commands/functions that are related to the function being explained.

NOTE: There are many functions in TAS Professional 5.1 and previous that have no usage in TAS Professional programs. In those cases we have removed those functions from this manual to eliminate confusion. Most of those functions are still available in this version to facilitate running 5.1 programs. The TAS Professional 5.1 manual is available in PDF format if you wish to go back and investigate those options.


AbsoluteValue()

Navigation: Reference > Functions >

AbsoluteValue()

 Print this Topic Return to chapter overview

ABS(1)

PURPOSE

This function returns the absolute value of the N type field specified.

PARTS

1 f/c/e Required - This must be an N type value.

RETURN TYPE - N

EXAMPLE

x = abs(-535.25)

// x = 535.25


About()

Navigation: Reference > Functions >

About()

 Print this Topic Return to chapter overview

ABOUT()

PURPOSE

This function when exicuted will display the TAS Professional Runtime About dialog.

RETURN TYPE - L

EXAMPLE

define abouttas type L

abouttas:

Abouttas = about()

ret


AllocateArray()

Navigation: Reference > Functions >

AllocateArray()

 Print this Topic Return to chapter overview

ALOCARY(1,2)

PURPOSE

You can use this function to allocate an array for a previously defined field.

PARTS

1 fn/v Required - The field to allocate array elements for.

2 f/c/e Required - The number of elements to allocate. If there isn't enough available memory for the number of elements desired the program will allocate as many as possible. The maximum number of array elements for any single field is 4,294,967,295.

RETURN TYPE - R

The actual number of elements allocated.

COMMENTS

The field (part 1) used in this command cannot be a part of a standard TAS Professional file. It must have been created using the DEFINE command.

Once this function has been used to allocate the array the data space originally used by the field is lost to use. Due to this you should define the field with no elements initially. This keeps the amount of wasted space to a minimum.

define X type A size 1

define X_Elem type r

X_Size = ALOCARY(X, 100)

// if the memory is available X_Elem would now contain 100 and the

// The array elements of X would be 100

SEE ALSO

ALLOC, REMVA


AllocateField()

Navigation: Reference > Functions >

AllocateField()

 Print this Topic Return to chapter overview

ALC_FLD(1,2)

PURPOSE

You can use this function to allocate a single previously defined field. Generally this would be used if you don't know how large the field should be before the program is run.

PARTS

1 fn/v Required - The field to allocate. This must be a type A field.

2 f/c/e Required - The new desired size. Maximum size possible is 4gb. If the amount of available memory is less than the size given the program will be allocated as much as possible.

RETURN TYPE - R

The actual size allocated.

COMMENTS

The field (part 1) used in this command cannot be a part of a standard TAS Professional file. It must have been created using the DEFINE command.

Once this function has been used to allocate the field the data space originally used by the field is lost to use. Due to this you should define the field with a size of 1 initially. This keeps the amount of wasted space to a minimum.

EXAMPLE

define X type A size 1

define X_Size type r

X_Size = ALC_FLD(X, 5000)

// if the memory is available X_Size would now contain 5000 and the

// size of X would also be 5000


ArcCosine()

Navigation: Reference > Functions >

ArcCosine()

 Print this Topic Return to chapter overview

ACOS(1)

PURPOSE

This function returns the arccosine of the N type field specified.

PARTS

1 f/c/e Required - The N value.

RETURN TYPE - N

The result will be from 0 to PI in radians.

COMMENTS

The value specified must be between -1 and 1.

EXAMPLE

x = acos(-0.539)

// x = 2.14004577


ArcSine()

Navigation: Reference > Functions >

ArcSine()

 Print this Topic Return to chapter overview

ASIN(1)

PURPOSE

This function returns the arcsine of the N type field specified.

PARTS

1 f/c/e Required - The N value.

RETURN TYPE - N

The result will be from -PI/2 to PI/2 in radians.

COMMENTS

The value specified must be between -1 and 1.

EXAMPLE

x = asin(-0.539)

// x = -0.56924944


ArcTangent()

Navigation: Reference > Functions >

ArcTangent()

 Print this Topic Return to chapter overview

ATAN(1)

PURPOSE

This function returns the arctangent of the N type field specified.

PARTS

1 f/c/e Required - The N value.

RETURN TYPE - N

The result will be from -PI/2 to PI/2 in radians.

EXAMPLE

x = atan(-0.539)

// x = -0.49435871


ArrayElementValue()

Navigation: Reference > Functions >

ArrayElementValue()

 Print this Topic Return to chapter overview

AEV(1,2)

PURPOSE

This function will return an element value from an array field.

PARTS

1 fn/v Required - The array field itself. You may use a P type field to point to the array field.

2 f/c/e Required - The element number.

RETURN TYPE - Variable

The function will return the same type of field as the array field (part 1).

Define array_field type a size 10 array 10

define array_value type a size 10

array_value = AEV(array_field,3)

// this would return the value in Element # 3


ArrayLocation()

Navigation: Reference > Functions >

ArrayLocation()

 Print this Topic Return to chapter overview

ALOC(1,2,3)

PURPOSE

You can use this function to find an array element number based on a value you specify.

PARTS

1 f/c/e Required - The field value to search for.

2 fn/v Required - The array field to search.

3 f/c/e The array element value to start with. If none is provided the program will start with the first.

RETURN TYPE - R

The element number if found.

COMMENTS

If there is a match for the search field value the program will return the array element number. If no match is found the return value will be 0.

NOTE: Do not specify an array element in the array field to search for (part 2). If you wish to start with an element other than 1 specify that value in part 3.

NOTE: Parameter 1, Field Value to search for can not be a Codebase field. You must place the Codebase field value in some defined holder field to work with codebase type databases.

EXAMPLE

define x type a size 5 array 5

x[1] = 'abc'

x[2] = 'def'

x[3] = 'ghi'

x[4] = 'jkl'

x[5] = 'mno'

define r type r

r = ALOC('jkl', X, 0)

// r = 4

r = ALOC('abc', X, 3)

// r = 0


ASCIIValue()

Navigation: Reference > Functions >

ASCIIValue()

 Print this Topic Return to chapter overview

ASC(1)

PURPOSE

This function will return the ASCII value of the first character of a field.

PARTS

1 f/c/e Required - The field to be used. The function will use only the first character of the field which must be of A type.

RETURN TYPE - I

The ASCII value.

COMMENTS

This doesn't work with double-byte characters.

SEE ALSO

CHR()

EXAMPLE

x = ASC('A')

// x = 65


ASCIIToChar()

Navigation: Reference > Functions >

ASCIIToChar()

 Print this Topic Return to chapter overview

CHR(1)

PURPOSE

This program will return the ASCII character based on the value given.

PARTS

1 f/c/e Required - The value to use. The legal values range from 0 through 255.

RETURN TYPE - A

The function returns a single character.

SEE ALSO

ASC()

EXAMPLE

define x type a size 1

x = CHR(65)

// x = 'A'


AskResponse()

Navigation: Reference > Functions >

AskResponse()

 Print this Topic Return to chapter overview

ASK()

PURPOSE

This function returns the logical value of what the user entered for the last ASK command entry.

NO OTHER PARTS

RETURN TYPE - L

If the user answered the last ASK command question yes this function will return .TRUE.; otherwise it will return .FALSE.

See also ASK

EXAMPLE

ask 'What is the Answer ?'

if ask()

msg 'They Clicked Yes!!!'

else

msg 'They Clicked No ??'

endif


AvailableDiskSpace()

Navigation: Reference > Functions >

AvailableDiskSpace()

 Print this Topic Return to chapter overview

DSPCE()

PURPOSE

This function returns the available disk space on the default drive.

NO OTHER PARTS

RETURN TYPE - N

COMMENTS

Make sure the receiving field is defined as a type N and that the display size is at least 12 with 0 decimal characters.

EXAMPLE

Define disk_size type n size 12 dec 0

buton.click:

disk_size = DSPCE()

msg 'The disc size is ' + disk_size

ret


AvailableFieldMemory()

Navigation: Reference > Functions >

AvailableFieldMemory()

 Print this Topic Return to chapter overview

AVAIL(1)

PURPOSE

This function returns the approximate number of elements that could be allocated given a field or group of fields.

PARTS

1 f/c/e Required - The total internal size for the field or fields to be allocated.

RETURN TYPE - R

The maximum number of elements that could be allocated for the total size given.

COMMENTS

Basically your asking how many fields of the size stated in part 1 could be allocated from the memory available. Due to virtual memory it will probably always be near or at the 4,294,967,295 limit of an R type field. Depends more on the size and available room on your hard drive than on real memory.


BeginningOfFile()

Navigation: Reference > Functions >

BeginningOfFile()

 Print this Topic Return to chapter overview

BOF(1)

PURPOSE

This function will determine whether or not the program has tried to read a record that is previous to the beginning of the file.

PARTS

1 f/c/e Required - The number/handle of the file to be checked.

RETURN TYPE - L

If the file is at BOF the function will return .T.; otherwise it will return .F.

COMMENTS

When a file is first opened this function would return .FALSE. However, if you tried to find a record using the P (previous) option when you first opened that file, and then checked this function it would return .TRUE.

SEE ALSO

EOF()


CallProgram()

Navigation: Reference > Functions >

CallProgram()

 Print this Topic Return to chapter overview

CALL_PRG(1,2)

PURPOSE

This function will execute a routine in a program previously loaded with the LOAD_PRG() function.

PARTS

1 f/c/e Required - The program number returned in the LOAD_PRG() function.

2 f/c/e Required - The name of the routine you want to run.

RETURN TYPE - L

If the program is found and the routine exists the function will return .T., if not, it will return .F.

COMMENTS

This is the way you will call routines in TLLs that have been loaded with the LOAD_PRG() function. The name of the routine is the label you have placed at the beginning of the routine. See the EXAMPLE below.

EXAMPLE

(* This assumes you have loaded this program that

contains this routine. Obviously your TLLs would

be different, this is only for an example. It also

assumes that you have stored the program

number in the field PrgNum, a type R field. *)

// A simple TLL routine:

ShowMessage:

msg 'We are in the ShowMessage routine.'

ret

(* The following would be in a different program *)

define x type l

x = CALL_PRG(PrgNum, 'ShowMessage')

// If you had the correct value in PrgNum

// x would be .T.

SEE ALSO

REMOVE_PRG(), IS_PRG_LOADED(), TLLFC()


Ceiling()

Navigation: Reference > Functions >

Ceiling()

 Print this Topic Return to chapter overview

CEIL(1)

PURPOSE

This function returns a whole number that is the closest value equal to or greater than the field value specified.

PARTS

1 f/c/e Required - Must be N type field.

RETURN TYPE - N

SEE ALSO

FLOOR()

EXAMPLE

x = ceil(-2.935)

// x now contains the value: -2.000

// Don't forget, -2 is > -2.935

x = ceil(2.935)

// x = 3.000


ChangeSkin()

Navigation: Reference > Functions >

ChangeSkin()

 Print this Topic Return to chapter overview

Change_Skin()

PURPOSE

Skins are a way to quickly change the entire look of your program by providing a new graphical representation of your screen objects.

Use this function to change the skins on your program.

PARTS

1 f/c/e Required - This is the name of the skin you want to change to.

RETURN TYPE - L

If the skin file is found the program will change skin and the function will return .T., if not, it will return .F.

COMMENTS

If you use this function and you are running an application with more then one program this command will apply this skin to all of your programs that are using that runtime.

Note: Skins and XP Theme are two deferent concepts with skins you would only change your programs look. with XPtheme you would change the entire look of your computer operating system. Skins is independent of the OP system and will take over the look of your program no matter what theme your using.

Note: If you set the TAG value in any object on your screen this will turn off skining for this one obkect or any object that has a tag value of 99.

See Also: Skins

EXAMPLE

Let's say you wanted to change skin in your programs when a user clicks on button.

your screen before change_skin()

Normal XP Screen

button1.click:

define skin type L

skin = Change_skin('C:\TAS7\skins\mxskin28.skn')

ret

//or to return to normal windows or XPtheme.

button2.click:

skin = Change_skin('')

// you must pass this function at least a null string or the function will do nothing.

ret

your screen and programs after the user click the button1.click.

Very cool!!!


CharDayOfWeek()

Navigation: Reference > Functions >

CharDayOfWeek()

 Print this Topic Return to chapter overview

CDOW(1)

PURPOSE

The function returns the character day of week value (e.g., Monday, Tuesday, etc.) for a particular date.

PARTS

1 f/c/e The date value to use, must be of D type. If you do not specify a value here the function will use the current date.

RETURN TYPE - A

The function will return the name of the day. If the receiving field is too small to hold the entire name only the portion that will fit will be returned.

COMMENTS

The day names come from the standard Windows values setup for your location.

SEE ALSO

CMNTH()

EXAMPLE

define x type a size 15

define d type d

d = ctod('09/30/00')

x = CDOW(d)

// x = 'Saturday'


CharMonth()

Navigation: Reference > Functions >

CharMonth()

 Print this Topic Return to chapter overview

CMNTH(1)

PURPOSE

This function returns the character month of the year value (e.g., January, February, etc.) for a particular date.

PARTS

1 f/c/e The date value to use, must be of D type. If you do not specify a value here the function will use the current date.

RETURN TYPE - A

The function will return the name of the month. If the receiving field is too small to hold the entire name only the portion that will fit will be returned.

SEE ALSO

CDOW()

EXAMPLE

define x type a size 15

define d type d

d = ctod('09/30/00')

x = CMNTH(d)

// x = 'September'


Wait_Check()

Navigation: Reference > Functions >

Wait_Check()

 Print this Topic Return to chapter overview

The Wait_Check() function will return a value of 0 if there are not any external processes in operation.

Use this function to check to see if you have used the EXEC command with the wait option. for detailed examples see EXEC command.

Note: if you use the wait option in the EXEC command and do not protect your screen events with a Wait_Check(). If the program exits you will get a AV and you may lockup the computer you working with because you told the computer to wait. So when you leave the program the computer will try to continue processing the next line of code and since you exited the program there will be no pointer in memory to return to.

EXAMPLE

// EXAMPLE for wait and Wait_Check()

// If the user was to click the exit button before you were done and you do not protect your programming

// like this you will get an error because the program would be gone.

BUTTON1.CLICK:

EXEC 'WORDPAD' with 'TEST.SRC' WAIT

BUTTON.CLICK:

if Wait_Check() > 0

msg 'you have not finished your editing yet you can not exit from this program.'

ret .f.

endif

quit

ret .t.

// END EXAMPLE

//Here is how you can get it to wait

testexec.Click:
exec '.\sample\testbatch.bat' wait
loopit:

if wait_check() <> 0
goto loopit // Program will loop until batch file is done.
endif
msg 'done'
Ret


ChooseColor()

Navigation: Reference > Functions >

ChooseColor()

 Print this Topic Return to chapter overview

CHOOSE_COLOR()

PURPOSE

This function displays a standard Windows color dialog box.

NO OTHER PARTS

RETURN TYPE - R

Returns the color value.

COMMENTS

This will not change your current colors on your monitor.

EXAMPLE

define x type r

x = CHOOSE_COLOR()


clr_temp_memory()

Navigation: Reference > Functions >

clr_temp_memory()

 Print this Topic Return to chapter overview

CLR_TEMP_MEMORY (1)

PURPOSE

This function returns the temporary memory back to 0. ( This should not be needed in "Normal" situation)

PARTS

1 f/c/e

Options – (Useful for Debugging).

"Status" = Give you the number to Temp Fields used. (Actual Count now)

"Avail" = Give you the Remain Temporary (As given by the system)

"Used" = Give you the Amount of temporary USED (As given by the system)

NOTE: Using any of these options will not clear the temporary memory

RETURN TYPE - I

EXAMPLE

    I = Clr_temp_memory()   //This returns temporary memory back to 0

     I = Clr_temp_memory('STATUS')   //This returns the number of temporary fields. This will not reset only return the status.

NOTE: Normally in a TAS Professional program this is not needed however we have found that programs that are used for long periods of time and do lots of calculations could run out of temporary memory. By using this function you should be able to reset your temp memory if needed.


CompanyCode()

Navigation: Reference > Functions >

CompanyCode()

 Print this Topic Return to chapter overview

CO()

PURPOSE

This function returns the character company code file extension modifier.

NO OTHER PARTS

RETURN TYPE - A

COMMENTS

This function only returns the last two characters of the company code and does not include the leading 'B'.

NOTE: In FILELOC.B all files have extensions of B+the company code. You can specify the two characters that make up the company code with this command. You can also set the beginning company in the Set Configuration program. If you are using the Pervasive file manager (Btrieve) then the files will actually have the extension of B+company code. If you are using CodeBase the files have set extensions (DBF, DBT & MDX) but we use the B+company code in FILELOC.B to keep track of the different companies.

SEE ALSO

CO


CompareStrings()

Navigation: Reference > Functions >

CompareStrings()

 Print this Topic Return to chapter overview

DIFF(1,2)

PURPOSE

Using a process similar to the SNDX() function, this function will return a value that can be used to determine how close the two values sound.

PARTS

1 f/c/e Required - Comparison value 1. Must be type A.

2 f/c/e Required - Comparison value 2. Must be type A.

RETURN TYPE - I

The return value is from 0 through 4. 0 is no match at all; 4 is a very close match.

EXAMPLE

define x type i

x = DIFF('translate','trnslt')

// x = 4

x = DIFF('John','Paul')

// x = 0


CompileExpression()

Navigation: Reference > Functions >

CompileExpression()

 Print this Topic Return to chapter overview

COMPILE_EXPR(1)

PURPOSE

This function will compile an expression that can be used anywhere in your program just as though it had been part of the original program.

PARTS

1 f/c/e Required - The expression to compile. This must be an A type (alpha) field. The expression can evaluate to any result.

RETURN TYPE - F

The process returns an F type pointer field.

SEE ALSO

Indirect Field References, COMPILE_SRC()

EXAMPLE

define Filter type f

UserExpr='mid(njob.number,1,2) = "'+testid+'"'

Filter = compile_expr(UserExpr)

scan @file_hndl key @key_num for &filter

...

ends

sample of expression

filter='mid(njob.number,1,2) = "'+testid+'"'

Notice we have to make the expression alpha this was used as a for expression.


CompileSource()

Navigation: Reference > Functions >

CompileSource()

 Print this Topic Return to chapter overview

COMPILE_SRC(1,2,3)

PURPOSE

This function compile multiple lines and add the compiled code to that already loaded when the program was run.

PARTS

1 f/c/e Required - What to do:

compInt - The lines to be compiled are passed as a single alpha (string) field.

compFile - The lines to be compiled are contained within a file.

2 f/c/e Required - This depends on what you specified for part 1:

compInt - This is a single string that contains all the lines to be compiled. Each line is separated by a cr/lf character pair. This is exactly the way the output is received from the STRINGS() function when you use the stGetText option.

compFile - This is the name of the file to be compiled. This must include a full path if it's not in the same subdirectory as the original program.

3 f/c/e If you have specified compInt in part 1, this is a name to be associated with the lines that are compiled. Similar to a file name. It has no effect other than to use the name during runtime in the TRACE command or if an error occurs and you have the Debug flag set in the compiler.

RETURN TYPE - L

Returns True if the lines were compiled correctly, False if not.

COMMENTS

This function will compile the lines and put them into the buffers for the current program. The resulting code can be called just as though it were part of the original program. If you refer to line labels that are not part of the code compiled, it will search through the existing program to see if they already exist. The same applies to field names.

NOTE: Any label referred to in the new code will override any existing label of the same name. This means you can change what happens during an event call, or a standard GOSUB by reusing the same label name but executing a completely different set of lines, those compiled through this command. You can still execute the previous lines also through the use of the INHERITED command.


ConvertDFMtoTXT()

Navigation: Reference > Functions >

ConvertDFMtoTXT()

 Print this Topic Return to chapter overview

DFM_TO_TXT(1,2)

PURPOSE

This function will convert a standard form file (DFM) to a text file that can be manipulated with a text editor.

PARTS

1 f/c/e Required - The form file name, must include full path. The extension is automatically set to .DFM.

2 f/c/e Required - The text file name, must include full path and extension. If no extension is specified it is set to .TXT.

RETURN TYPE - L

If the conversion operation is successful the function will return .T., if not, .F..

COMMENTS

You can convert from text to DFM by using the TXT_TO_DFM() function.


ConvertTXTtoDFM()

Navigation: Reference > Functions >

ConvertTXTtoDFM()

 Print this Topic Return to chapter overview

TXT_TO_DFM(1,2)

PURPOSE

This function will convert a text file in the appropriate form, to a standard form file (DFM).

PARTS

1 f/c/e Required - The text file name, must include full path and extension. If no extension is specified it is set to .TXT.

2 f/c/e Required - The form file name, must include full path. The extension is automatically set to .DFM.

RETURN TYPE - L

If the conversion operation is successful the function will return .T., if not, .F..

COMMENTS

You can convert from DFM to text by using the DFM_TO_TXT() function.


ConvertToByte()

Navigation: Reference > Functions >

ConvertToByte()

 Print this Topic Return to chapter overview

CBYT(1)

PURPOSE

This function will return the given field as a B type (1 byte integer) field.

PARTS

1 f/c/e Required - The field to be converted to B type.

RETURN TYPE - B

The original field is not changed.

COMMENTS

F, P, T, and D type fields cannot be converted to B; however, all others can (including A type fields). If an L type field is converted, a .T. value will be converted to 1, a .F. to 0. If the value of the field to be converted is larger than the maximum value of a B type field (255), the result will be truncated and will not be accurate.

NOTE: This is the same as using the ASC() when converting an A type character.


ConvertToDate()

Navigation: Reference > Functions >

ConvertToDate()

 Print this Topic Return to chapter overview

CTOD(1)

PURPOSE

This function will return the given field as an D type (date) field.

PARTS

1 f/c/e Required - The field to be converted to D type.

RETURN TYPE - D

COMMENTS

B, F, P, T, and L type fields cannot be converted to D; however, all others can (including A type fields). The size of the resulting date depends on the receiving field, regardless of the value that is converted.

Example

In English (United States) this will work and produce the date as 01/01/ + System date year.

msg 'test CTOD '+ CTOD('01/01/'+ year(date()))

If your computer is set for another country where the date format might be Dutch (Netherlands) you must use the correct separator for that region or country. If the wrong separator is used the retuned value will be 00-00-00.

msg 'test CTOD '+ CTOD('01-01-'+ year(date()))

In Dutch (Netherlands) this will work and produce the date as 01-01- + System date year.

NOTE: This function must be formatted with the correct separator for the target country or region the computer will be working with. or there could be errors in the calculation.

NOTE: Here is one line of code that can extract the date separator for you.

define ds type A size 1 value mid(str(date()),3,1)

//ds will equal your date separator


ConvertToDBF()

Navigation: Reference > Functions >

ConvertToDBF()

 Print this Topic Return to chapter overview

CONVERT_TO_DBF(1,2,3,4)

PURPOSE

This function will convert an old style Btrieve file to a standard CodeBase (DBF) file based on entries in the data dictionary.

PARTS

1 f/c/e Required - The file to convert. This is the name of the file as currently in FILELOC (locations).

2 f/c/e The company code, if any. If you don't include a value here the program will use the default company code of 'B ' (B+2 spaces). You may either include the complete company code (B+company code) or just the last two characters.

NOTE: If you specify a company code here there must be a record in FILELOC for this file name and company code. This is where the program will get the path for the file.

3 f/c/e If you want to make sure to initialized the file before conversion make this 'Y' or .T. If you do not do this, and the file already exists, the converted records will be added to the file.

4 f/c/e If you made part 3 .T., and the file already exists, you may want to alert the user to that before it is initialized. If so, make this value 'Y' or .T. The default value is .F. which means the user won't be notified if the file exists.

RETURN TYPE - L

Returns .T. if the file was converted properly, .F. if not.

COMMENTS

This function will do all that is necessary to convert a Btrieve file to a DBF file at the proper location. The appropriate record must already exist in FILELOC before this process will work properly.

NOTE: A new record will be created in FILELOC for this file. The original company code will be changed so that it starts with C instead of the current B. So, if you are converting a file with a company code of B01 the new file will have a company code of C01.

NOTE: If you are converting from a previous version of TAS Professional you must run DBF_FLDS.RWN before you can convert to DBF files. This will create the entries in FILEDBF that are required before DBF files can be created.

SEE ALSO

CreateDBF()


ConvertToFloat()

Navigation: Reference > Functions >

ConvertToFloat()

 Print this Topic Return to chapter overview

CFLT(1)

PURPOSE

This function will return the given field as an N type (floating point) field.

PARTS

1 f/c/e Required - The field to be converted to N type.

RETURN TYPE - N

The original field is not changed.

COMMENTS

An F type field cannot be converted to N ; however, all others can (including A type fields). If an L type field is converted, a .T. value will be converted to 1.00, a .F. to 0.00.

NOTE: The number of decimal characters of the result depends on your receiving field. However, in all cases, other than converting an A type field such as '100.33' to N using this function, the decimal value will always be 0.

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


ConvertToHex()

Navigation: Reference > Functions >

ConvertToHex()

 Print this Topic Return to chapter overview

HEX(1)

PURPOSE

This function converts a numeric value to a hexadecimal number and returns that number as an A type field.

PARTS

1 f/c/e Required - The number to be converted.

RETURN TYPE - A

COMMENTS

All values are converted to R type first and then to hex.

EXAMPLE

define x type a size 10

x = hex(100)

// x = '64'

x = hex(110)

// x = '6e'

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


ConvertToInteger()

Navigation: Reference > Functions >

ConvertToInteger()

 Print this Topic Return to chapter overview

CINT(1)

PURPOSE

This function will return the given field as an I type (2 byte integer) field.

PARTS

1 f/c/e Required - The field to be converted to I type.

RETURN TYPE - I

The original field is not changed.

COMMENTS

F, P, T, and D type fields cannot be converted to I; however, all others can (including A type fields). If an L type field is converted, a .T. value will be converted to 1, a .F. to 0. If the value of the field to be converted is larger than the maximum value of an I type field (65535), the converted value will not be accurate.

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


ConvertToLogical()

Navigation: Reference > Functions >

ConvertToLogical()

 Print this Topic Return to chapter overview

CTOL(1)

PURPOSE

This function converts an A (character string) or B (byte) type field to a L (logical) type field.

PARTS

1 f/c/e Required - The A or B type field that is to be converted.

RETURN TYPE - L

EXAMPLE

define x type l

x = ctol('Y')

// x = .T.

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


ConvertToRec()

Navigation: Reference > Functions >

ConvertToRec()

 Print this Topic Return to chapter overview

CREC(1)

PURPOSE

This function will return the given field as an R type (record or 4 byte integer) field.

PARTS

1 f/c/e Required - The field to be converted to R type.

RETURN TYPE - R

The original field is not changed.

COMMENTS

An F type field cannot be converted to R; however, all others can. If an L type field is converted, a .T. value will be converted to 1, a .F. to 0.

EXAMPLE

define myrecord type R

myrecord = CREC('100')

msg myrecord

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


ConvertToTime()

Navigation: Reference > Functions >

ConvertToTime()

 Print this Topic Return to chapter overview

CTOT(1)

PURPOSE

This function will return the given field as an T type (time) field.

PARTS

1 f/c/e Required - The field to be converted to T type.

RETURN TYPE - T

COMMENTS

F, P, D, and L type fields cannot be converted to T (including A type fields); however, all others can. The size of the resulting time value depends on the receiving field, regardless of the value that is converted.

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


CopyFile()

Navigation: Reference > Functions >

CopyFile()

 Print this Topic Return to chapter overview

COPY_FILE(1,2)

PURPOSE

You must use this function to copy a file in Windows.

PARTS

1 f/c/e Required - From file name. Must be type A.

2 f/c/e Required - To file name. Must be type A.

RETURN TYPE - L

If the copy is complete the function returns .T., otherwise it returns .F..

COMMENTS

Wild card characters are not allowed in this function. You must specify both file names explicitly.

EXAMPLE

define copyok type L

button.click:

copyok = copyfile('myfile.txt','myfile2.txt')

if copyok

  msg 'myfile.txt was copied to myfile2.txt'

else

msg 'error file was not copied...'

endif

ret


Cosine()

Navigation: Reference > Functions >

Cosine()

 Print this Topic Return to chapter overview

COS(1)

PURPOSE

This function returns the cosine of the N type field specified.

PARTS

1 f/c/e Required - The N value.

RETURN TYPE - N

The return value is in radians.

COMMENTS

The value specified must be between -1 and 1.

EXAMPLE

x = cos(1.539)

// x = 0.03179097


CreateBtrv()

Navigation: Reference > Functions >

CreateBtrv()

 Print this Topic Return to chapter overview

CREATE_Btrv(1,2,3)

PURPOSE

This function will create a standard Pervasive /btreive database file based on entries in the data dictionary.

PARTS

1 f/c/e Required - The file to create. This is the name of the file as currently in FILELOC (locations).

2 f/c/e The company code, if any. If you don't include a value here the program will use the default company code of 'B ' (B+2 spaces). You may either include the complete company code (B+company code) or just the last two characters.

NOTE: If you specify a company code here there must be a record in FILELOC for this file name and company code. This is where the program will get the path for the file.

3 f/c/e If the file you are trying to create already exists you may want to alert the user to that before it is initialized. If so, make this value 'Y' or .T. The default value is .F. which means the user won't be notified if the file exists.

RETURN TYPE - L

Returns .T. if the file was created properly, .F. if not.

COMMENTS

This function will do all that is necessary to create a Pervasive btrieve file at the proper location. The appropriate record must already exist in FILELOC before this process will work properly.

NOTE: Warning to use this function you can not have the file you are trying to create open make sure you close the file first.

Also see

command inifle This command was used in TAS 5.x and we now recommend this function as it is much like the old tas 3.0 command and very easy to use.

co() Company code

EXAMPLE

define dummy_l type L

btn_init.click:

dummy_l = Create_btrv(loc_file_name,loc_comp_code,.t.)

if .not. dummy_l

    msg 'The Btreive file format file was not created'

else

    msg 'The Btrieve file format format file was created properly.'

endif

ret

Example 2

define table type a size 20

define dummy_l type L

table = 'myfile'

dummy_l = Create_Btrv(table,'B'*co(),.f.)

if .n. dummy_l

msg 'Error Creating new '+ table*' Table'

endif


CreateDBF()

Navigation: Reference > Functions >

CreateDBF()

 Print this Topic Return to chapter overview

CREATE_DBF(1,2,3)

PURPOSE

This function will create a standard CodeBase (DBF) file based on entries in the data dictionary.

PARTS

1 f/c/e Required - The file to create. This is the name of the file as currently in FILELOC (locations).

2 f/c/e The company code, if any. If you don't include a value here the program will use the default company code of 'C ' (C+2 spaces). You may either include the complete company code (C+company code) or just the last two characters.

NOTE: If you specify a company code here there must be a record in FILELOC for this file name and company code. This is where the program will get the path for the file.

3 f/c/e If the file you are trying to create already exists you may want to alert the user to that before it is initialized. If so, make this value 'Y' or .T. The default value is .F. which means the user won't be notified if the file exists.

RETURN TYPE - L

Returns .T. if the file was created properly, .F. if not.

COMMENTS

This function will do all that is necessary to create a DBF file at the proper location. The appropriate record must already exist in FILELOC before this process will work properly.

NOTE: If you are converting from a previous version of TAS Professional you must run DBF_FLDS.RWN before you can create DBF files. This will create the entries in FILEDBF that are required before DBF files can be created.

SEE ALSO

ConvertToDBF() co() Create_Btrv()

Example

define table type a size 20

define dummy_l type L

table = 'myfile'

dummy_l = Create_DBF(table,'B'*co(),.f.)

if .n. dummy_l

msg 'Error Creating new '+ table*' Table'

endif


CrLf()

Navigation: Reference > Functions >

CrLf()

 Print this Topic Return to chapter overview

CRLF(1)

PURPOSE

This function allows you to add 1 or more CR/LF pairs to a string. The would generally be used in a MSG or similar command to control line breaks.

PARTS

1 f/c/e If you want more than one CR/LF pair enter the number you want here. If this is blank or set to 0 then you'll get 1 pair.

RETURN TYPE - A

Each CR/LF is made up of two characters, chr(13) and chr(10).

EXAMPLE

msg 'Now is the time'+crlf()+'for all good men'+crlf(3)+'to come to the aid of their party'

//the msg above would display the following:


CurrentDate()

Navigation: Reference > Functions >

CurrentDate()

 Print this Topic Return to chapter overview

DATE()

PURPOSE

This function will return the current system date.

NO OTHER PARTS

RETURN TYPE - D

COMMENTS

This is the date returned by Windows as today's date.

EXAMPLE

define todays_date type d size 10

todays_date = date()

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


CurrentTime()

Navigation: Reference > Functions >

CurrentTime()

 Print this Topic Return to chapter overview

TIME()

PURPOSE

This function will return the current system time.

NO OTHER PARTS

RETURN TYPE - T

COMMENTS

This is the time returned by Windows as the current time.

EXAMPLE

define cur_time type T size 10

cur_time = time()

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()

Examples if using time and conversion

define cur_dec_time type n size 5 dec 2

cur_dec_time = TTOF(time())/3600 // current decimal time

define cur_rec_time = TTOR(time()/86400 //curent time in seconds..

Here is a sample if what I had to do in a program.. Only Putting this in here for reference.

define ok type l

define cur_dec_time,last_dec_time,ET_dec type n size 5 dec 2

func chktime

if last_date = 0 then last_date = ctod('01/01/2010')

//msg 'Test time'

cur_dec_time = TTOF(time())/3600 // current decimal time

last_dec_time = TTOF(last_time)/3600 // last visit decimal time

et_dec = cur_dec_time - last_dec_time //Elapst time decimal

//msg et_dec

// need to get num days

define days type i

days = date() - last_date

//msg 'days: '+days

if days > 2 // its been more then 2 days we let them in

ok = .t.

ret .t.

endif

if days = 1

//msg 'two day'

//msg 'ent_dec:'+et_dec

//msg 'enter hours:'+ enterhrs

// there are 2 days here

//example : 24 - 8 + 1 = 17 hrs

et_dec = 24 - last_dec_time + cur_dec_time

//msg 'one day'

//msg 'ent_dec:'+et_dec

//msg 'enter hours:'+enterhrs

if et_dec < ENTERHRS

//msg 'et_dec < ENTERHRS'

if et_dec < GRACE/60 // check grace period

//msg 'grace period true'

graceok = .t.

ok = .t.

ret .t.

else

//msg 'grace period false'

graceok = .f.

endif

endif

if et_dec > ENTERHRS

//msg 'et_dec < ENTERHRS #2'

ok = .t.

ret .t.

else

//msg 'everthing fails so we dont let them in.'

ok = .f.

ret .t.

endif

endif

if days = 0

// only one day

et_dec = cur_dec_time - last_dec_time

//msg 'one day'

//msg 'ent_dec:'+et_dec

//msg 'enter hours:'+enterhrs

if et_dec < ENTERHRS

//msg 'et_dec < ENTERHRS'

if et_dec < GRACE/60 // check grace period

// msg 'grace period true'

graceok = .t.

ok = .t.

ret .t. // we let then in

else

//msg 'grace period false'

graceok = .f.

endif

endif

if et_dec > ENTERHRS

//msg 'et_dec > ENTERHRS #2'

ok = .t.

ret .t.

else

//msg 'everthing fails so we dont let them in.'

ok = .f.

ret .t.

endif

endif

Another Example :

Assume File has record with Starting Time and Date fields: fld_starttime, fld_startdate

define PostTime,TimeDiff type T size 10
define PostDate type D size 8

btnTimePunch.click:
GetPostTime
GetRecord
if PostDate < fld_startdate
msg 'Your start date must be less than or equal to your stop date'
ret
endif
TimeDiff = iif(PostDate = fld_startdate,RtoT(TtoR(PostTime)-TtoR(fld_starttime)),RToT(86400-TtoR(fld_starttime)+TtoR(PostTime)))
// Stop at 3:00pm Start at 1:00pm 54000-46800 = 7200secs = 2hrs (Same Day)
// Stop at 1:00am Start at 11:00pm 86400-82800+3600 = 7200secs = 2hrs (Day Crossed-over)
ret

cmd GetPostTime
PostDate = Date()
PostTime = Time()
if PostDate <> Date() // Date can advance if when time is 11:59:59
PostDate = Date() // for the time it takes to execute statement
PostTime = Time() // Therefor re-get Date and Time
endif
ret

cmd GetRecord
find record based on your criteria
ret


CurrentPath()

Navigation: Reference > Functions >

CurrentPath()

 Print this Topic Return to chapter overview

CPATH()

PURPOSE

This function returns the user's current path value.

NO OTHER PARTS

RETURN TYPE - A

The receiving field should be at least 80 characters long.

COMMENTS

If your receiving field is too short the path will be truncated.

SEE ALSO

DPATH(), TPATH(), XPATH(), GET_INI_PATH()

EXAMPLE

x = cpath()

// x = 'C:\TAS7\'


CurrentProgramName()

Navigation: Reference > Functions >

CurrentProgramName()

 Print this Topic Return to chapter overview

WHOAMI()

PURPOSE

This function returns the name and path of the program that is active.

NO OTHER PARTS

RETURN TYPE - A

The receiving field should be at least 80 characters long.

COMMENTS

If your receiving field is too short the result will be truncated.

EXAMPLE

x = whoami()

// x = 'C:\ADV60\BKSOA.RWN'


DataDictionaryPath()

Navigation: Reference > Functions >

DataDictionaryPath()

 Print this Topic Return to chapter overview

DPATH()

PURPOSE

This function will return the default dictionary path value as set in Set Configuration or by the CDPATH (Change Dictionary Path) command.

NO OTHER PARTS

RETURN TYPE - A

The receiving field should be at least 80 characters long.

COMMENTS

If your receiving field is too short the path will be truncated.

SEE ALSO

CPATH(), TPATH(), XPATH() GETINIPATH()

EXAMPLE

define x type a size 255

x = dpath()

(* x would now contain a value similar to:

'C:\Advanced Accounting 7\' *)


DateInDMYFmt()

Navigation: Reference > Functions >

DateInDMYFmt()

 Print this Topic Return to chapter overview

DMY(1,2)

PURPOSE

This function returns a date value in the form of Day Month Year.

PARTS

1 f/c/e Required - Date value to use.

2 f/c/e If set to 'S' only the first three characters of the month value are used (e.g., Jan = January) and only the last two digits of the year. If set to 'L' (long) then the full month name and the full year are used. 'S' is the default value.

RETURN TYPE - A

The size of the string returned depends on the month.

SEE ALSO

MDY()

EXAMPLE

define x type s size 20

x = DMY(date(),'s')

// x would contain a value similar to: '30 Sep 00'

x = DMY(date(),'l')

// x would contain a value similar to: '30 September 2000'

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


DateInMDYFmt()

Navigation: Reference > Functions >

DateInMDYFmt()

 Print this Topic Return to chapter overview

MDY(1,2)

PURPOSE

This function returns a date value in the form of Month, Day, Year.

PARTS

1 f/c/e Required - Date value to use.

2 f/c/e If set to 'S' only the first three characters of the month value are used (e.g., Jan = January) and only the last two digits of the year. If set to 'L' (long) then the full month name and the full year are used. 'S' is the default value.

RETURN TYPE - A

The size of the string returned depends on the month.

SEE ALSO

DMY()

EXAMPLE

define x type s size 20

x = MDY(date(),'s')

// x would contain a value similar to: 'Sep 30, 00'

x = MDY(date(),'l')

// x would contain a value similar to: 'September 30, 2000'

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


DateToAlpha()

Navigation: Reference > Functions >

DateToAlpha()

 Print this Topic Return to chapter overview

DTOC(1,2)

PURPOSE

This function will convert a D type field into an A type field.

PARTS

1 f/c/e Required - The D type field to be converted. The original field value is not changed.

2 f/c/e The size of the A type version of the date to return. The default is 8 (mm/dd/yy). You can use any legal date size as the value.

RETURN TYPE - A

If the receiving field is not long enough the returned value will be truncated.

EXAMPLE

define x type a size 10

x = DTOC(date(),10)

(* if the current date is 09/30/00 then

x = 09/30/2000 *)

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


DateToRec()

Navigation: Reference > Functions >

DateToRec()

 Print this Topic Return to chapter overview

DTOR(1)

PURPOSE

This function will convert a D type field to an R type field.

PARTS

1 f/c/e Required - The D type field to be converted. The original field is not changed.

RETURN TYPE - R

The returned value is the number of days since 01/01/0001.

EXAMPLE

define x type r

x = DTOR(date())

// if the current date is 09/30/00 then x = 36805

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


DateToString()

Navigation: Reference > Functions >

DateToString()

 Print this Topic Return to chapter overview

DTOS(1)

PURPOSE

This function will return a date value as a string in the form YYYYMMDD.

PARTS

1 f/c/e Required - Date value to use.

RETURN TYPE - A

An 8 character string is always returned.

EXAMPLE

define x type a size 8

x = DTOS(date())

// if the current date is 09/30/00 then x = '20000930'

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


DAYS_IN_MONTH()

Navigation: Reference > Functions >

DAYS_IN_MONTH()

 Print this Topic Return to chapter overview

DAYS_IN_MONTH(1)

PURPOSE

This function will return the number of days in a given month related to a specific date..

PARTS

1. f/c/e Required: The date value to use, must be of D type.

RETURN TYPE - I

The number range returned is from 28 through 31.

EXAMPLE

define days_i type i size 2

define some_date type D size

some_date = date()

days_i = days_in_month(some_date)

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


DECRYPTSTR()

Navigation: Reference > Functions >

DECRYPTSTR()

 Print this Topic Return to chapter overview

Decryptstr(1,2,3)

PURPOSE

This function will unencrypt a string.

PARTS

1. f/c/e Required: - Encryption type seTwoFish / seBlowFish / seDES /seRC2

2. f/c/e Required: - The string of characters to be decrypted

3. f/c/e Required: - The encryption phrase or "key"

RETURN TYPE - A

COMMENTS

If an invalid phrase is used when trying to decrypt, the string returned will be gibberish. See ENCRYPTSTR() for further information.

With this function you can choose four deferent types of encryption types TwoFish BlowFish DES and RC2.

NOTE: If you are going to save this information into a data field you need to make sure the fields size will large enough to store the encrypted data.

EXAMPLE

Define string1,string2,string3 type a size 100

Define PassPhrase,filename type a size 80

define twofish,blowfish,des,rc2,md5,sha1 type l

ONStart:

String1 = 'Now is the time for all good men to come to the aid of there country'

PassPhrase = 'Computer Accounting Solutions'

Twofish = true

ret

(* -------------------------------------------------

Events for: btndecode Object Type: TGlyphBtn

----------------------------------------------- *)

btndecode.Click:

if twofish

string3 = Decryptstr(seTwofish,String2,passPhrase)

else_if blowfish

string3 = decryptstr(seBlowfish,String2,passPhrase)

else_if des

string3 = decryptstr(sedes,String2,passPhrase)

else_if rc2

string3 = decryptstr(serc2,String2,passPhrase)

else

msg 'Error encoding not set'

endif

Ret

See Also

ENCRYPTSTR()


DeleteFile()

Navigation: Reference > Functions >

DeleteFile()

 Print this Topic Return to chapter overview

DELF(1)

PURPOSE

This function will attempt to delete a file. If the deletion is successful, a logical .T. will be returned.

PARTS

1 f/c/e Required - The name of the file to be deleted. This must include the path and extension in standard notation.

RETURN TYPE - L

If the file is found and deleted the function will return a value of .T.; otherwise the returned value is .F.

NOTE: Warning to use this function you can not have the file you are trying to delete open make sure you close the file first.

Example

define del_ok type L

delete_file:

del_ok = del(temp_file_name)

if del_ok

Msg 'We Deleted the file ...'

else

Msg 'Sorry we could not delete the file..'

endif

ret

SEE ALSO

RENF, DELF, RENF()


Dir_Exist()

Navigation: Reference > Functions >

DIR_EXISTS()

 Print this Topic Return to chapter overview

DIR_EXISTS(1)

PURPOSE

This function checks for a specific Folder / Directory name.

PARTS

1. f/c/e Required: - The folder to search for.

RETURN TYPE - L

If the Folder / Directory is found this function returns .T., if not it returns .F.

COMMENTS

This is similar to FFILE() except that it only checks for a single folder and returns .T. or .F. instead of the file name.

EXAMPLES

if dir_exists('C:\TAS7')

msg 'The TAS Professional directory exists.

endif

if .n. dir_exists('\\SERVER\C\TAS7')

msg 'The TAS7 directory on the SERVER's C does not exist.'

endif

See also

FILE_EXISTS()


DSPCE()

Navigation: Reference > Functions >

DSPCE()

 Print this Topic Return to chapter overview

DSPCE()

PURPOSE

This function will return the amount of unused disk space on the current ‘default’ drive.

NO OTHER PARTS

RETURN TYPE R

The value returned is in number of bytes. If there are 5 Mbytes remaining the returned value would

be: 5242880


DLLFunctionCall()

Navigation: Reference > Functions >

DLLFunctionCall()

 Print this Topic Return to chapter overview

DLLFC(1,2,3,...)

PURPOSE

This function allows you to make a function call directly into a previously loaded DLL.

PARTS

1 f/c/e Required - The program number returned in the LOAD_DLL() function.

2 f/c/e Required - The name of the function within the DLL.

3 f/c/e Required - The type of the value returned by the function in the DLL. It can be of type 'B','I','R','N','L', or a single character ('C').

4-9 f/c/e If you want to pass values to the function they would be placed here. You are limited to 6 values that can be passed.

NOTE: When these values are passed they are placed in a byte array. This array is automatically set to the length required to contain all values. The values are passed in their "internal" format. This means if you are passing numeric ('N') type values, they are put in the array as 8 bytes, not as the ascii string values. Also, the first two bytes of the array contains the total length of the array.

RETURN TYPE - 'B', 'I', 'R', 'N', 'L', or 'C' (a single character)

The return value is dependent on the value in option 3. If the DLL is not found, or the function is not found then the return type will be L (logical) and the value will be False.

COMMENTS

Through the use of this function you should be able to write, or have written for you, routines that can accomplish anything that TAS doesn't do automatically. An example of this would be to read serial ports for data that you want to use in a TAS program. Or, if you need to write to a port to have something displayed, you could create a DLL that would accomplish that. The possibilities are endless. If you are now writing data to a file that is then read by a non-TAS program and written back to be used in the calling program you should consider replacing that with a DLL. It's much safer and you don't have to worry about whether or not the data has been flushed to disk, etc.

NOTE: The data passed to the DLL function is in a single byte array. The calling style is set to CDECL. However, since there is only one field being passed, it shouldn't matter.

NOTE: VERY IMPORTANT - Other than giving support in how to call a DLL we are not able to help you create them. However, we should be able to give you a name of someone who can should you be interested in interfacing a DLL or a special piece of equipment, to a TAS program.

EXAMPLE

A set of sample programs have been included. This includes the source code (written in Delphi) to the DLL itself. The TAS programs are DLLTEST.DFM, DLLTEST.SRC and DLLTEST.RWN. The Delphi code is DLLTEST.DPR, DLLTESTU.PAS and DLLTESTU.DCU. The DLL itself is called DLLTEST.DLL. The TAS programs expect it (the DLL) to be in the EXE subdirectory, which is where it's installed, however, this can be easily modified. The rest of the programs are in a subdirectory off the main installation path called DLLTEST.

The Delphi code itself is very simple. If you have any experience working with C or C++ you should be able to look at the DLLTESTU.PAS file and understand the basic workings of the call. This example shows the use of multiple fields being passed and the modified data being passed back to the TAS program.

SEE ALSO

REMOVE_DLL()

NOTE : A good example of the use of this function would be with the TASXLS.DLL and the TASEXCEL.DLL these two DLL program are used to update or Write Excel Spreadsheet file. Very useful to add graphing capability's to your TAS Professional programs.

for more information on these programs contact : Button


DualListExec()

Navigation: Reference > Functions >

DualListExec()

 Print this Topic Return to chapter overview

DUAL_LIST_EXEC(1)

PURPOSE

This function will display a dual list dialog box that has been previously placed on the form. For more information about the dual list dialog please refer to TDualListDialog.

PARTS

1 f/c/e Required - The object name. This would be the value in the Name field of the TDualListDialog object.

RETURN TYPE - L

If the user clicks the OK button the function returns .T., if they click the Cancel button, the function returns .F.

COMMENTS

If a TDualListDialog exists on the current active form, and the object name is correct, a dialog box, similar to the one below, will be displayed. The user can then move items from the left side to the right side and back again. You can access both the lists (List1 and List2) through the use of the STRINGS() function. In general use, you would provide the List1 items and the user would choose the ones they wanted. Then, if they click OK, your program would use the List2 strings (again, using the STRINGS() function) and process them as necessary.

EXAMPLE

// assuming that the TDualListDialog object name is dldTest

// the following would display the dialog below.

define x type l

define i type i

i = strings('dldTest','List1',stAddLine,'Line Num 1')

i = strings('dldTest','List1',stAddLine,'Line Num 2')

i = strings('dldTest','List1',stAddLine,'Line Num 3')

x = dual_list_exec('dldTest')


EditRegistry()

Navigation: Reference > Functions >

EditRegistry()

 Print this Topic Return to chapter overview

REGEDIT(1,2,3,4)

PURPOSE

This function will allow you to edit registry or INI file entries.

PARTS

1 sac Required - What to do:

regOpen - Open a registry entry/INI file for editing. This must be done before items can be read from or written to.

regReadInt - Read an integer value (B, I or R) from a registry item/INI file.

regReadStr - Read a string value (A) from a registry item/INI file.

regReadBool - Read a boolean value (L) from a registry item/INI file.

regWriteInt - Write an integer value (B, I or R) to a registry item/INI file.

regWriteStr - Write a string value (A) to a registry item/INI file.

regWriteBool - Write a boolean value (L) to a registry item/INI file.

regDelete - Delete a section from the registry/INI file.

regClose - Close a registry entry/INI file previously opened with regOpen.

2 f/c/e This part depends on the option specified in part 1.

regOpen - Required -

Registry: This is the 'path' you wish to open. All registry entries accessed using this function will be in 'HKEY_CURRENT_USER." Typically, you would use "SOFTWARE\"+any sub path you wish. For example, we use "SOFTWARE\Tas Professional.\TAS Pro\" etc. In this part you must specify the entire path name up to, but not including, the section name. The section name and actual variable name are specified in part 2 and 3 during the appropriate action.

INI File: This must be the entire file name, including any path. The extension of INI is automatically appended to the file name.

regReadInt, regReadStr, regReadBool, regWriteInt, regWriteStr, regWriteBool - Required - For these options you would specify the section name here. NOTE: You must have opened the registry entry/INI file first before you can read from or write to the entry.

reDelete - Required - This is the name of the section you wish to delete. NOTE: Be careful about using this option. It will delete the entire section for this entry and once deleted, it cannot be recovered.

3 f/c/e regReadInt, regReadStr, regReadBool, regWriteInt, regWriteStr, regWriteBool - Required - For these options you would specify the variable name here. NOTE: You must have opened the registry entry/INI file first before you can read from or write to the entry.

regOpen - If you are opening a registry entry then set this value to rtRegistry. If this is an INI file then set this to rtFile. The default value is rtRegistry.

4 f/c/e regWriteInt, regWriteStr, regWriteBool - Required - For these options you would specify the value you wish to save to the registry here. NOTE: You must have opened the registry entry/INI file first before you can write to the entry.

RETURN TYPE - Varies

The return value depends on the option set in part 1.

regReadInt - R - Returns the integer value from the registry/INI file item.

regReadStr - A - Returns the string value from the registry/INI file item.

regReadBool - L - Returns the boolean value from the registry/INI file item.

All other options return L. If the option completes properly the function will return .T., if not, it will return .F.

COMMENTS

NOTE: If you are not familiar with the registry (or INI files) in Windows you should not be using this function.

NOTE: The special alpha constants above (regOpen through regClose, rtRegistry and rtFile) are defined in COMPILERCONSTANTS.TXT.

NOTE: You may have only one registry or INI file open at a time.

Sample Code

This is an example of writing to an INI

define reg.cc.printer,reg.cc.ini type a size 80 // this is the path were they can find the xcharge.ini file and Printer

define reg.cc.copies type i size 2

define reg.cc.print,reg.cc.ask type l

define reg.cc.delay type i

define dummy_l type l

//Made 2 commands to show how to use regedit()

cmd read_ccreg

//open reg file

msg get_ini_path()

dummy_l = regedit(regOpen,get_ini_path()+'taspro',rtFile)

if dummy_l = .t.

reg.cc.ini = regedit(regReadstr,'X-charge','TRANSACTIONDIR')

reg.cc.printer = regedit(regReadstr,'X-charge','printername')

reg.cc.copies = regedit(regReadint,'X-charge','numcopies')

reg.cc.print = regedit(regReadBool,'X-charge','printrecipt')

reg.cc.ask = regedit(regReadBool,'X-charge','askprint')

reg.cc.delay = regedit(regReadint,'X-charge','delay')

if reg.cc.copies = 0 then reg.cc.copies = 1

//set defaults

if reg.cc.printer = '' then reg.cc.printer = printer_name()

if reg.cc.delay = 0 then reg.cc.delay = 3

else

msg 'Could not open TASPRO.INI for printer information..'

endif

ret

cmd writeccreg

dummy_l = regedit(regwritestr,'X-charge','TRANSACTIONDIR',reg.cc.ini)

dummy_l = regedit(regwritestr,'X-charge','printername',reg.cc.printer)

dummy_l = regedit(regwritestr,'X-charge','printername',reg.cc.printer)

dummy_l = regedit(regwriteint,'X-charge','numcopies',reg.cc.copies)

dummy_l = regedit(regwriteBool,'X-charge','printrecipt',reg.cc.print)

dummy_l = regedit(regwriteBool,'X-charge','askprint',reg.cc.ask)

dummy_l = regedit(regwriteint,'X-charge','delay',reg.cc.delay)

dummy_l = regedit(close)

ret


ENCRYPTSTR()

Navigation: Reference > Functions >

ENCRYPTSTR()

 Print this Topic Return to chapter overview

ENCRYPTSTR(1,2,3)

PURPOSE

This function will encrypt a string using the programmers choice of TwoFish, BlowFish, DES or RC2.

PARTS

1. f/c/e Requited - Encryption type seTwoFish / seBlowFish / seDES /seRC2

2. f/c/e Required - The string of characters to be encrypted

3. f/c/e Required - The encryption phrase or "key"

RETURN TYPE - A

COMMENTS

Allows you to encrypt a string (for example, a password or some other sensitive data). The encrypted string (always alphanumeric and it is case sensitive) can then be saved to a data file or a text (e.g. INI) file or anywhere that may be desired.

The string may later be unencrypted using DECRYPTSTR(). If an invalid phrase is used when trying to decrypt, the string returned will be gibberish.

With this function you can choose four deferent types of encryption types TwoFish BlowFish DES or RC2.

Twofish is a 128-bit block cipher that accepts a variable-length key up to 256 bits.

Blowfish is a symmetric block cipher that can be used as a drop-in replacement for DES or IDEA. It takes a variable-length key, from 32 bits to 448 bits, making it ideal for both domestic and exportable use. Blowfish was designed in 1993 by Bruce Schneier as a fast, free alternative to existing encryption algorithms. Since then it has been analyzed considerably, and it is slowly gaining acceptance as a strong encryption algorithm. Blowfish is unpatented and license-free, and is available free for all uses.

DES encrypts and decrypts data in 64-bit blocks, using a 64-bit key (although the effective key strength is only 56 bits, as explained below). It takes a 64-bit block of plaintext as input and outputs a 64-bit block of ciphertext. Since it always operates on blocks of equal size and it uses both permutations and substitutions in the algorithm, DES is both a block cipher and a product cipher.

RC2 is a 64-bit block cipher with a variable size key. Its 18 rounds are arranged as a source-heavy Feistel network, with 16 rounds of one type (MIXING) punctuated by two rounds of another type (MASHING). A MIXING round consists of four applications of the MIX transformation, as shown in the diagram. RC2 is vulnerable to a related-key attack using 234 chosen plaintexts (Kelsey et al, 1997).

NOTE: The encrypted string returned by this function will be larger than the original/input string If you are going to save this information into a data field you need to make sure the fields size will large enough to store the encrypted data.

NOTE: Including the encryption Key/phrase "as is" directly in your code (rather than say reading it from a field or from some external source) is not secure when used in a legacy ".RUN" program. In a newer style RWN programs, this is because ".RWN" compiled programs are always encrypted.

EXAMPLE

Define string1,string2,string3 type a size 100

Define PassPhrase,filename type a size 80

define twofish,blowfish,des,rc2,md5,sha1 type l

ONStart:

String1 = 'Now is the time for all good men to come to the aid of there country'

PassPhrase = 'Computer Accounting Solutions'

Twofish = true

ret

// Events for: btnencode Object Type: TGlyphBtn

btnencode.Click:

if twofish

string2 = encryptstr(setwofish,String1,passPhrase)

else_if blowfish

string2 = encryptstr(seBlowfish,String1,passPhrase)

else_if des

string2 = encryptstr(sedes,String1,passPhrase)

else_if rc2

string2 = encryptstr(serc2,String1,passPhrase)

else

msg 'Error encoding not set'

endif

Ret

See Also

Decryptstr()


EmailOperations()

Navigation: Reference > Functions >

EmailOperations()

 Print this Topic Return to chapter overview

EMAIL(1,2,3,4,5,6,7,8,9)

PURPOSE

Use this function to send or receive email messages from your SMTP (send) server or POP3 (receive) server. Also this function support MAPI for (send only)

PARTS

1 sac Required - What to do:

emlRecvSignOn - Tell the program to sign on to your POP3 server so that you can receive email messages.

emlRecvSignOff - When you're finished receiving email messages you must sign off.

emlRecvMsgList - Receive three lines for each outstanding email. This would consist of the sender, subject and date-time.

emlRecvMsg - Receive a specific email message. You must do this before you can get the individual parts.

emlRecvMsgBody - Move the body lines of a previously received email message into a string list.

emlRecvMsgAttach - Save the attachments to disk and put the file names into a string list.

emlRecvMsgCC - Move the Carbon Copy recipients (name and email addresses) to a string list.

emlRecvMsgCount - Get the number of outstanding emails currently on the server.

emlRecvMsgDel - Mark a specific email number for deletion. NOTE: This won't take place until you log out from the server.

emlSendMsg - Send an email message.

emlSendIMAP - Send an email Message Through Default IMAP (Mail Application Program interface)Application. Allows you to directly use programs like outlook and outlook express to send your email from TAS Professional powered by CAS letting the user even use there own email address book.

2 f/c/e Several of the email operations above expect to have a TStringList object available on the form to either store information received or for the information you want to send. This object can be part of a visual object, such as a TMemo, TTASComboBox, etc, or can be a TTASStrList. This object is required for: emlRecvMsgList, emlRecvMsg.Body, emlRecvMsgAttach, emlRecvMsgCC and emlSendMsg. For these options this would be the object name.

For emlRecvMsg and emlRecvMsgDel this is the required email message number. This value would be between 1 and the value received for the emlRecvMsgCount option, inclusive.

3 f/c/e For the options in part 2 that require a TStringList object, this is the required name of the property, for example, "Lines" in TMemo, "Items" in TTASComboBox and "Lines" in a TTASStrList.

4 f/c/e emlRecvMsgAttach - Required - This is the path where you want the attachments to be saved.

emlSendMAPI - Boolean to bring up Default Emailer Send Dialog.(Default False) Note: To use target email compose dialog set this to true.

5 f/c/e If you want to override the value for the server name to be used in the emlRecvSignOn or emlSendMsg operation, you can put that value here. If there is no value here the program will use value entered in the setup program for POP3 Server (emlRecvSignOn) or SMTP Server (emlSendMsg).

emlSendIMAP - Sender Address (optional)

6 f/c/e If you want to override the value for the password to be used in the emlRecvSignOn or emlSendMsg operation, you can put that value here. If there is no value here the program will use value entered in the setup program for POP3 Password (Recv) or the SMTP Password (Send).

emlSendMAPI - Sender Name (optional)

7 f/c/e If you want to override the value for the user name to be used in the emlRecvSignOn or emlSendMsg operation, you can put that value here. If there is no value here the program will use value entered in the setup program for POP3 UserName (Recv) or the SMTP UserName (Send).

8 f/c/e If you want to override the value for the sender address to be used in the emlSendMsg operation, you can put that value here. If there is no value here the program will use value entered in the setup program for Email Address.

9 f/c/e If you want to override the value for the sender name to be used in the emlSendMsg operation, you can put that value here. If there is no value here the program will use value entered in the setup program for Name (sender name).

RETURN TYPE - Varies

The return value depends on the option set in part 1.

emlRecvSignOn - L - Returns True if the sign on process is successful and False if not.

emlRecvSignOff - L - Returns True if the sign off process is successful and False if not.

emlRecvMsgList - I - Returns the number of email messages. This would also be the number of lines added to the TStringList object.

emlRecvMsg - L - If the message is received properly this returns True, if not False.

emlRecvMsgBody - I - Returns the number of lines in the email message body. This would also be the number of lines added to the TStringList object.

emlRecvMsgAttach - I - Returns the number of attachments in the email. This would also be the number of lines added to the TStringList object and the number of files saved to disk.

emlRecvMsgCC - I - Returns the number of carbon copy recipients in the email. This would also be the number of lines added to the TStringList object.

emlRecvMsgCount - I - This is similar to emlRecvMsgList except only the number of outstanding emails is returned.

emlRecvMsgDel - L - If you specify an email message number within those available this will return True, if not it will return False.

emlSendMsg - L - If the email is setup properly and it is sent this will return True, otherwise it will return False.

emlSendIMAP - L - If the email is setup properly and it is sent this will return True, otherwise it will return False.

COMMENTS

NOTE: The special alpha constants above (emlRecvSignOn through emlSendMsg) are defined in COMPILERCONSTANTS.TXT.

NOTE: You must setup the email server information before you can send and receive emails. For more information please see Email Settings in the Set Configuration section.

NOTE: For emlSendIMAP Does not Require any configuration in TASPRO. You May need to change some Security Setings in your Default EMailer.

NOTE: You must be signed on to your ISP or intranet before attempting an email operation. This function will not make the connection automatically.

EXAMPLES

A program is included with TAS Professional, EMAILTEST, that will allow you to receive and send email. This is a very simple program, but it will give you an idea of the power of this option. When you run this program the following screen will be displayed:

The first step to receiving emails is to Logon to your POP3 server. Do that by clicking on the Logon button. Once you do the receive buttons will be enabled and the send buttons disabled.

To receive a list of outstanding email click on the Recv Msg List button. Notice that the message list is split into three lines; the first is the name <address> of the sender, the second the subject line and the third the date and time the message was sent.

To display the body of the message enter the message number in the field after Recv Attach and click on the Recv Msg button.

To receive any attachments for the message again, put the message number in the field and click on Recv Attach. If there are no attachments that will be displayed in the memo.

Messages that you want to send have a specific structure. You need to include a TStrings or TStringsList object that includes the following lines, as appropriate:

\TO

followed by the address and name of the receiver(s) in address,name format. You can have as many receivers as you wish, however, you must have at least one.

\CC

Similar to receiver(s) above, except these will be added to the Carbon Copy list.

\BCC

Similar to CC above except the receiver(s) won't know who's on the list since they are Blind Carbon Copies.

\Subject

The subject of the email. A single line only.

\Body

As many lines as you wish. This makes up the body of the email.

\Attachments

The files you wish to attach to this email. You must include the full file name and path. If the file is not found it will not be sent. So, an example of an attachment file name would be: c:\temp\datetest.jpg.

An example of a message is part of the program. Make sure you have logged off the POP3 server (Logoff button) and click on the Demo Msg button. The following will appear:

Notice that case doesn't matter in the control lines. However, the first character must be a back slash and the exact word must immediately follow. Further, there can be nothing else on the control line.

If you wish to separater sections with a blank line you may. Blank lines are ignored in the \TO, \CC, \BCC, \SUBJECT and \ATTACHMENT section. However, they are included in the \BODY.

NOTE: It is a good idea to always logoff the server before you exit the program. In this example that process is done for you.


EndOfFile()

Navigation: Reference > Functions >

EndOfFile()

 Print this Topic Return to chapter overview

EOF(1)

PURPOSE

This function will determine whether or not the program has tried to read a record that is past the end of the file.

PARTS

1 f/c/e Required - The file number/handle to be checked.

RETURN TYPE - L

If the file is at EOF the function will return .T.; otherwise it will return .F.

COMMENTS

When a file is first opened this function would return .FALSE. However, if you tried to find a record using the L (last) option when you first opened that file, then do a N (next) find, and then checked this function it would return .TRUE.

SEE ALSO

BOF()


ExecFound()

Navigation: Reference > Functions >

ExecFound()

 Print this Topic Return to chapter overview

EXEC()

PURPOSE

This function will return whether or not the non-TAS program specified in the EXEC command was found. If it wasn't this function will return .F.; otherwise, it will return .T.

NO OTHER PARTS

RETURN TYPE - L


ExePath()

Navigation: Reference > Functions >

ExePath()

 Print this Topic Return to chapter overview

XPATH()

PURPOSE

This function returns the location of the EXE programs (TASPRO7.EXE & TASRUNTIME.EXE).

NO OTHER PARTS

RETURN TYPE - A

The receiving field should be at least 80 characters long.

COMMENTS

If your receiving field is too short the path will be truncated.

SEE ALSO

CPATH(), DPATH()

EXAMPLE

x = xpath()

// x might = 'C:\TAS7\'


Exponential()

Navigation: Reference > Functions >

Exponential()

 Print this Topic Return to chapter overview

EXP(1)

PURPOSE

This function returns the exponential of the field given.

PARTS

1 f/c/e Required - The N type field to be used in the calculation.

RETURN TYPE - N

COMMENTS

The function returns ex, with x being the field value given.


Fax()

Navigation: Reference > Functions >

Fax()

 Print this Topic Return to chapter overview

FAX(1,2,3,4,5,6,7,8,9)

PURPOSE

Use this function to send FAX messages (Requires Symantec Winfax 10.0)

1 f/c/e Phone Number (required)

2 f/c/e Fax to (Attention)

3 f/c/e Business Name (Company to)

4 f/c/e Subject

5 f/c/e Fax file to send (output report file)

6 f/c/e Cover page filename (winfax)

7 f/c/e Text for cover page

8 f/c/e Preview (preview before faxing) Logical .t. or .f.

9 f/c/e Fine resolution (use fine fax resolution) Logical .t. or .f.

Comment We have put this information in the manual so you can find this software if you need to use this feature in TAS professional.

The leading fax management software for small businesses*

WinFax PRO 10.0 is the leading fax management software for small businesses. Its high-quality faxes help you project a professional image to your clients and customers. When image clarity is vital, you can generate photo-quality faxes. You can even send or forward faxes via email to people who don't have fax hardware or software. (Requires a free viewer available for download http://www.symantec.com/winfax/) WinFax PRO is easy to set up, learn, and use. And it integrates smoothly with key business applications to simplify your management of client and customer interactions. Now it also supports Windows® XP. © 1995-2004 Symantec Corporation. All rights reserved.

Note: Attention! There is a problem in Symantec's latest version of WinFax Pro: 10.02 Their COM-Object does not work properly under XP. This means that printing from application(to the WinFax Pro Printer Driver) Does not Work under XP with this Version. (this will affect TASPRO 6)

Note: Version 10.03 Works (which Latest on the WEB)

Winfax is Copyright © 1995-2004 Symantec Corporation. All rights reserved.

Windows® XP is a registered tradmark of Microsoft Corporation


File_Attrib()

Navigation: Reference > Functions >

File_Attrib()

 Print this Topic Return to chapter overview

File_Attrib(1,2,3)

PURPOSE

This function will change or read file attributes (like attrib does)

PARTS

1 c Required - What to do ether FAGet or FASet to Find out what the attributes are or to change the attribute

2 f/c/e required - Filename to Check or Change.

3 f/c/e Required for FASet only. This is an Alpha with what you want to do:

-R = Remove Read-only

+R = Add to Read-only

-A = Remove Archive

+A = Add Archive

-H = Remove hidden

+H = Add hidden

-S = remove System

+S = Add System

Note :These can be added together to change multi attribute at once (i.e. "-R-H-S+A")

RETURN TYPE – Varies

FAGet - Returns a String of which attribute are Active:

A if Archive bit is set

R if Read-only bit is set

H if Hidden bit is set

S if System bit is set

D if Directory bit is set

FASet – Returns .T. if the attribute was change and .F. if there was a problem changing it.

EXAMPLE

(reading Attribute)

Define s type a size 5

S = file_attrib(FAGet,'tasruntime.exe')

// s = 'A'

(Change Attribute)

Define S type a size 10

Define L type L

S = '+r+A-h-s'

L = file_attrib(faSet,'tasruntime.exe',s)

// L = .t. // This might not work because tasruntime would be running.

NOTE: The special alpha constants above (FASet and FAGet) are defined in COMPILERCONSTANTS.TXT.


FieldType()

Navigation: Reference > Functions >

FieldType()

 Print this Topic Return to chapter overview

FTYP(1)

PURPOSE

This function will return the type of a specific field.

PARTS

1 f/c/e Required - The name of the field being checked.

RETURN TYPE - A

A single character representing the field type will be returned. If no field is found the function will return a blank.

NOTE: For more information about field types please refer to: System Specifications - Field Types .


FileDate()

Navigation: Reference > Functions >

FileDate()

 Print this Topic Return to chapter overview

FLDATE(1)

PURPOSE

This function returns the update date of the file named in the function.

PARTS

1 f/c/e Required - The name of the file to be checked. You must include the path and extension in standard notation.

RETURN TYPE - D

COMMENTS

If the file isn't found the returned date will be 00/00/00.

SEE ALSO

FLTIME(), FLSZE()


FileError()

Navigation: Reference > Functions >

FileError()

 Print this Topic Return to chapter overview

FLERR(1)

PURPOSE

This function will return the error number for the last access for a particular file.

PARTS

1 f/c/e The number/handle of the file to be checked. If you don't include a value here the program will check the last file access.

RETURN TYPE - I

The last file error number.

COMMENTS

If the last access was successful the FLERR() value returned will be 0. This function works for both TAS and non-TAS files. The error number returned will correspond to standard TAS Professional runtime errors. For more information please refer to Runtime Errors.

EXAMPLE

define myfile_hndl type I

// mykey is in the Data dictionary

define myfield type A size 10

myfield = 'TESTVALUE'

openv 'myfile' fnum myfile_hndl lock N

findv m myfile_hndl key mykey value myfield

if flerr(myfile_hndl) <> 0 then msg 'I could not find ' + myfield

// if myfield could not be found the message would be displayed.


FileExists()

Navigation: Reference > Functions >

FileExists()

 Print this Topic Return to chapter overview

FILE_EXISTS(1,2)

PURPOSE

This function searches for a specific file name.

PARTS

1 f/c/e Required - The file to search for. You must include a full path and extension.

2 f/c/e If you want to check for the file in the file manager (WTASFMGR.DBF) then set this value to True.

RETURN TYPE - L

If the file is found this function returns .T., if not it returns .F.

COMMENTS

This is similar to FFILE() except that it only checks for a single file and returns .T. or .F. instead of the file name. Also, this function will test for both a file on the disk and in the file manager.

EXAMPLE

define dummy_l type L

dummy_L = FILE_EXISTS('myfile.txt,.f.)

See Also

DIR_EXISTS()


FileSize()

Navigation: Reference > Functions >

FileSize()

 Print this Topic Return to chapter overview

FLSZE(1)

PURPOSE

This function returns the size of the file given in bytes.

PARTS

1 f/c/e Required - The name of the file to be checked. You must include the path and extension in standard notation.

RETURN TYPE - R

COMMENTS

If the file isn't found the returned size will be 0.

SEE ALSO

FLTIME(), FLDATE()


FileStore()

Navigation: Reference > Functions >

FileStore()

 Print this Topic Return to chapter overview

FILE_STORE(3)

PURPOSE

This function will attempt to import a file on the disk to a memo field, export from a memo field to a file on the disk, or copy from one memo field to another.

PARTS

1 f/c/e Required - The memo field to import to, export from or copy from.

2 f/c/e Required - The file to import from or export to. Must have full path if not in the default path. If the what to do option is fsCopy (copy from one memo field to another) then this must be the copy to memo field name.

3 f/c/e What to do

fsImport - Import from a file to a memo field - this is the default value.

fsExport - Export from a memo field to a file.

fsCopy - Copy from one memo field to another.

RETURN TYPE - L

If the function is successful it will return .T., if not it will return .F.

COMMENTS

This is the function used in the WTASFILEMGR program to import, export and restore from backup.

NOTE: This function only works with CodeBase files at the present time.


FileType()

Navigation: Reference > Functions >

FileType()

 Print this Topic Return to chapter overview

File_Type()

PURPOSE

The file_type() function will return the file type in a Char.

PARTS

1 f/c/e Required - The file number/handle to be checked.

RETURN TYPE - A

TYPE TDFXBC - The type of file being opened. The options are: T - TAS Professional, D - dBASEIII+ (non-CodeBase), F - Fixed length records (SDF), X - Text type, B - non-TAS Professional Btrieve files and C - Codebase

Example

filetype:

define F_type type a size 1

define data_hndl type i

openv 'data' fnum data_hndl

F_type = file_type(data_hndl)

if F_type = 'C' then msg 'Codebase'

if f_type = 'T' then msg 'Btrieve'

if f_type = 'B; Then msg 'Non-Tas'

ret

COMMENTS

The Return Char should correspond to the type option from the open commands.


FileTime()

Navigation: Reference > Functions >

FileTime()

 Print this Topic Return to chapter overview

FLTIME(1)

PURPOSE

This function returns the update time of the file named in the function.

PARTS

1 f/c/e Required - The name of the file to be checked. You must include the path and extension in standard notation.

RETURN TYPE - T

COMMENTS

If the file isn't found the returned time will be 0.

SEE ALSO

FLSZE(), FLDATE()


FillField()

Navigation: Reference > Functions >

FillField()

 Print this Topic Return to chapter overview

FILL(1,2)

PURPOSE

This function will return an A type field of a specific size and made up entirely of a specific character.

PARTS

1 f/c/e Required - The size of the string to be returned.

2 f/c/e Required - The fill character to be used. This must be an A type field and only the first character of that field will be used.

RETURN TYPE - A

EXAMPLE

define x type a size 10

x = FILL(sizeof(x,'d'),'*')

// x = '**********'


FindFieldPtr()

Navigation: Reference > Functions >

FindFieldPtr()

 Print this Topic Return to chapter overview

FFLD(1,2)

PURPOSE

This function will return the pointer (P or F) for a field. The function can also return a logical value to indicate that the field was not found.

PARTS

1 f/c/e Required - The name of the field to search for.

2 f/c/e What to return. 'P' returns a P type pointer, 'F' returns an F type pointer, and 'L' returns a logical value. Default value is 'L'.

RETURN TYPE - P, F or L

COMMENTS

If the return type is P or F, and the field name is not found, the program will return an error. If the return type is L the function will return .F.

NOTE: For more information on pointers please refer to Indirect Field References.


FindFile()

Navigation: Reference > Functions >

FindFile()

 Print this Topic Return to chapter overview

FFILE(1,2)

PURPOSE

This function searches for and returns the name of a file if found.

PARTS

1 f/c/e Required - The file to search for. You may use the standard wildcard file search characters of * and ?.

2 f/c/e Whether to search for the first occurrence of the file or the next. 'F' searches for the first, 'N' for the next. The default value is 'F'.

RETURN TYPE - A

Returns the file name if found. If the file is not found a blank field ("") will be returned. If the receiving field is too short the returning value will be truncated.

COMMENTS

You can search for an entire group of files that match a certain pattern. The first time you search part 2 must be set to 'F'. For any searches after that, part 2 must be set to 'N'. When no more matches are found the file name returned will be blank (""). Part 1 is not consequential when Part 2 is set to 'N'. However, a null field ("") at least must be included as a space keeper.

You must include the path if the file being searched for isn't in the current path. However, the file name returned will not include any path value, only the name and extension.

SEE ALSO

FILE_EXISTS() DIR_EXISTS()

EXAMPLE

define x type a size 250

x = FFILE('D*.*','F')

// x might contain a value similar to: 'DICTDAT.B' or 'DATABASE.DAT' etc.

x = FFILE('D??DAT.B','F')

// x might contain a value similar to: 'DBCDAT.B' or 'D12DAT.B' etc.


FirstDisplayableChar()

Navigation: Reference > Functions >

FirstDisplayableChar()

 Print this Topic Return to chapter overview

FCHR(1,2)

PURPOSE

This function will return the first displayable (non-space) character in an A type field or the position value of that character.

PARTS

1 f/c/e Required - The field to be checked. Must be an A type field.

2 f/c/e If 'C' the function will return the character; if 'L' the location of the first character. Default value is 'C'.

RETURN TYPE

A - If 'C' the function returns a single A type character.

I - If 'L' the function returns an I type value.

SEE ALSO

LCHR()

EXAMPLE

define x type a size 20

define i type i

define a type a size 1

x = ' 100.21'

a = fchr(x,'c')

// a = '1'

i = fchr(' 100.21','l')

// i = 5


Fnum()

Navigation: Reference > Functions >

Fnum()

 Print this Topic Return to chapter overview

Fnum()

This was a TAS5 function that is still in TAS7 can be useful if you use the old TAS5 Open Command to open files rather then using the preferred Findv Command.

By giving it the filename as a standard constant (i.e., the name surrounded by quotes--“BKARCUST”), it will return the proper file number. for a File name.

The embedded FNUM() in the following example will provide the file number for the file BKARCUST:

FLERR(FNUM(“BKARCUST”))

The example shown above would return any file errors for the file BKARCUST.


Floor()

Navigation: Reference > Functions >

Floor()

 Print this Topic Return to chapter overview

FLOOR(1)

PURPOSE

This function returns a whole number that is the closest value equal to or less than the field value specified.

PARTS

1 f/c/e Required - Must be N type field.

RETURN TYPE - N

SEE ALSO

CEIL()

EXAMPLE

define x type n size 10 dec 3

x = floor(-2.935)

// x would contain the value: -3.000

// Don't forget, -3 is < -2.935

x = floor(2.935)

// x = 2.000


FormatFieldToString()

Navigation: Reference > Functions >

FormatFieldToString()

 Print this Topic Return to chapter overview

STR(1,2,3)

PURPOSE

This function will return a numeric (B, I, R or N type) value as a string (A type).

PARTS

1 f/c/e Required - The numeric field value. The original field is unchanged.

2 f/c/e The number of characters in the final field. Defaults to the defined size of the field in part 1.

3 f/c/e The number of decimal characters in the final field. Defaults to the number of decimal characters in part 1.

RETURN TYPE - A

The size of this field depends on part 2.

EXAMPLE

define x type a size 10

x = str(195.32596,6,2)

//x = 195.33


GetComputerName()

Navigation: Reference > Functions >

GetComputerName()

 Print this Topic Return to chapter overview

GET_COMP_NAME()

PURPOSE

This function returns the name of the user's computer as stored in their registry.

NO OTHER PARTS

RETURN TYPE - A

If the receiving field is too short, the remaining characters will be truncated.

EXAMPLE

define x type a size 50

x = GET_COMP_NAME()

// x = 'My Computer'

SEE ALSO

GET_USER_NAME()


GetEnvironmentVarValue()

Navigation: Reference > Functions >

GetEnvironmentVarValue()

 Print this Topic Return to chapter overview

GETENV(1)

PURPOSE

This function will return an environment value. Generally these are set in the AUTOEXEC.BAT file (Win 95, 98, etc.) and are typically used instead of editing the Registry. You can also use the SETENV() function to set an environment value that you can then read later with this function.

PARTS

1 f/c/e Required - The name of the environment variable.

RETURN TYPE - A

The value set for this environment variable. If the receiving field is too short, the remaining characters will be truncated.

COMMENTS

If you don't pass an environment variable name, or the name is not found, an error will be returned.

NOTE : After TASPRO7 Build 9 getenv(1) will now return a blank NULL value if environment variable is not found. Before the program would return the value 'No Value Found'

EXAMPLE

define s type a size 200

s = GETENV('path')

//this might return something like this:

s = C:\WINDOWS;C:\WINDOWS\COMMAND;C:\UTIL;...


GetFieldFromDelimitedBuffer()

Navigation: Reference > Functions >

GetFieldFromDelimitedBuffer()

 Print this Topic Return to chapter overview

GFLD(1,2,3,4)

PURPOSE

This function returns a field from a delimited file buffer previously read with the READ or FINDV (Find Record) command or the GET_REC() function.

PARTS

1 f/c/e The field number in the delimited record. The first value in the record is field 1. Default is value 1.

2 f/c/e The file_number/handle for the file that contains the delimited records. You must provide a file_number/handle or provide a field or constant in part 4.

3 f/c/e The delimiter between fields in the buffer. The default value is a comma ','.

4 f/n/v A field to be used instead of a file. You must provide a value here if you didn't specify a file in part 2.

RETURN TYPE - A

COMMENTS

The quotes surrounding A type fields in the delimited record are automatically removed before the value is returned.

If you specify a field name as part 4, the program will treat that field as a record buffer so that the overall process will remain the same as if you had specified a file_number. If you use this option, be sure to put in a place-holding comma where the file_number would ordinarily go. In the example below, the programmer has not specified a file_number and has used the default delimiter value:

x=glfd(5,,,field_holder)


GetFileFDName()

Navigation: Reference > Functions >

GetFileFDName()

 Print this Topic Return to chapter overview

GET_BUFF_NAME(1)

PURPOSE

This function will return the FD name of an open file.

PARTS

1 f/c/e Required - The file number/handle to be checked.

RETURN TYPE - A

The return value is 8 characters long. If the receiving field is not long enough the value will be truncated.

COMMENTS

All of the information in the data dictionary is connected via the FD name. If you are searching for certain information about a file you would use this value to search the files for that data.


GetFileName()

Navigation: Reference > Functions >

GetFileName()

 Print this Topic Return to chapter overview

GET_FILE(1,2,3,4)

PURPOSE

This function displays a generalized open dialog box and returns the file chosen by the user. Use this command to find any file.

PARTS

1 f/c/e The file extension to display. This will determine the type of file you're searching for. If you leave this blank all files will be displayed.

2 f/c/e The path to start with. If you don't put a value here the dialog will start with the user's current path.

3 f/c/e The title to display in the caption of the dialog box that's displayed.

4 f/c/e The filter description. You can allow the user to filter the files displayed by multiple choices through the use of this option. See the EXAMPLE below for more information.

RETURN TYPE - A

Returns the file name if the user has chosen one. If a file is not chosen a blank field ("") will be returned. If the receiving field is too short the returning value will be truncated.

EXAMPLE

define x type a size 250

x = get_file('BMP','C:\','Find Bitmap Files','Bitmap files only (BMP)|*.BMP')


GetFileType()

Navigation: Reference > Functions >

GetFileType()

 Print this Topic Return to chapter overview

GET_FILE_TYPE(1)

PURPOSE

This function will return the type of file, Btrieve, CodeBase, or, in the case of non-TAS files, whatever you specified in the OPENV command.

PARTS

1 f/c/e Required - The file number/handle to be checked.

RETURN TYPE - A

This function will return a single character. If the file is Btrieve the function will return B; if CodeBase it will return C. If this is a non-TAS file it will return the character you specified in the OPENV command.

COMMENTS

In some situations you need to know whether the file is Btrieve or CodeBase. For example, in a SCAN loop, if you have a SAVE command in the loop that is saving records in the file that is being accessed you must use the NOCLR option if this is a CodeBase file. However, if this is a Btrieve file, the NOCLR option will slow the loop down considerably. By determining the type of file in your code you can use different SAVE commands for each type of file.


GetFormName()

Navigation: Reference > Functions >

GetFormName()

 Print this Topic Return to chapter overview

GET_FORM_NAME()

PURPOSE

This function returns the name of the currently active form/screen.

NO OTHER PARTS

RETURN TYPE - A

If the receiving field is too short, the remaining characters will be truncated.

COMMENTS

To access an object on the screen during runtime you must have the name of the object. In all other cases you know what the name is during design. However, the name of the form itself is determined when it is loaded. Use this function to get the name of the active form. For properties on the form that can be accessed during runtime refer to TTASForm.

EXAMPLE

define x type a size 20

x = GET_FORM_NAME()

// x = 'EditForm1'

SEE ALSO

FORM_PTR()


GetFormPtr()

Navigation: Reference > Functions >

GetFormPtr()

 Print this Topic Return to chapter overview

FORM_PTR()

PURPOSE

This function will return a value that can be used in GET_OBJ_PROP() and the SET_OBJECT command to specify a different form from the one that is currently active.

NO OTHER PARTS

RETURN TYPE - R

Returns a numeric value that refers to the current active form.

NOTE: If there is no active form, this will be 0.

COMMENTS

By using this value in the GET_OBJ_PROP() function and the SET_OBJECT command you can access objects on forms that are loaded by not currently active. A typical use for this option would be a program in which you want to change an object on the main form depending on a value the user enters on a subsequent form that's part of the same program. You know the first form is loaded since you're still in the same program, but, because of a choice your user has made, something must change on that form before they return; a field must be made visible that was not visible previously, disabled, etc.

This will also work with forms in other programs. As long as you have the value returned by this function you can access any form in the current instance of the runtime.

NOTE: You must get this value while the form is active and current. You cannot get this value for a different form from where you are.

SEE ALSO

GET_FORM_NAME()


GetIniPath()

Navigation: Reference > Functions >

GetIniPath()

 Print this Topic Return to chapter overview

GET_INI_PATH()

PURPOSE

This function will return the location of the TASPRO.INI file.

NO OTHER PARTS

RETURN TYPE - A

The receiving field should be at least 80 characters long.

COMMENTS

If your receiving field is too short the path will be truncated.

SEE ALSO

DPATH(), CPATH(), XPATH()

EXAMPLE

define x type a size 255

x = get_ini_path()

(* x would now contain a value similar to:

'C:\TASPro7\' *)


GetIntegerPart()

Navigation: Reference > Functions >

GetIntegerPart()

 Print this Topic Return to chapter overview

INT(1)

PURPOSE

This function will return the integer portion only of a N type field.

PARTS

1 f/c/e Required - The N type field to use. The original field is unchanged.

RETURN TYPE - N

COMMENTS

The decimal value is not rounded up but just eliminated. The decimal characters are still there; it's just that the value of those characters will be 0.

EXAMPLE

define n type n size 10 dec 3

n = int(2.935)

// n = 2.000


GetKeyNumber()

Navigation: Reference > Functions >

GetKeyNumber()

 Print this Topic Return to chapter overview

GET_KEY_NUM(1)

PURPOSE

This function will return the internal number for a key depending on the key name passed to the function.

PARTS

1 f/c/e Required - The name of the key. Must be the same as what you've specified in the data dictionary.

RETURN TYPE - I

NOTE: If the key was not found in the FILEKNUM file, the returned value will be 0.

COMMENTS

This is a quick and easy way to change the index for a command that uses keys, such as SCAN without using the SRCH command, etc.

EXAMPLE

This code is directly out of the print journals in Adv 7.

define key_num type i

define by_trans type l

if from.post.date<>0

findv g fnum bkgltran_hndl key bkgl.trn.date value from.post.date

key_num = get_key_num('bkgl.trn.date')

by_trans = false

else

findv g fnum bkgltran_hndl key bkgl.trn.date value from.post.date

key_num = get_key_num('bkgl.trn.num')

by_trans = true

endif

scan @bkgltran_hndl key @key_num for chk_recs() while .n. fini

//rest of code here.

ends


GetMemoCol()

Navigation: Reference > Functions >

GetMemoCol()

 Print this Topic Return to chapter overview

MEMO_COL(1,2)

PURPOSE

This function returns the column value for the user's last position in the memo.

PARTS

1 f/c/e Required - The TMemo or TTASMemo object name. This would be the value in the Name field that is a property of each object.

2 f/c/e This function will automatically use the active form in the current program. However, you may want to access a memo on a different form. If so, use the FORM_PTR() value here.

RETURN TYPE - I

If the memo cannot be found, or the user hasn't entered the memo yet, this function will return 0. The upper left corner of the memo is column 1.

COMMENTS

This function can be used directly along with the STRINGS() function to edit the current line of the memo.

SEE ALSO

MEMO_ROW()


GetMemoRow()

Navigation: Reference > Functions >

GetMemoRow()

 Print this Topic Return to chapter overview

MEMO_ROW(1,2)

PURPOSE

This function returns the row value for the user's last position in the memo.

PARTS

1 f/c/e Required - The TMemo or TTASMemo object name. This would be the value in the Name field that is a property of each object.

2 f/c/e This function will automatically use the active form in the current program. However, you may want to access a memo on a different form. If so, use the FORM_PTR() value here.

RETURN TYPE - I

If the memo cannot be found, or the user hasn't entered the memo yet, this function will return 0. The upper left corner of the memo is row 1.

COMMENTS

This function can be used directly along with the STRINGS() function to edit the current line of the memo.

SEE ALSO

MEMO_COL()


GetMouseCol()

Navigation: Reference > Functions >

GetMouseCol()

 Print this Topic Return to chapter overview

MOUSE_COL()

PURPOSE

This function returns the column (X) position of the mouse pointer. This is updated each time a MOUSE_XXX trap is called (XXX represents the specific trap, such as MOUSE_MOV, MOUSE_LBD, etc).

NO OTHER PARTS

RETURN TYPE - I

The position on the form offset from the upper left corner. For example, if the user has the mouse at the upper left corner the value would be 0.

SEE ALSO

MOUSE_ROW()


GetMouseRow()

Navigation: Reference > Functions >

GetMouseRow()

 Print this Topic Return to chapter overview

MOUSE_ROW()

PURPOSE

This function returns the row (Y) position of the mouse pointer. This is updated each time a MOUSE_XXX trap is called (XXX represents the specific trap, such as MOUSE_MOV, MOUSE_LBD, etc).

NO OTHER PARTS

RETURN TYPE - I

The position on the form offset from the upper left corner. For example, if the user has the mouse at the upper left corner the value would be 0.

SEE ALSO

MOUSE_COL()


GetObjPropertyValue()

Navigation: Reference > Functions >

GetObjPropertyValue()

 Print this Topic Return to chapter overview

GET_OBJ_PROP(1,2,3)

PURPOSE

All objects on a form (visual or non-visual) have properties. These can be accessed using this function. For more information about properties please refer to Form Object - General Info.

PARTS

1 f/c/e Required - The object name. This would be the value in the Name field that is a part of each object.

2 f/c/e Required - The property name, e.g., 'Top', 'Left', 'Visible', etc..

3 f/c/e This function will automatically use the active form in the current program. However, you may want to access an object on a different form. If so, use the FORM_PTR() value here.

RETURN TYPE - Variable

The return type depends entirely on the property. The possibilities are: A - Alpha or string value, B/I/R - Integer value, or L - Logical (boolean).

COMMENTS

If the function can't find the object or property then it will return the string: 'No Value Returned'.

EXAMPLE

define a type a size 50

a = get_obj_prop('btnTest','Caption')

// a = 'This is a Test'

// using the button above and

// assuming the name is btnTest

(* NOTE: You can get subproperty values

using this function also. So, for

example, if you wanted to get the

font size for the above object

you would use: *)

define x type n size 5

x = get_obj_prop('btnTest','Font.Size')

(* Notice that you put the subproperty

as part of the property field with a

period (.) between the property name

and the subproperty name. There

are not very many properties with

subproperties. The Font property is

the most commonly used of that type. *)

SEE ALSO

SET_OBJ_PROP(), SET_ALL_OBJECTS, EQUAL (=), Tips


GetOpenFileName()

Navigation: Reference > Functions >

GetOpenFileName()

 Print this Topic Return to chapter overview

OPEN_FILE_NAME(1)

PURPOSE

This function will return the complete file name, including path, for a particular file that has been opened with the OPENV command.

PARTS

1 f/c/e Required - The number/handle of the file to be used.

RETURN TYPE - A

The full name of the file as opened, including the path. If the receiving field is too short, the remaining characters will be truncated.

COMMENTS

If you don't pass a legal handle number the function will return 'Incorrect handle number.'


GetPath()

Navigation: Reference > Functions >

GetPath()

 Print this Topic Return to chapter overview

GET_PATH(1,2)

PURPOSE

This function displays a standard path dialog and allows the user to choose the appropriate path.

PARTS

1 f/c/e The default path. If this value is not set the dialog starts at the lowest possible point.

2 f/c/e You may set a caption here that will appear at the top of the dialog box.

RETURN TYPE - A

Returns the path name if chosen. If a path has not been chosen a blank field ("") will be returned. If the receiving field is too short the returning value will be truncated.

EXAMPLE

define x type a size 250

x = GET_PATH('C:\TAS60Doc\','This is a test')

(* The function above would generate the dialog box above

Notice the TAS60Doc subdirectory is opened when it is

displayed. In the example above the user has chosen

'WinHelp'. If they click the OK button the result

would be: x = 'C:\TAS60Doc\WinHelp\'

*)


GetRecFromBuffer()

Navigation: Reference > Functions >

GetRecFromBuffer()

 Print this Topic Return to chapter overview

GET_REC(1,2)

PURPOSE

This function will return an individual record from a buffer that has been used to store an entire file. Before using this function you should have read a non-TAS type file (general text or X type) into a field in your program that you are using as a temporary buffer.

PARTS

1 fn/v Required - The name of the field you are using as a buffer.

2 f/c/e The record number you want to retrieve. The first record in the buffer is 1. Default value is first record.

RETURN TYPE - A

The size of this field depends on the number of characters in the record. The termination characters at the end of the record are not returned as part of the record.

COMMENTS

Each record in the buffer must be terminated by a carriage return (CR) or a carriage return/line feed pair (CR/LF) or a binary 0. If you attempt to get more records than are in the file, the function will return a blank field with a length of 0. This also applies if there are no characters in the record to return.

SEE ALSO

OPENV, FINDV, READ


GetRunPrgName()

Navigation: Reference > Functions >

GetRunPrgName()

 Print this Topic Return to chapter overview

GET_RUN_PRG(1,2,3,4)

PURPOSE

This function displays a standard open dialog box and returns the file chosen by the user.

PARTS

1 f/c/e The type of run program to search for; RUN is TAS Professional 5.1 and before, RWN is TAS Professional. Since Ver 7.5 this function can also display and filter TAS professional report RTM files, SRC files, DFM file names. valid types are RUN, RWN, RTM, DFM, SRC all of these can be displayed out of windows or the TAS Professional program manager.

2 f/c/e The path to start with. If you don't put a value here the dialog will start with the user's current path.

3 f/c/e

Title on the Dialog Box

4 f/c/e

Switch for File manager (True to use)

RETURN TYPE - A

Returns the file name if the user has chosen one. If a file is not chosen a blank field ("") will be returned. If the receiving field is too short the returning value will be truncated.

EXAMPLE

define x type a size 250

x = get_run_prg('RWN','C:\ADV60\')

// This example will show files in the TAS Professional program Manager

define x type a size 250

x = get_run_prg ('RTM',,'Choose TAS report',.t.)

//or

x = get_run_prg ('RWN',,'Choose TAS Windows program',.t.)


GetUserName()

Navigation: Reference > Functions >

GetUserName()

 Print this Topic Return to chapter overview

GET_USER_NAME()

PURPOSE

This function returns the name of the user as they are currently logged in.

NO OTHER PARTS

RETURN TYPE - A

If the receiving field is too short, the remaining characters will be truncated.

EXAMPLE

define x type a size 50

x = GET_USER_NAME()

// x = 'CAS-Glenn'

SEE ALSO

GET_COMP_NAME()


GetWinColorValue()

Navigation: Reference > Functions >

GetWinColorValue()

 Print this Topic Return to chapter overview

GET_WCOLOR(1)

PURPOSE

This function will return a numeric value depending on the Windows color name you specify.

PARTS

1 f/c/e Required - Windows color name.

RETURN TYPE - R.

COMMENTS

The allowable color names are: 'SCROLLBAR', 'BACKGROUND', 'ACTIVECAPTION', 'INACTIVECAPTION', 'MENU', 'WINDOW', 'WINDOWFRAME', 'MENUTEXT', 'WINDOWTEXT', 'CAPTIONTEXT', 'ACTIVEBORDER', 'INACTIVEBORDER', 'APPWORKSPACE', 'HIGHLIGHT', 'HIGHLIGHTTEXT', 'BTNFACE', 'BTNSHADOW', 'GRAYTEXT', 'BTNTEXT', 'INACTIVECAPTIONTEXT', 'BTNHIGHLIGHT', 'BLACK', 'MAROON', 'GREEN', 'OLIVE', 'NAVY', 'PURPLE', 'TEAL', 'GRAY', 'SILVER', 'RED', 'LIME', 'YELLOW', 'BLUE', 'FUCHSIA', 'AQUA', 'LTGRAY', 'DKGRAY', 'WHITE'.

If you specify a color name other than one of the above the function will return 0.

EXAMPLE

define x type r

x = GET_WCOLOR('SILVER')

// x = 12632256


GridValidCheck()

Navigation: Reference > Functions >

GridValidCheck()

 Print this Topic Return to chapter overview

GRID_VALID_CHECK(1)

PURPOSE

This function will evaluate any ValidExpr properties in all of the columns of the specified data grid.

PARTS

1 f/c/e Required - The name of the TTASDataGrid to be checked.

RETURN TYPE - L

If any ValidExpr evaluates to False this function will return False, otherwise it will return True.

COMMENTS

During the check process the program will scan through the specified grid for any column that has a ValidExpr property that is not blank. When it finds one it resolves the expression. If the expression returns True it continues on to the next column until all have been tested. If the expression evaluates to False it exits the test and returns False to this function. In normal process you would exit the subroutine you're running and allow the user to fix the problem.

It doesn't matter how many ValidExpr's there are in the grid. It will continue to check each one until they all return True. This feature allows you to add or remove checks without having to worry about changing your code. You do have to remember to recompile the program to include (or remove) valid expressions.

This is very similar to the VALID_CHECK() except that it only works with the single grid you have named in the function.


HASHFILE()

Navigation: Reference > Functions >

HASHFILE()

 Print this Topic Return to chapter overview

HASHFILE(1,2,3,4)

PURPOSE

This function will get and verify a hash.

PARTS

1. sac Required: - What to do:

GetMD5 - gets the file's "fingerprint" using MD5

GetSHA1 – gets the file's "fingerprint" using SHA1

VerifyMD5 - compares the hash of the file using MD5

VerifySHA1 - compares the hash of the file using SHA1

2. f/c/e Required: - The file name including path

3. f/c/e This part depends on the option specified in part 1.

RETURN TYPE - Varies

The return value depends on the option set in part 1.

GetMD5 / GetSHA1 - A - Returns the hash value or fingerprint

VerifyMD5 / VerifySHA1 - L - Returns true if the fingerprint matches otherwise returns false

COMMENTS

MD5 stands for Message Digest number 5, an algorithm that generates a unique, 128-bit cryptographic message digest value derived from the contents of an input stream. A value such as this is considered to be a reliable fingerprint that can be used to verify the integrity of a file's contents. If as little as a single bit value in the file is modified, the MD5 checksum for the file changes. Forgery of a file in a way that causes MD5 to generate the same result as that for the original file is difficult.

SHA1 - is similar to MD5 but is 160-bit and is considered more secure than MD5.

Using a hash system provides a way to integrity check certain files. You might check the hash of a file in order to verify a copy operation or to verify that a user update has been implemented based on a stored list of known hash codes or as a part of some other verification process.

NOTE: The special alpha constants above (GetMD5 , GetSHA1, VerifyMD5, and VerifySHA1) are defined in COMPILERCONSTANTS.TXT.

EXAMPLE

Define RetVal Type A Size 50

Define Match Type L

Start:

RetVal = HashFile(getMD5,'C:\TEMP\SomeFile.txt')

//does not have to be the same directory

Match = HashFile(VerifyMD5,'C:\TEMP\SomeOtherFileName.txt',RetVal)

if match

msg "The files are the same."

else

msg "The files are not the same."

endif

ret


IfDupRecordInCodeBaseFile()

Navigation: Reference > Functions >

IfDupRecordInCodeBaseFile()

 Print this Topic Return to chapter overview

IFDUPCB(1,2)

PURPOSE

This function will check for duplicate records in an existing database depending on the data entered for the record. The check does not effect the values in the current record.

PARTS

1 f/c/e Required - File handle.

2 f/c/e Required - Key name to check. This must be a legitimate key name in the FD for the file.

RETURN TYPE - L

If there is an existing record with the same value for that key the function will return True, otherwise False

COMMENTS

This function not only checks for an existing record with the same index value, it also checks to make sure that it doesn't find the same record. So, you don't have to worry about checking for an active record if this function returns True.

NOTE: This function works only for CodeBase type files. For Btrieve files use the IFDUP command.

NOTE: This funtion will not work if you have not used the openv command with dupecheck see docs for openv command for details.

EXAMPLE

//in the OpenFiles section a file is customer file is opened

//don't forget the DupCheck option.

define cust_hndl type i

openv 'bkarcust' ext 'c' fnum cust_hndl

...

//in another routine you would place the duplicate check routine

//to make sure the user didn't try to create multiple records

//with the same customer code. You can also use the Duplicates

//option when defining the FD for the file. This, however, might

//give you a little more control over what happens and the FD test

//occurs only at the save.

if IfDupCB(cust_hndl,'bkar.custcode')

msg 'You have tried to enter a duplicate customer...'

set_focus //back to the customer code object

ret

endif


ImmediateIf()

Navigation: Reference > Functions >

ImmediateIf()

 Print this Topic Return to chapter overview

IIF(1,2,3)

PURPOSE

This function can return many different values depending on whether the logical expression provided returns .T. or .F.

PARTS

1 lexpr Required - The expression to evaluate to determine what should be returned.

2 f/c/e If the lexpr in part 1 evaluates to .T. the function will return this value.

3 f/c/e If the lexpr evaluates to .F. the function will return this value.

RETURN TYPE - Variable

The return type depends entirely on the function.

COMMENTS

If you are only concerned about one type of return (i.e., only .T. or only .F.), the other part need not be included.

NOTE: This is probably the most important function in TAS Professional and is very useful in many different situations.

EXAMPLE

define x type i

define a type a size 10

x = 1

a = iif(x=1,,'False')

// in this case a would be blank ("")

a = iif(x=1,'True')

// in this case a would contain the value: 'True'

NOTE: You must be careful about what you put into the True/False options in this function. Due to the way the expression compiler and executor work, if the values to be returned are expressions also (including UDFs), they will be resolved (executed) before the value of the IIF() is determined. For example:

x=5

y=10

a = iif(x>y,fill(x-y,' '),2)

If x>y was true then the routine above would use the difference to calculate how many space characters (' ') to print. However, since the inner expressions are evaluated before the IIF() an unexpected result could occur, as in this case. The program will return an error instead of what you expected. The proper way to set this up would be:

a = fill(iif(x>y,x-y,2), ' ')

This would work properly each time.


INCMONTH()

Navigation: Reference > Functions >

INCMONTH()

 Print this Topic Return to chapter overview

INC_MONTH(1,2)

PURPOSE

This function will increment (add) or decrement (subtract) a number of months to a date.

PARTS

1. f/c/e Required: - the base date, must be of D type.

2. f/c/e Required: - the number of months you wish to add or subtract (Defaults 1)

RETURN TYPE - D

The date returned depends on the user's regional date setting (so international date settings are recognized). So if a date in MM/DD/YYYY format will be returned in the same way.

NOTE: your regional date settings are read when the EXE first loads. If you change those settings while TASPRO7.EXE or TASRUNTIME.EXE is running, you will need to exit and restart your application before the change can be properly read.

COMMENTS

If the day of base date is greater than the day of the date to be returned, the day is set to the last day of the returned month. Example: if you add one month to an October 31 date, a November 30 date will be returned.

With this function you can also easily add or subtract years from a date simply by multiplying the second parameter by 12.

EXAMPLE

define startdate,endDate type D size 8

//must be defined as a type N in TAS if you plan to decrement

define incamt_n Type n size 4

startdate = date()

//add 18 months to the startdate and put the result into enddate

incamt_n = 18

enddate = Inc_Month(startdate,incamt_n)

//add 10 years to startdate instead

Startdate = date()

incamt_n = 120

enddate = Inc_Month(StartDate,incamt_n)

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


IsCharAlpha()

Navigation: Reference > Functions >

IsCharAlpha()

 Print this Topic Return to chapter overview

ISAL(1)

PURPOSE

This function will determine whether the first character of a field is an alphanumeric character (A-Z), or something else.

PARTS

1 f/c/e Required - Field to check, must be of type A.

RETURN TYPE - L

If the first character is from A-Z (upper or lower case), the function will return .T., otherwise .F.

SEE ALSO

ISLO(), ISNUM(), ISUP()

EXAMPLE

define x type a size 10

define y type l

x = 'SAMPLE'

y = isal(x)

// y = .T.

x = '!SAMPLE'

y = isal(x)

// y = .F.


IsCharLowerCase()

Navigation: Reference > Functions >

IsCharLowerCase()

 Print this Topic Return to chapter overview

ISLO(1)

PURPOSE

This function will determine whether the first character of a field is a lower case alphanumeric character (a-z), or something else.

PARTS

1 f/c/e Required - Field to check, must be of type A.

RETURN TYPE - L

If the first character is from a-z (lower case), the function will return .T., otherwise .F.

SEE ALSO

ISAL(), ISNUM(), ISUP()

EXAMPLE

define x type a size 10

define y type l

x = 'SAMPLE'

y = islo(x)

// y = .F.

x = 'sample'

y = islo(x)

// y = .T.


IsCharNumber()

Navigation: Reference > Functions >

IsCharNumber()

 Print this Topic Return to chapter overview

ISNUM(1)

PURPOSE

This function will determine whether the first character of a field is a numeric character (0-9), or something else.

PARTS

1 f/c/e Required - Field to check, must be of type A.

RETURN TYPE - L

If the first character is from 0-9, the function will return .T., otherwise .F.

SEE ALSO

ISAL(), ISLO(), ISUP()

EXAMPLE

define x type a size 10

define y type l

x = 'x10'

y = isnum(x)

// y = .F.

x = '10x'

y = isnum(x)

// y = .T.


IsCharUpperCase()

Navigation: Reference > Functions >

IsCharUpperCase()

 Print this Topic Return to chapter overview

ISUP(1)

PURPOSE

This function will determine whether the first character of a field is a upper case alphanumeric character (A-Z), or something else.

PARTS

1 f/c/e Required - Field to check, must be of type A.

RETURN TYPE - L

If the first character is from A-Z (upper case), the function will return .T., otherwise .F.

SEE ALSO

ISAL(), ISNUM(), ISLO()

EXAMPLE

define x type a size 10

define y type l

x = 'SAMPLE'

y = isup(x)

// y = .T.

x = 'sample'

y = isup(x)

// y = .F.


ISLEAPYEAR()

Navigation: Reference > Functions >

ISLEAPYEAR()

 Print this Topic Return to chapter overview

IS_LEAP_YEAR(1)

PURPOSE

This function return true or false if the date in question falls within a leap year.

PARTS

1. f/c/e Required: - the date value to use, must be of D type.

RETURN TYPE - L

EXAMPLE

define date type D size 10

date = ctod("07/01/2012")

if is_leap_year(date)

//2012 is a leap year, in this case will return true.

msg 'This date falls within a leap year.'

else

  msg 'This date does not fall within a leap year.'

endif

SEE ALSO


IsProgramLoaded()

Navigation: Reference > Functions >

IsProgramLoaded()

 Print this Topic Return to chapter overview

IS_PRG_LOADED(1)

PURPOSE

This function will determine whether or not a program has been previously loaded with the LOAD_PRG() function.

PARTS

1 f/c/e Required - The name of the program to check. The only part that matters is the actual name of the program, the path and extension are discarded if included.

RETURN TYPE - R

Returns a numeric value that refers to the program loaded. If the program is not loaded this will be 0.

COMMENTS

This function gives you an easy way to check to see a whether or not a TLL has been loaded previously before making a call to one of its routines.

SEE ALSO

CALL_PRG(), REMOVE_PRG()


IsRecordDeleted()

Navigation: Reference > Functions >

IsRecordDeleted()

 Print this Topic Return to chapter overview

REC_DEL(1)

PURPOSE

This function will determine whether or not the active record is marked as deleted or not.

PARTS

1 f/c/e Required - The file number/handle to be checked.

RETURN TYPE - L

If the record is marked as deleted the function will return .T.; otherwise it will return .F.

COMMENTS

This function works only with CodeBase files. When a record is deleted it is still in the active records. It is deleted from all the indexes so if you search for records via one of the indexes you'll never see a deleted record. However, if you search through the file using index 0 (@0), or the record number instead of an index, you will see all the records, included those that have been deleted. Through the use of this function you can test for those easily and just ignore the ones that return True.

NOTE: If you test for deleted records in a Btrieve file this function will always return False.

See Also DELETED()

NOTE: for some reason the original creator of TAS Professional made a change in the system and removed this function so for compatibility we have added both DELETED() and the REC_DEL() there is a deference on the two functions. the deleted() return a .F. and the REC_DEL() returns a .T. This move on our part to do this is for compatibility reasons only.


Deleted()

Navigation: Reference > Functions >

Deleted()

 Print this Topic Return to chapter overview

DELETED(1)

PURPOSE

This function will determine whether or not the active record is marked as deleted or not.

PARTS

1 f/c/e Required - The file number/handle to be checked.

RETURN TYPE - L

If the record is marked as deleted the function will return .F.; otherwise it will return .T.

COMMENTS

This function works only with CodeBase files. When a record is deleted it is still in the active records. It is deleted from all the indexes so if you search for records via one of the indexes you'll never see a deleted record. However, if you search through the file using index 0 (@0), or the record number instead of an index, you will see all the records, included those that have been deleted. Through the use of this function you can test for those easily and just ignore the ones that return True.

NOTE: If you test for deleted records in a Btrieve file this function will always return False.

See Also REC_DEL()

NOTE: for some reason the original creator of TAS Professional made a change in the system and created this function so for compatibility we have added both DELETED() and the REC_DEL() there is a deference on the two functions. the deleted() return a .F. and the REC_DEL() returns a .T. This move on our part to do this is for compatibility reasons only.


IsRecordLocked()

Navigation: Reference > Functions >

IsRecordLocked()

 Print this Topic Return to chapter overview

LCKD(1,2)

PURPOSE

This function will allow you to check if a record is locked by another user for a specific file/key value without having to actually read the record.

PARTS

1 f/c/e Required - The file_number/handle of the file to be checked.

2 key_expr (Btrieve) Required - The key number to be used.
2 f/c/e (CodeBase) Required - The name of the key to be used.

RETURN TYPE - L

If the record is locked the function will return .T., otherwise .F.

COMMENTS

This function assumes you have a value in the key field(s) already and will do the search based on that value. The existing record buffer will not be changed.

SEE ALSO

LOCK_REC()


JustifyField()

Navigation: Reference > Functions >

JustifyField()

 Print this Topic Return to chapter overview

JUST(1,2)

PURPOSE

This function will return the field with the non-space characters moved to the left, right, or center.

PARTS

1 f/c/e Required - The field to be justified, must be A type.

2 f/c/e Required - Which direction: 'L' - Left, 'R' - Right, or 'C' - Center.

RETURN TYPE - A

The original field remains unchanged.

EXAMPLE

define x,y type a size 20

x = 'ABCD '

y = just(x,'r')

// y = ' ABCD'

y = just(x,'C')

// y = ' ABCD '


LastDisplayableChar()

Navigation: Reference > Functions >

LastDisplayableChar()

 Print this Topic Return to chapter overview

LCHR(1,2)

PURPOSE

This function will return the last displayable (non-space) character in an A type field or the position value of that character.

PARTS

1 f/c/e Required - The field to be checked. Must be an A type field.

2 f/c/e If 'C' the function will return the character; if 'L' the location of the last character. Default value is 'C'.

RETURN TYPE

A - If 'C' the function returns a single A type character.

I - If 'L' the function returns an I type value.

SEE ALSO

FCHR()

EXAMPLE

define x type a size 20

define i type i

define a type a size 1

x = 'ABCD '

a = lchr(x,'c')

// a = 'D'

i = lchr(x,'l')

// i = 4


LastFile()

Navigation: Reference > Functions >

LastFile()

 Print this Topic Return to chapter overview

LAST_FILE()

PURPOSE

This function returns the handle value of the last file accessed.

NO OTHER PARTS

RETURN TYPE - I

COMMENTS

The handle value returned by this function is the same as the FNUM value returned in the OPENV command. You would generally use this function in connection with the RSRCH or RLCK TRAP commands. Through the use of this function you can be sure that when a routine is called it is for the correct file. If not, you can just exit.


LastObjectClickName()

Navigation: Reference > Functions >

LastObjectClickName()

 Print this Topic Return to chapter overview

LAST_OBJ_CLICK()

PURPOSE

This function returns the name of the last object clicked by the user. Any object that has a .CLICK event would show up here.

NO OTHER PARTS

RETURN TYPE - A

If the receiving field is too short, the remaining characters will be truncated.

COMMENTS

Some objects will not show up in the LAST_OBJ() function when they are clicked. This function can be used instead of LAST_OBJ() when you know the user is going to be clicking on the object. This includes buttons, menu items, radio buttons and check boxes, etc.

NOTE: The name of the object is returned exactly the same way you entered it in the screen form editor.


LastObjectName()

Navigation: Reference > Functions >

LastObjectName()

 Print this Topic Return to chapter overview

LAST_OBJ()

PURPOSE

This function returns the name of the last object accessed by the user.

NO OTHER PARTS

RETURN TYPE - A

If the receiving field is too short, the remaining characters will be truncated.

COMMENTS

Use this function to check what the user wants to do. This is very helpful when you're in a .VALID or .POST event from an entry object. For example, if the user clicks on a cancel button you may want to ignore the .VALID and just return .TRUE. By knowing the name of the object you will be able to determine this. If the user accesses another object the .VALID and .POST events will occur before a .PRE or .CLICK event of the new object. This means the only way you can check where the user is going is through this function. You can't set a flag in the new event and check for it in the exit events of the current object.

NOTE: The name of the object is returned exactly the same way you entered it in the screen form editor.


librarypath()

Navigation: Reference > Functions >

librarypath()

 Print this Topic Return to chapter overview

LPATH()

PURPOSE

This function will return the library path value. This will be the location of your .lib files for your projects.

NO OTHER PARTS

RETURN TYPE - A

The receiving field should be at least 80 characters long.

COMMENTS

If your receiving field is too short the path will be truncated.

SEE ALSO

CPATH(), TPATH(),XPATH()

EXAMPLE

define x type a size 255

x = lpath()

(* x would now contain a value similar to:

'C:\TAS7\lib\' *)


LicenseInformation()

Navigation: Reference > Functions >

LicenseInformation()

 Print this Topic Return to chapter overview

LICENSE(1)

PURPOSE

This function will return the current user's Serial Number, Multi-user code or User Type.

PARTS

1 f/c/e Required - What you want to get.

liSerialNum - get the users Serial Number

liUserType - get the user type (C - Development system, R - Runtime, D - Runtime+runtime compiler)

liMultiUserCode - (S - single user, P - peer-to-peer, C - client/server 10 user, U - client/server unlimited users

RETURN TYPE - A

EXAMPLE

define sn, ut, muc type a size 10

sn = license(liSerialNum)

// sn = '600001'

ut = license(liUserType)

// ut = 'C'

muc = license(liMultiUserCode)

// muc = 'C'


LikeFields()

Navigation: Reference > Functions >

LikeFields()

 Print this Topic Return to chapter overview

LIKE(1,2)

PURPOSE

This function will return a logical value indicating whether the two fields are alike. You may use the skeleton characters ? and * in the first field.

PARTS

1 f/c/e Required - Comparison field 1. If you are going to use the skeleton characters (variable character specifiers) ? or *, they must be in this field. Must be an A type value.

2 f/c/e Required - Comparison field 2. Must be an A type field.

RETURN TYPE - L

If the fields match the function will return .T., otherwise .F.

COMMENTS

The character ? will match any other single character in that same position in field 2. The character * will match all following characters from that position on. If comparison field 1 is shorter than field 2 and the last character in field 1 is NOT * the fields will not match and .F. will be returned. Differences in upper and lower case are treated as differences in characters.

EXAMPLE

define x type l

x = like('ABC','abc')

// same characters, different case, x = .F.

x = like('this*','this is a test')

// last character in comp fld1 is '*' and first chrs match

// x = .T.

x = like('th?s','this')

// ? will match any single chr., x = .T.


 LoadDLL()

Navigation: Reference > Functions >

LoadDLL()

 Print this Topic Return to chapter overview

LOAD_DLL(1)

PURPOSE

This function will load a DLL program into memory.

PARTS

1 f/c/e Required - The name of the DLL to load, must include complete path.

RETURN TYPE - I

Returns a numeric value that refers to the program loaded. Whenever you want to call a routine in that program you will need this value.

NOTE: If the program cannot be found, or is not loaded for some reason, this will be 0.

COMMENTS

These are true DLLs. You would write these using some other program than TAS, for example, Delphi or C++. The DLL is accessible only in the program where it was loaded. It will remain in memory until it is removed (REMOVE_DLL()) or until the program in which it was called exits.

Use DLLFC() to access a function in a previously loaded DLL. REMOVE_DLL() will delete the DLL from memory.

NOTE : A good example of the use of this function would be with the TASXLS.DLL and the TASEXCEL.DLL these two DLL program are used to update or Write Excel Spreadsheet file or data. Very useful to add graphing capability's to your TAS Professional programs.

for more information on these programs contact : Button

Click here for full documentation on TAS2XLS/TAS2EXCEL.DLL

EXAMPLE

See Sample exceltest.src in the sample\excel\ folder.


LoadProgram()

Navigation: Reference > Functions >

LoadProgram()

 Print this Topic Return to chapter overview

LOAD_PRG(1)

PURPOSE

This function will load an existing program into memory so that it can be called as though it were a DLL, or a series of subroutines that aren't attached to any single one program.

PARTS

1 f/c/e Required - The name of the program to load, must include complete path

RETURN TYPE - R

Returns a numeric value that refers to the program loaded. Whenever you want to call a routine in that program you will need this value.

NOTE: If the program cannot be found, or is not loaded for some reason, this will be 0.

COMMENTS

We call these routines TLLs or TAS Loadable Libraries. Once you have loaded one of these TLLs you can call it from any program run in that instance of the TAS Professional runtime. The TLL will remain in memory until it is removed (REMOVE_PRG()) or until the instance of the runtime exits. This will allow you to create a single program that contains some or all of the central subroutines for your application and access them from your other programs as though they were a part of that program. For example, say you have a subroutine that makes sure a field has certain characters in it and you would use this in many programs. Typically, you would include this routine in each program by either putting that routine into the appropriate programs, or including it in a library that would be compiled into the program. By using a TLL you no longer have to do that. Just load the program into memory and you can call the routine anywhere, from any program. There's a little more overhead and you may have to pass some extra variables, but the efficiency is significantly enhanced. Even more important, you can make changes to this TLL and never have to recompile the programs that call it, as long as you haven't changed the interface between the calling programs and the subroutine. So, say you find a bug, or add a new feature to a subroutine. If it's a TLL, and you have users already running your application, all you have to do is send out the new TLL program. The next time they run your application, and the TLL is loaded, they will have the changes made to their program. Even more important, if you have customers that have modifications made to their applications, maybe you can put those modifications into a TLL. Then, when the next upgrade is available, all you have to do is copy the TLL back and the modifications are automatically there!

Use CALL_PRG() to access a subroutine in a previously loaded TLL. REMOVE_PRG() will delete the TLL from memory and IS_PRG_LOADED() will let you know if the TLL is already running.

We make extensive use of this feature in Advanced Accounting.

NOTE: You can load programs that have forms/screens in them also. If they don't you must use the ForceRWN compiler directive to make sure this is a RWN program.

NOTE: All TLLs are automatically removed from memory when the runtime exits.

NOTE: If there is a START label in the program you are loading, it will be called just like running a standard program.


LoadModalForm()

Navigation: Reference > Functions >

LoadModalForm()

 Print this Topic Return to chapter overview

LOAD_MODAL_FORM(1)

PURPOSE

This function will load a form from the disk onto the screen in a modal state.

PARTS

1 f/c/e Required - The name of the form to load, must include complete path.

RETURN TYPE - I

The function will return the modal result. This depends on what you use to close the form. Generally this will be determined by the button the user clicks to close the form. For more information about modal result please refer to TButton.

COMMENTS

Every form loaded in Windows is either in a modal or non-modal state. If it's in a modal state that means it is the only form the user can interact with for that application. This means everything else stops until the user is finished with this form. For that reason you want to be judicious in your usage of this type of form. It is generally best for logon screens, dialog type screens, etc. Don't use this for general entry screens unless you want to make sure the user finishes with this screen before they continue with anything else.

NOTE: If you have specified that forms are to be encrypted (FormsEncrypted) then those loaded using this function must also be encrypted. If they aren't they will not be loaded properly.

Modal result constants are in the COMPILERCONSTANTS.TXT file. They are:

mrNone=0

mrOk=1

mrCancel=2

mrAbort=3

mrRetry=4

mrIgnore=5

mrYes=6

mrNo=7

mrAll=8

NOTE: You cannot QUIT the program when you are in a modal form. You must exit the modal form first.

NOTE: The LOAD_MODAL_FORM() function automatically saves the traps and sets them all to Ignore. When the modal form is closed the traps are restored. This will make sure that you don't have a TRAP ESC set or something similar that would try to QUIT the program before the modal form is closed.

Example

Here is a sample of how to use load and unload a modal form.

btndupe.click: //This was the button fron the mail form

define screen type I // define a field to use the form

screen = LOAD_MODAL_FORM('screen') //Load the screen

ret

start: // code to start the form

//set the variables

ret

// button event to process the form

button1.click:

// Do somthing and unload your screen.

SET_OBJECT GET_FORM_NAME() PROPERTY 'modal_result' VALUE MrCancel // After we process get rid of the form in code.

ret

Note : You can also unload a modal screen by seting a button to MrCancel


LockedUser()

Navigation: Reference > Functions >

LockedUser()

 Print this Topic Return to chapter overview

LOCKEDUSER(1)

PURPOSE

This function will return the Name of the user who has a file/record locked..

** NOTE : This Function will only work for Pervasive Version 8 or above.

PARTS

1. f/c/e Required: the File handle of the File that is locked.

RETURN TYPE -A

The Name of the User.

** NOTE: Error Code are Text and start with an ‘*’

*Invalid File Handle* = Indicate the file handle was not Valid

*File not open* = file not Open

*Not a Btrieve File* = the file was a CodeBase file.

*Requires New Version of Pervasive* = not Greater then or Equal to version 8

*File Not Locked* = File not locked.

*Error : XXX = Pervasive Error XXX

EXAMPLE

This Assumes that the file data_hndl with the key Field_two with record the number 50 is Locked by another user.

LockTestBtn.Click:

trap rlck gosub lock.test

findv m fnum data_hndl key FIELD_TWO val 50

trap rlck dflt

Ret

Lock.test:

if flerr(data_hndl)= 84 then Msg 'Record locked by User: '+ Lockeduser(data_hndl)

if flerr(data_hndl) = 85 then Msg 'file locked by User: '+ Lockeduser(data_hndl)

ret .false.


Log()

Navigation: Reference > Functions >

Log()

 Print this Topic Return to chapter overview

LOG(1)

PURPOSE

This function will return the log base e of the numeric value specified.

PARTS

1 f/c/e Required - The numeric value to use.

RETURN TYPE - N

EXAMPLE

define x type n size 10 dec 3

x = log(9000.000)

// x = 9.105


LowerCase()

Navigation: Reference > Functions >

LowerCase()

 Print this Topic Return to chapter overview

LOW(1)

PURPOSE

This function returns the A type field specified in lower case characters.

PARTS

1 f/c/e Required - The value to use. The original value is left unchanged.

RETURN TYPE - A

If the receiving field is too short, the remaining characters will be truncated.

SEE ALSO

UP(), PROP()

EXAMPLE

define x type a size 20

x = LOW('ABcdEFG')

// x = 'abcdefg'


MakeDirectory()

Navigation: Reference > Functions >

MakeDirectory()

 Print this Topic Return to chapter overview

MAKE_DIR(1,2)

PURPOSE

This function creates a new directory on a disk drive.

PARTS

1 f/c/e Required - The name of the directory to create, must include complete path.

2 f/c/e Optional - set to .T. to force the creation of folders. Note: Added after 7.1 Build 11 Powered by CAS

RETURN TYPE - L

If the directory/Folder is created properly the function returns .T., otherwise it returns .F.

EXAMPLE

define dummy_l type L

dummy_l = MAKE_DIR('My_Folder')

if Dummy_L

msg 'We made My_folder'

else

msg 'we could not make that folder name.'

endif

ret


MakePath()

Navigation: Reference > Functions >

MakePath()

 Print this Topic Return to chapter overview

MAKE_PATH(1,2)

PURPOSE

This function will make sure that the appropriate ending character is at the end of a file path.

PARTS

1 f/c/e Required - The path to check. Must be A type field.

2 f/c/e The maximum length of the path field. If you don't include this value the program will automatically set it to the length of the path currently plus 1.

RETURN TYPE - A

If the receiving field is too short, the remaining characters will be truncated.

SEE ALSO

PARSEFILE()

EXAMPLE

define x type a size 128

define y type a size 128

x = 'C:\ADV60'

y = make_path(x,size(x,'d'))

// y = 'C:\ADV60\'


MaximumValue()

Navigation: Reference > Functions >

MaximumValue()

 Print this Topic Return to chapter overview

MAX(1,2)

PURPOSE

This function returns the maximum value of the two specified.

PARTS

1 f/c/e Required - The first value to check, may be of any type other than P or F.

2 f/c/e Required - The second value to check, may be of any type other than P or F. Part 2 must be the same type as part 1.

RETURN TYPE - Variable

The value returned will be of the same type as part 1 & 2.

SEE ALSO

MIN()

EXAMPLE

define i type i

i = MAX(100,200)

// i = 200

define s type a size 10

s = MAX('ABC','DEF')

// s = 'DEF'


MinimumValue()

Navigation: Reference > Functions >

MinimumValue()

 Print this Topic Return to chapter overview

MIN(1,2)

PURPOSE

This function returns the minimum value of the two specified.

PARTS

1 f/c/e Required - The first value to check, may be of any type other than P or F.

2 f/c/e Required - The second value to check, may be of any type other than P or F. Part 2 must be the same type as part 1.

RETURN TYPE - Variable

The value returned will be of the same type as part 1 & 2.

SEE ALSO

MAX()

EXAMPLE

define i type i

i = MIN(100,200)

// i = 100

define s type a size 10

s = MIN('ABC','DEF')

// s = 'ABC'


Mod()

Navigation: Reference > Functions >

Mod()

 Print this Topic Return to chapter overview

MOD(1,2)

PURPOSE

This function returns the division remainder of two specified numbers.

PARTS

1 f/c/e Required - The dividend, where quotient = dividend / divisor. This is converted to an integer value before the computation is made.

2 f/c/e Required - The divisor. This is converted to an integer value before the computation is made.

RETURN TYPE - I

EXAMPLE

define i type i

i = MOD(100,33)

// i = 1 - 100/33=3 with a remainder of 1

i = MOD(100.00,32.33)

// i = 4

// the 100.00 is converted to 100

// the 32.33 is converted to 32

// 100/32 = 4 with a remainter of 4


MonthNum()

Navigation: Reference > Functions >

MonthNum()

 Print this Topic Return to chapter overview

MNTH(1)

PURPOSE

This function will return the month of a date as a number.

PARTS

1 f/c/e The date value to use, must be of D type.

RETURN TYPE - I

The number range returned is from 1 to 12, January through December.

SEE ALSO

DAYS_IN_MONTH()

INC_MONTH()

DOW()

EXAMPLE

define month type I

month = mnth(date())

// month will = system date month is system date is 12/15/2009 month will = 12


Null()

Navigation: Reference > Functions >

Null()

 Print this Topic Return to chapter overview

NULL(1)

PURPOSE

This function checks for a null pointer value. Will work with both P and F type fields.

PARTS

1 f/c/e Pointer value to check.

RETURN TYPE - L

If null the function will return .T., otherwise .F.

COMMENTS

This is the only way to check for a pointer value that doesn't point at anything.


NumArrayElements()

Navigation: Reference > Functions >

NumArrayElements()

 Print this Topic Return to chapter overview

FARRAY(1)

PURPOSE

This function returns the number of array elements for a specific field.

PARTS

1 f/c/e Required - The name of the field being checked.

RETURN TYPE - R

The number of array elements. If the field is not an array or doesn't have any elements the function will return 0.

EXAMPLE

define x type r

define y type a size 15 array 100

x = FARRAY(y)

// x = 100


NumDayOfMonth DOM()

Navigation: Reference > Functions >

NumDayOfMonth DOM()

 Print this Topic Return to chapter overview

DOM(1)

PURPOSE

This function will return the day of the month as a number.

SEE ALSO

MNTH()

INC_MONTH()

DOW()

PARTS

1 f/c/e The date value to use, must be of D type. Default value is the current date (date()).

RETURN TYPE - I

EXAMPLE

define x type i

x = DOM()

// if the date was 09/30/00 then x = 30


NumDayOfWeek DOW()

Navigation: Reference > Functions >

NumDayOfWeek DOW()

 Print this Topic Return to chapter overview

DOW(1)

PURPOSE

This function will return the day of the week as a number.

PARTS

1 f/c/e The date value to use, must be of D type. Default value is the current date (date())

RETURN TYPE - I

The number range returned is from 1 through 7, Sunday through Saturday.

EXAMPLE

define x type i

x = DOM()

(* if the date was 09/30/00 then

x = 7 (Saturday) *)


NumRecordsInFile()

Navigation: Reference > Functions >

NumRecordsInFile()

 Print this Topic Return to chapter overview

TRC(1)

PURPOSE

This function returns the number of records in a specified file.

PARTS

1 f/c/e Required - The file_number/handle of the file to check.

RETURN TYPE - R

COMMENTS

In Btrieve files the TRC() value may be greater than the active number of records due to deleted records that are still part of the file.


OpenFileError()

Navigation: Reference > Functions >

OpenFileError()

 Print this Topic Return to chapter overview

OPEN()

PURPOSE

This function will return the appropriate TAS Professional error message number for the last OPENV (Open File) command.

NO OTHER PARTS

RETURN TYPE - I

COMMENTS

If the file was opened properly this function will return 0. If the file was a Btrieve or CodeBase type file the function FLERR() will return the appropriate error number.


OperatingSystem()

Navigation: Reference > Functions >

OperatingSystem()

 Print this Topic Return to chapter overview

OS()

PURPOSE

This function returns the operating system name and version number.

NO OTHER PARTS

RETURN TYPE - A

The size of the returned value depends on the name of the operating system and the version number.

EXAMPLE

define x type a size 20

x = OS()

// x = 'Windows 10.04' (Win98)


PackDBF()

Navigation: Reference > Functions >

PackDBF()

 Print this Topic Return to chapter overview

PACK_DBF(1)

PURPOSE

This function will remove all deleted records a DBF (CodeBase) file. It will also remove any records from the DBT (memo) file if the master record is no longer there. This has the effect of reducing the size of the DBF and DBT files.

PARTS

1 f/c/e Required - The file_number/handle of the file to use.

RETURN TYPE - L

If the file is packed properly the function will return .T., if not it will return .F.

COMMENTS

NOTE: This will only work on CodeBase type files. It will return .False. if you attempt to use this function in connection with a Btrieve file.

NOTE: The file used in this function must have been previously opened using the OPENV command. It is strongly recommended that you use the "D" lock type when you open the file to deny access to this file to any other user while you are in the packing process.

NOTE: THIS FUNCTION AUTOMATICALLY REINDEXES THE FILE AT THE SAME TIME. THERE IS NO NEED TO PACK AND REINDEX.

SEE ALSO

REINDEX_DBF()


ParseFilePathAndName()

Navigation: Reference > Functions >

ParseFilePathAndName()

 Print this Topic Return to chapter overview

PARSEFILE(1,2)

PURPOSE

This function will allow you to get a part of a complete file specification that includes the path, name and extension.

PARTS

1 f/c/e Required - File name to parse, must be of type A.

2 sac Required - What part you want:

pfPath - Returns just the path of the file name.

pfName - Returns just the name portion of the file name without path and extension.

pfExt - Returns just the extension portion of the file name.

RETURN TYPE - A

If the receiving field is not long enough the result will be truncated.

EXAMPLE

define x type a size 128

define y type a size 128

x = 'C:\ADV60\BKSOA.RWN'

y = parsefile(x,pfPath)

// y = 'C:\ADV60\'

y = parsefile(x,pfName)

// y = 'BKSOA'

y = parsefile(x,pfExt)

// y = 'RWN'


PI()

Navigation: Reference > Functions >

PI()

 Print this Topic Return to chapter overview

PI()

PURPOSE

This function returns the value of the constant PI.

NO OTHER PARTS

RETURN TYPE - N

The constant is maintained internally up to 8 decimal characters.

EXAMPLE

define x type n size 12 dec 8

x = PI()

// x = 3.14159265


PrinterName()

Navigation: Reference > Functions >

PrinterName()

 Print this Topic Return to chapter overview

PRINTER_NAME()

PURPOSE

This function returns the current default printer name.

NO OTHER PARTS

RETURN TYPE - A

The size of the returned value depends on the name of the printer.

SEE ALSO

SETUP_PRINTER()

EXAMPLE

define x type a size 20

x = PRINTER_NAME()

// x = 'HP LaserJet 1100'


ProgLine()

Navigation: Reference > Functions >

ProgLine()

 Print this Topic Return to chapter overview

PROGLINE()

PURPOSE

This function returns the current line of code being executed.

NO OTHER PARTS

RETURN TYPE - I

COMMENTS

This function is can be used for debugging. It will allow the programmer to keep track of what order code is being called in, without having every command written out as with the Trace command.

EXAMPLE

Define LineNumber type I

LineNumber = ProgLine()

msg 'The line number is '+ str(LineNum)


ProgramError()

Navigation: Reference > Functions >

ProgramError()

 Print this Topic Return to chapter overview

PERR()

PURPOSE

This function returns the value of the internal Program Error Number if it's been set by an ERR command or other error.

NO OTHER PARTS

RETURN TYPE - I

COMMENTS

Once a program error occurs the appropriate error number will remain until it is cleared by the CLRPE command or the current program terminates.


ProperFormat()

Navigation: Reference > Functions >

ProperFormat()

 Print this Topic Return to chapter overview

PROP(1)

PURPOSE

This function is used to return a person's name in a more proper format.

PARTS

1 f/c/e Required - The value to be reformatted. The original value is not changed.

RETURN TYPE - A

SEE ALSO

LOW(), UP()

EXAMPLE

define x type a size 25

x = PROPER('JOHN Q. PUBLIC')

// x = 'John Q. Public'

x = PROPER('aBnEr Q. aNyDaY iii')

// x = 'Abner Q. Anyday III'


RandomNumber()

Navigation: Reference > Functions >

RandomNumber()

 Print this Topic Return to chapter overview

RNDM()

PURPOSE

This function will generate a random number.

NO OTHER PARTS

RETURN TYPE - I

COMMENTS

The first time this function is called in any program the random number generator is seeded with the time value. This makes sure that the value returned will always be different for multiple groups of random numbers generated.


RecordActive()

Navigation: Reference > Functions >

RecordActive()

 Print this Topic Return to chapter overview

ACTIVE(1)

PURPOSE

This function determines whether there is an active record in the buffer for a specified file.

PARTS

1 f/c/e Required - The file_number/handle of the file to use.

RETURN TYPE - L

If the record is active the function will return .T., if not it will return .F.

COMMENTS

If the user is entering a new record this function will return .F. It only returns .T. if a record has been found in a file and loaded into the record buffer.

SEE ALSO

IFNA()


RecordChanged()

Navigation: Reference > Functions >

RecordChanged()

 Print this Topic Return to chapter overview

REC_CHANGED(1)

PURPOSE

This function whether any of the fields in a record for a specific file have been modified.

PARTS

1 f/c/e Required - The file_number/handle of the file to use.

RETURN TYPE - L

If the record has been changed the function will return .T., if not it will return .F.

COMMENTS

The program checks for changes each time the user enters a file field. If the field value has been changed the record is marked as modified. This will be true until the record is saved or cleared or another record is found.


RecordBufferPtr()

Navigation: Reference > Functions >

RecordBufferPtr()

 Print this Topic Return to chapter overview

REC_PTR(1)

PURPOSE

This function returns a pointer (type P) to a record buffer. You can then use that pointer to get values from that record buffer rather than having to use field names.

PARTS

1 f/c/e Required - The file_number/handle of the file to use.

RETURN TYPE - P

COMMENTS

For more information about pointers please refer to Indirect Field References.


RecordLock()

Navigation: Reference > Functions >

RecordLock()

 Print this Topic Return to chapter overview

REC_LOCK(2)

PURPOSE

This function will attempt to lock, or unlock, a record in a file opened with Opportunistic locking. Use this function to lock records only when necessary. This will allow the user to browse records in a data base without locking a record until changes are to be made. You can also unlock an active record.

PARTS

1 f/c/e Required - The file_number/handle of the file to use.

2 f/c/e What to do

recLock - Lock the record - This is the default value.

recUnlock - Unlock the record.

RETURN TYPE - L

If the function is successful it will return .T., if not it will return .F.

COMMENTS

The file must have been opened with the OPENV command and the LOCK option must be set to O. A record must be active when the function is called or a False value will be returned.

NOTE: Once the record is locked the actual record is read again from disk to make sure the most current version is in memory. Users should not be allowed to make changes until the record is locked.

SEE ALSO

LCKD()


RecordSize()

Navigation: Reference > Functions >

RecordSize()

 Print this Topic Return to chapter overview

RSIZE(1)

PURPOSE

This function will return the record size for a specified file.

PARTS

1 f/c/e Required - The file_number/handle for the specified file.

RETURN TYPE - I

This is the maximum record size.

EXAMPLE

define hndl,x type i

openv 'errmsg' fnum hndl

x = RSIZE(hndl)

// x = 324


RecordNotActive()

Navigation: Reference > Functions >

RecordNotActive()

 Print this Topic Return to chapter overview

IFNA(1)

PURPOSE

This function will check if there is an active record for a specific file.

PARTS

1 f/c/e The file_number/handle of the file to be checked.

RETURN TYPE - L

If a record IS NOT ACTIVE for the file, the function will return .T., otherwise .F.

SEE ALSO

ACTIVE()


RecordNumber()

Navigation: Reference > Functions >

RecordNumber()

 Print this Topic Return to chapter overview

RCN(1)

PURPOSE

This function returns the record number for the active record in a specified file.

PARTS

1 f/c/e Required - The file_number/handle of the file to use.

RETURN TYPE - R

COMMENTS

If there is not an active record for the specified file, the function will return 0. This function can be used for both TAS and non-TAS files.

NOTE: In Btrieve files the number returned by this function is not the true record number, but the offset of the record within the file.


RecordPortion()

Navigation: Reference > Functions >

RecordPortion()

 Print this Topic Return to chapter overview

MID_REC(1,2,3)

PURPOSE

This function will return a portion of an active record in a specified file.

PARTS

1 f/c/e Required - The file_number/handle of the file to use.

2 f/c/e The starting character position. The first character of a record is position 1. Default value is 1.

3 f/c/e Required - The number of characters to return. If the value given would go beyond the end of the record, only those characters up to the end of the record will be passed.

RETURN TYPE - A

If the receiving field is too short, the remaining characters will be truncated.

SEE ALSO

MID()


RecordPosition()

Navigation: Reference > Functions >

RecordPosition()

 Print this Topic Return to chapter overview

REC_PERCENTAGE(1)

PURPOSE

This function will return the position of the current active record as a percentage..

PARTS

1 f/c/e Required - The number/handle of the file to be checked.

RETURN TYPE - I

The location in percentage form from 1 to 100.

COMMENTS

If there is an active record the value returned with be from 1 to 100, with 1 being the beginning of the file and 100 being the end


ReindexDBF()

Navigation: Reference > Functions >

ReindexDBF()

 Print this Topic Return to chapter overview

REINDEX_DBF(1)

PURPOSE

This function will reindex a DBF (CodeBase) file.

PARTS

1 f/c/e Required - The file_number/handle of the file to use.

RETURN TYPE - L

If the file is reindexed properly the function will return .T., if not it will return .F.

COMMENTS

NOTE: This will only work on CodeBase type files. It will return .False. if you attempt to use this function in connection with a Btrieve file.

NOTE: The file used in this function must have been previously opened using the OPENV command. It is strongly recommended that you use the "D" lock type when you open the file to deny access to this file to any other user while you are in the reindex process.

SEE ALSO

PACK_DBF()


RemoveDLL()

Navigation: Reference > Functions >

RemoveDLL()

 Print this Topic Return to chapter overview

REMOVE_DLL(1)

PURPOSE

This function will remove a DLL from memory previously loaded with the LOAD_DLL() function.

PARTS

1 f/c/e Required - The DLL handle number returned in the LOAD_DLL() function.

RETURN TYPE - L

If the DLL is found and removed properly the function will return .T., if not, it will return .F.

COMMENTS

All DLLs are removed automatically when the program in which they were loaded exits.

SEE ALSO

DLLFC()

NOTE : A good example of the use of this function would be with the TASXLS.DLL and the TASEXCEL.DLL these two DLL program are used to update or Write Excel Spreadsheet file. Very useful to add graphing capability's to your TAS Professional programs.

for more information on these programs contact : Button


RemoveProgram()

Navigation: Reference > Functions >

RemoveProgram()

 Print this Topic Return to chapter overview

REMOVE_PRG(1)

PURPOSE

This function will remove a program from memory previously loaded with the LOAD_PRG() function.

PARTS

1 f/c/e Required - The program number returned in the LOAD_PRG() function.

RETURN TYPE - L

If the program is found and the program removed the function will return .T., if not, it will return .F.

COMMENTS

All TLL programs are removed automatically when the instance of the runtime exits. However, you may want to remove it early to keep the number of routines down, or for security purposes, or if you want to replace the current TLL with another that has different routines. Any program can remove a TLL loaded by a different program. Also, they don't have to be removed in any order.

SEE ALSO

CALL_PRG(), IS_PRG_LOADED()


RenameFile()

Navigation: Reference > Functions >

RenameFile()

 Print this Topic Return to chapter overview

RENF(1,2)

PURPOSE

This function can be used to rename a file. It will return a value indicating whether or not the renaming was successful.

PARTS

1 f/c/e Required - The current file name, must include full path and extension.

2 f/c/e Required - The new file name, must include full path and extension.

RETURN TYPE - L

If the rename operation is successful the function will return .T., if not, .F..

COMMENTS

You may move the file from one path to another by using the appropriate path values.


ReplaceCharacters()

Navigation: Reference > Functions >

ReplaceCharacters()

 Print this Topic Return to chapter overview

REPLACE(1,2,3,4)

PURPOSE

This function will return a string with certain characters replaced with others.

PARTS

1 f/c/e Required - The string/alpha field to use.

2 f/c/e Required - The character(s) to replace. NOTE: The value will not be trimmed automatically. So, if there are extra spaces they will be used in the search.

3 f/c/e Required - The new character(s) to use in place of number 2 above. NOTE: The value will not be trimmed automatically. So, if there are extra spaces they will be used in the replacement process.

4 f/c/e If you want to ignore case then set this value to True, otherwise, the case of the characters will have to match that in option 2 above.

RETURN TYPE - A

If the receiving field is too short, the remaining characters will be truncated.

SEE ALSO

MID

EXAMPLE

define tempStr type a size 19

tempstr = '0123-4567-890A-BCDE'

tempStr = replace(tempStr,'-',' ')

msg 'tempStr: '+tempStr

//The value displayed will be: 0123 4567 890A BCDE

//If you use fields instead of constants, and don't

//trim the extra spaces you could get something like this:

define s1,s2 type a size 5

s1 = '-'

s2 = ' '

tempstr = '0123-4567-890A-BCDE'

tempStr = replace(tempstr,trim(s1,'t'),s2)

//The value displayed will be: 0123 4567 8


ReportLineCount()

Navigation: Reference > Functions >

ReportLineCount()

 Print this Topic Return to chapter overview

REPORT_LINES()

PURPOSE

This function will return the number of times the OUTPUT_REPORT_DATA RB_NUM 1 command has been executed since the last SETUP_REPORT_BUFF RB_NUM 1.

NO OTHER PARTS

RETURN TYPE - R

COMMENTS

This only returns the value of the number of data lines in RB_NUM 1. This will probably have nothing to do with the actual number of lines printed in the report. However, it's a quick and easy way to make sure there are lines waiting to be printed before you call the PRINT_REPORT command.


ResetField()

Navigation: Reference > Functions >

ResetField()

 Print this Topic Return to chapter overview

RESET_FIELD(1,2)

PURPOSE

This function has the same result as the RESET option in the DEFINE command, except that it can work on any previously loaded program.

PARTS

1 f/c/e Required - The name of the field you want to use in the current program.

NOTE: If you put the name of the field as this option, it must be surrounded by quotes, e.g., 'CustName'. Do not just use the field name since the function will assume that the value it's looking for is held by the field you specified.

2 f/c/e Required - The name of the program where the field was first defined, or, if it's a file field, the name of the program where the file was originally opened and the field was used.

RETURN TYPE - L

If the function is successful it will return .T., if not, .F..

COMMENTS

Using the RESET option in the DEFINE command works only when the field is referred to in the previous program and that program CHAINed to the current program. If that's not the case, for example, if the user has multiple program running at the same time due to separate choices from the menu, the RESET option won't work. In that case you would want to use this function. Another example would be if you have specified a main menu program. Any program run from the main menu is not a normal chain. If you wanted to use a field in the main menu program you must use this function.

If this function is successful the result is the same as the DEFINE RESET option. Any changes you make to that field value will be made in the original program so that any other program accessing the field will get the result of that change.

NOTE: When specifying the program name in part 2 use only the main part of the name. The path and extension should not be included.


RestructureDBF()

Navigation: Reference > Functions >

RestructureDBF()

 Print this Topic Return to chapter overview

RESTRUCTURE_DBF(1,2)

PURPOSE

This function will restructure an existing CodeBase (DBF) file based on entries in the data dictionary.

PARTS

1 f/c/e Required - The file to restructure. This is the name of the file as currently in FILELOC (locations).

2 f/c/e The company code, if any. If you don't include a value here the program will use the default company code of 'B ' (B+2 spaces). You may either include the complete company code (B+company code) or just the last two characters.

NOTE: If you specify a company code here there must be a record in FILELOC for this file name and company code. This is where the program will get the path for the file.

RETURN TYPE - L

Returns .T. if the file was restructured properly, .F. if not.

COMMENTS

This function will do all that is necessary to restructure the CodeBase (DBF) file. The appropriate record must already exist in FILELOC before this process will work properly and the file must be of type C.

NOTE: Only fields that are named the same in both the new structure and the current file will be converted. The names used are the ShortFieldNames. This means that if you change the ShortFieldName in the structure, save it (in Maintain Data Dictionary) and then restructure the file you may not convert all the fields from the current file to the new. Make sure you have a backup of the data dictionary (FILE*.DBF and FILE*.MDX) and the file(s) that is (are) being restructured before you start this process. This is the command that is used in Maintain Data Dictionary when you choose the Restructure process.

SEE ALSO

CreateDBF()


Round()

Navigation: Reference > Functions >

Round()

 Print this Topic Return to chapter overview

ROUND(1,2)

PURPOSE

This function will return an N type value rounded up to a specified number of decimal characters. This is considered simple rounding. Not to be confused with bankers rounding.

PARTS

1 f/c/e Required - The N type field value. The original value is unchanged.

2 f/c/e The number of significant decimal characters to keep. This cannot be more than 8. If the number specified is more than the defined value for the field being rounded, there will be no effect. Default value is 0.

RETURN TYPE - N

The number of decimal characters of the receiving field is unchanged; only the value is affected.

EXAMPLE

define n type n size 6 dec 2

n = round(29.3251,2)

// n = 29.33

n = round(29.3247,2)

// n = 29.32

n = round(29.775,0)

// n = 30.000

n = 2.5

n = round(2.5,0)

//n = 3.00


Serial_Port()

Navigation: Reference > Functions >

Serial_Port()

 Print this Topic Return to chapter overview

SERIAL_PORT(1,2,3,4,5,6,7,8)

PURPOSE

This function will activate a serial port for access, send or receive data and close it after access is done.

PARTS

1 f/c/e Required - What to do:

spActivate - Setup the serial port for access.

spRead - Read characters from the serial port.

spWrite - Write characters to the serial port.

spClose - Close the serial port after access is complete.

2 f/c/e This part depends on the option specified in part 1.

spActivate - Required - The port number, from 1 to 16.

spRead - Required - The field that receives the data in the buffer.

spWrite - Required - The A type field that will be used to output data.

3 sac This part depends on the option specified in part 1.

spActivate - Required - The baud rate. Options are: br110, br300, br600, br1200, br2400, br4800, br9600, br14400, br19200, br38400, br56000, br57600, br115200, br128000, br256000. The number represents the actual baud rate, so br9600 is a baud rate of 9600.

.

spRead - The maximum number of characters to read. If no value is specified here the function will return all the characters in the buffer, up to the size of the field specified in part 2.

spWrite - The maximum number of characters to write. If no value is specified here the function will send the entire field that was specified in part 2.

4 f/c/e spActivate - Required - Hardware flow control. Options are: hwfcOff (no hardware flow control), hwfcRTSOn (Request To Send only), hwfcBothOn (both Request To Send and Clear ToSend active).

5 f/c/e spActivate - Required - Parity setting. Options are: parNone (no parity), parOdd (odd parity check), parEven (even parity check), parMark, parSpace.

6 f/c/e spActivate - Required - Software flow control. Options are: swfcOff (XonXoff is off), swfcOn (XonXoff is on).

7 f/c/e spActivate - Required - Stop bits. Options are: sb1 (1 stop bit), sb1.5 (1 1/2 stop bits), sb2 (2 stop bits).

8 f/c/e spActivate - Required - Data bits. Options are: db5, db6, db7, db8. The number represents the number of data bits, so db8 is 8 data bits.

RETURN TYPE - I

Returns the result from the operation. spActivate - 0 if Successful

spClose - 0 if Successful

spRead - Number of character read

spWrite - Number of character Written.

COMMENTS

This function eliminates the need for outside programs to access the serial port.

NOTE: The special alpha constants above are defined in COMPILERCONSTANTS.TXT.

EXAMPLE

The following example was a short test to put data out to a POS pole display that connected to com1.

//test of pole device

//open the serial port first

define s type a size 50

define i type i

if serial_port(spActivate, 1, br9600, hwfcRTSOn, parNone, swfcOff, sb1, db8)=0

msg 'port opened'

s = chr(18)

i = serial_port(spWrite, s, 1)

for(cntr;1;50;1)

s = chr(13)+chr(10)+'This is a test: '+str(cntr,2)

i = serial_port(spWrite, s, size(s,'a'))

next

i = serial_port(spClose)

endif

msg 'done'


SetEnvironmentVarValue()

Navigation: Reference > Functions >

SetEnvironmentVarValue()

 Print this Topic Return to chapter overview

SETENV(1,2)

PURPOSE

Use this function to set or change an environment value, or to clear an existing value. You can also use the GETENV() function to read an environment value that you set with this function.

PARTS

1 f/c/e Required - The name of the environment variable.

2 f/c/e Required - The value you want the variable set to.

RETURN TYPE - L

If the environment variable is set properly the function returns .True. If not, it returns .False.

COMMENTS

If you don't pass an environment variable name, an error will be returned.

You can create new environment variables by setting the name with a value using this function. To clear, or eliminate an existing environment variable, the value you pass should be a blank string ('').

NOTE: Each time you load an executable program (an EXE file), a new environment is created for that program. This means you won't be able to use this means to pass information between two or more executable programs. However, you can use it to pass information between multiple RWN programs within a single runtime.


SetObjectPropertyValue()

Navigation: Reference > Functions >

SetObjectPropertyValue()

 Print this Topic Return to chapter overview

SET_OBJ_PROP(1,2,3,4)

PURPOSE

This function will allow you to update property values of objects on a form.

PARTS

1 f/c/e Required - The object name you want to access.

2 f/c/e Required - The property name of the object.

3 f/c/e Required - The new value for the property you want to change.

4 f/c/e Generally, you will be changing a property of an object on the current form. However, if you want to access a different form you would put that form's pointer value here. You can get this value by using the FORM_PTR() function.

RETURN TYPE - I

If the function executes correctly it will return 0. If there is no active form this will return 3. If the object is not found this will return 2. If the property is not found this will return 1.

SEE ALSO

SET_OBJECT


SetupPrinter()

Navigation: Reference > Functions >

SetupPrinter()

 Print this Topic Return to chapter overview

SETUP_PRINTER()

PURPOSE

This function displays a standard Windows printer setup dialog box.

NO OTHER PARTS

RETURN TYPE - A

Returns the name of the printer. If the receiving field is too short the returning value will be truncated.

NOTE: If the user presses the Cancel button the function will return a blank string.

COMMENTS

This will not set the default printer. It will only allow you to make changes to printers you have access to through your computer.

SEE ALSO

PRINTER_NAME()

EXAMPLE

define x type a size 250

x = SETUP_PRINTER()


Sign()

Navigation: Reference > Functions >

Sign()

 Print this Topic Return to chapter overview

SIGN(1)

PURPOSE

This function will return an N type value indicating the sign of the field value specified.

PARTS

1 f/c/e Required - N type field to check.

RETURN TYPE - N

If the value being checked is < 0 the returned value is -1.00.

If the value being checked is = 0 the returned value is 0.00.

If the value being checked is > 0 the returned value is 1.00.

EXAMPLE

define n type n size 6 dec 2

n = sign(-25.29)

// n = -1.00

n = sign(0.00)

// n = 0.00

n = sign(25.29)

// n = 1.00


Sine()

Navigation: Reference > Functions >

Sine()

 Print this Topic Return to chapter overview

SIN(1)

PURPOSE

This function returns the sine of the N type field specified.

PARTS

1 f/c/e Required - The N value.

RETURN TYPE - N

The value returned is in radians.

EXAMPLE

define n type n size 20 dec 8

n = sin(1.539)

// n = 0.9994954


SizeOf()

Navigation: Reference > Functions >

SizeOf()

 Print this Topic Return to chapter overview

SIZE(1,2)

PURPOSE

This function will return the size of a specified field.

PARTS

1 f/c/e Required - The field being checked.

2 f/c/e 'I' - Return the internal size. This is the default value.

'D' - Return the display size.

'A' - Return the actual size only if the field being checked is type A.

RETURN TYPE - R

EXAMPLE

define x type n size 12 dec 2

define y type r

x = 100.10

r = size(x,'i')

// r = 8

r = size(x,'d')

// r = 12

r = size(x,'a')

// r = 0

define y type a size 20

y = 'ABCD'

r = size(y,'i')

// r = 20

r = size(y,'d')

// r = 20

r = size(y,'a')

// r = 4


Soundex()

Navigation: Reference > Functions >

Soundex()

 Print this Topic Return to chapter overview

SNDX(1)

PURPOSE

This function returns a 4 character value representing the sound of the field. These values can be used in comparing fields (see the DIFF() function also).

PARTS

1 f/c/e Required - The A type field to be converted. The original value is unchanged.

RETURN TYPE - A

A 4 character string is returned.

EXAMPLE

define x type a size 4

x = SNDX('translate')

// x = 'T652'

x = SNDX('trnslt')

// x = 'T652'

x = SNDX('John')

// x = 'J500'

x = SNDX('Paul')

// x = 'P400'


SQL()

Navigation: Reference > Functions >

SQL()

 Print this Topic Return to chapter overview

SQL(1,2,3)

PURPOSE

Use this function to Read and Write SQL Data From your TAS Profesional Application.

PARTS

1 sac Required - What to do:

sqlOpenConnection - This is connection String to the Database

sqlQuery - Standard Query to the database.

sqlQueryForward – This creates a ForwardONLY Query to the database ( sqlmovefirst and sqlmoveprevious will not work)

sqlCloseRecordSet – Closes the Current Recordset/Query

sqlCloseConnection – Closes the Connection to the Database

sqlGetRecordCount – Get the current Record count for the Query

sqlExecute – Execute SQL Commands

sqlExecuteScalar – execute SQL Commands that Return a Single Value

sqlMoveFirst - Move the to the First Position in the Query

sqlMoveNext – Moves to the Next Position in the Query

sqlMovePrevious – Move to the Previous Position in the Query

sqlMoveLast – Move to the Last Position in the Query

sqlGetData – Retrieves the Data for a Field.

sqlBind - Binds fields to the query (Very useful also see Autobind).

sqlGetFieldCount – Give you the number for fields in your Query.

sqlGetFieldname – Give you the field name by position.

sqlGetFieldType - Gives you the field type (Alpha, Number Etc..)

sqlgetFieldSize - Gives you the field size.

sqlGetTableCount - Gives you the number of Non-System Tables.

sqlGetTableNames - Gives you the names of the tables in the SQL database.

sqlGetErrorCount – Get the Error Count

sqlGetError - Get the Error String

sqlGetNativeError - This gets the native error code from the sql database.

2 f/c/e Depends on the operation:

sqlCloseConnection - Connection Number (Default 0)

sqlOpenConnection - has the Connection String to the Server.

sqlQuery - The Query string to the server.

sqlQueryForward – same a sqlQuery

sqlCloserecordset – (optional) The number of the recordset/Query to close (note 1)

sqlGetRecordCount – (optional) the recordset to get the record count of (note 1)

sqlExecute – sql Statement to Execute

sqlExecuteScalar – Same as sqlExecute but returns a value

sqlMoveFirst,

sqlmoveNext,

sqlMovePrevious,

sqlMoveLast – (optional) AutoBindMode (enter sqlBind here and it will auto bind)

sqlGetData - string with SQL Field name to retrieve data from.

sqlBind ,

sqlgetFieldCount – (optional) number of the Query to use (note 1)

sqlGetFieldName – number of the field to return the name from.

sqlGetTableCount,

sqlGetTableNames,

sqlGetErrorCount – (optional) Connection number (Default 0)

sqlGetError - Error number (*)

sqlGetNativeError - Error number (*)

* These are a count like first error, second error, ETC.

3 f/c/e Depends on the operation:

sqlOpenConnection - (optional) Connection number (Default 0)

sqlQuery,

sqlQueryForward,

sqlMoveFirst,

sqlmoveNext,

sqlMovePrevious,

sqlMoveLast,

SqlGetData,

SqlGetFieldname - (optional) number of the Query to use (note 1)

sqlCloserecordset ,

sqlGetRecordCount,

sqlGetFieldCount,

sqlExecute,

sqlExecuteScalar,

sqlGetError – (optional) Connection number (Default 0)

sqlGetNativeError - (optional) Connection number (Default 0)

4 f/c/e Depends on the operation:

sqlQuery – (Optional) Connection number (Default 0)

RETURN TYPE - Varies

The return value depends on the option set in part 1.

sqlOpenConnection - L - Returns True if the Connection on process is successful and False if not.

sqlQuery sqlQueryforward - L - Returns True if the Query process is successful and False if not.

sqlCloseConnect – L – Returns True if the Connection is closed successful

sqlCloseRecordSet – L – Returns True if the Record set/Query is close successfully.

sqlGetRcordCount - I - Returns the number of Records in the Query.

sqlExecute – L – Returns True if the Process is Executed Correctly.

sqlExecuteScalar – A/N/I/R/D/T/L – Depends on the results Field

sqlMoveFirst,

sqlMovePrevous,

sqlMoveNext,

sqlMoveLast - L – Returns True is record has moved.(returns False if moved to beginning or End)

sqlGetData – A/N/I/R/D/T/L – Depends on the results Field

sqlBind – L – Return True..

sqlGetFieldCount - I - Returns the number of Field in the Recordset/Query.

sqlFieldName - A - returns the Field name.

sqlGetTableNames -A - Returns the Table name

SQLgetErrorCount - I - The numbers of Errors

sqlGetError - A - The ADO Error Descriptions.

dqlGetNativeError - I - the Native Error code from the Connected database.

NEW SQL Commands:

SQLBeginTrans :

Call BeginTrans to start a new transaction in the data store the ADO connection component is connected to.

BeginTrans returns a value of type integer, indicating the nesting level of the new transaction

SQLCommitTrans:

Call CommitTrans to save any changes made during the current transaction and to end the transaction.

SQLRollBackTrans

Call RollbackTrans to cancel any changes made during the current transaction and to end the transaction.

SQLInTrans

A transaction is will be active if the BeginTrans method has been called to initiate a transaction but that transaction has not either been consummated by calling CommitTrans or canceled by calling the RollbackTrans method. Use the InTransaction property to prevent calling BeginTrans when a transaction has already been initiated

SQLGetIsolation (Pass Level in Position 3)

Use IsolationLevel to specify the transaction isolation level for a connection. The transaction isolation level determines how a transaction interacts with other simultaneous transactions when they work with the same tables, and how much a transaction sees of the work performed by other transactions. The default value for IsolationLevel is ilCursorStability.

SQLSetIsolation

Read IsolationLevel after the transaction has been activated to determine the actual transaction isolation level used. It is possible that a server will force an isolation level other than that requested if the level requested is not supported.

Isolation TYPES

ilUnspecified Server is using a an isolation level other than what was requested and the specific isolation level cannot be determined.
ilChaos Changes from more highly isolated transactions cannot be overwritten by the current connection.
ilReadUncommitted Uncommitted changes in other transactions are visible.
ilBrowse Uncommitted changes in other transactions are visible.
ilCursorStability Changes from other transactions only visible after being committed.
ilReadCommitted Changes from other transactions only visible after being committed.

ilRepeatableRead Changes made in other transactions not visible, but requerying can retrieve new recordsets.
ilSerializable Transactions conducted in isolation from other transactions.
ilIsolated Transactions conducted in isolation from other transactions.

COMMENTS

NOTE: The special alpha constants above (sqlOpenConnection through sqlGetFieldCount) are defined in COMPILERCONSTANTS.TXT.

NOTE1: You can have up to 10 Different Query's to the Same database/Connection open Starting at 0 Which is also the default and not required.

NOTE2: This function available in version 7.2 build 4 and above.

NOTE3: If you want to use multiple record sets, you've got to use the third

parameter in the SQL command:

SQL(sqlQuery, sqlString, recordsetNumber) !!!

Example:

msg SQL(sqlQuery, "SELECT * FROM table1", 0) //First recordset

msg SQL(sqlQuery, "SELECT * FROM table2", 1) //2nd recordset

msg SQL(sqlGetRecordCount, 0)

msg SQL(sqlGetRecordCount, 1)

msg SQL(sqlCloseRecordSet, 0)

msg SQL(sqlCloseRecordSet, 1)

If you use SQL(sqlQuery,... ) without the third parameter Tas will use

the recordsetNumber = 0 as default and a 2nd record set will overwrite

the first.

Example 2:

borderid = sql(sqlgetdata,'OrderID',1)

prodcode = sql(sqlgetdata,'ProductID',1)

prodprice = sql(sqlgetdata,'UnitPrice',1)

//msg "Click for Next"

dummy_l=sql(sqlmovenext,sqlmoveNext,1) If you use more then one table this will work..

dummy_l=sql(sqlmovenext,1) This will not work same for other moving functions...

Pervasive SQL Notes

because Btrieve/Pervasive is one of the two native databases in TAS Professional As we find interesting things or problems we will try to document them here.

Using a date restriction in a WHERE clause does not return records even though the correct date seems to exist in table.

Problem Description:

Using a date restriction in a WHERE clause does not return records even though the correct date seems to exist in table.

Problem Environment:Pervasive.SQL V8

Pervasive.SQL 2000i

Pervasive.SQL ver 9 and 10

Pervasive OLEDB

ADO

Cause of this problem:

The problem may be that an incorrect date format is being used. Pervasive.SQL uses the date format based on ODBC 2.5 standards. The date format is YYYY-MM-DD.

Here is a function we used to correct the problem.

define sqldate type d size 8

define sqldateA type a size 10

func sql_date sqldate

sqldate1 = dtos(sqldate)

// year month day

sqldateA = MID(sqldate1,1,4) + '-' * MID(sqldate1,5,2)*'-' * MID(sqldate1,7,2)

//msg sqldateA

ret sqldateA

The above function will covert the date to YYYY-MM-DD format for use in your sql statement dealing with dates.

EXAMPLES

// Sample sql select statement

SQL_str = "Select * from BKARHINV_B " +\

" where BKAR_INV_INVCD <> 'V' "+\

" and '" *bkar.custcode* "' = bkar_inv_cuscod " +\

" and BKAR_INV_INVDTE >= '" * sql_date(fromdate) * "' "+\

" and BKAR_INV_INVDTE <= '" * sql_date(thrudate) * "' "+\

" and bkar_inv_slsp >= '" * frep *"' " +\

" and bkar_inv_slsp <= '" * trep *"' " +\

" Order By bkar_inv.cuscod , BKAR_INV_INVDTE "

SQL(sqlQuery, sql_Str, recordsetNumber) // This will query the above select Statment

Sql_find_first 0

while dummy_l = .t.

//do what ever you need to here.

Sql_Find_Next 0

endw

ret

// The sql_date() is documented above

See also SQL folder example included in TAS Professional Powered by CAS.

there are two examples there SQLTEST and SQLNORTHWINDWS

Ongoing

We are looking into the possibility of a SQL Statement Builder to be added to the IDE. Not sure when this feature will be available.

Sources for Connection strings.

www.connectionstrings.com

Sources for SQL Commands

www.sqlcommands.net

www.1keydata.com/sql/sql-commands.html

There are hundreds maybe thousands of sources for sql on the internet. We have only listed a few here.


SquareRoot()

Navigation: Reference > Functions >

SquareRoot()

 Print this Topic Return to chapter overview

SQRT(1)

PURPOSE

This function will return the square root of the value specified.

PARTS

1 f/c/e Required - The value to use. Must be of N type.

RETURN TYPE - N

EXAMPLE

define x type n size 6 dec 3

x = sqrt(4)

// x = 2.000

x = sqrt(99.325)

// x = 9.966


StatusBar()

Navigation: Reference > Functions >

StatusBar()

 Print this Topic Return to chapter overview

STATUS_BAR(1,2,3)

PURPOSE

Use this function to get or set the text value of a panel in a TStatusBar object on the current form.

PARTS

1 f/c/e Required - The object name. This would be the value in the Name field that is a part of each object.

2 f/c/e Required - The panel number. The first panel is number 1.

3 f/c/e The text value to be put into the panel. If this option is not specified the text that is currently in that panel will not be changed. In this case the function will only return the value currently in that panel.

RETURN TYPE - A

Returns the current text value in the panel specified. If the receiving field is too short the returning value will be truncated.

COMMENTS

If the function can't find the object then it will return the string: "Object Not Found."

EXAMPLE

define status_txt type A size 80

startus_txt = statusbar('StatusBar1', 5 ,'This text will be displayed in panel # 5')


StringLoc()

Navigation: Reference > Functions >

StringLoc()

 Print this Topic Return to chapter overview

LOC(1,2,3,4,5)

PURPOSE

This is an instring function. It will return the location of a string of characters (A type field) within another A type field.

PARTS

1 f/c/e Required - Field to check for, must be A type.

2 f/c/e Required - Field to check within, must be A type.

3 f/c/e The character position where the function will start checking. The first position (far left) is 1. If this value isn't provided the default value is 1.

4 f/c/e The number of characters to check. If this value isn't provided the function will check the entire field (part 2).

5 f/c/e If this is set to Y, the function will ignore differences in case (upper or lower). Default is N.

RETURN TYPE - I

The first character position of the matched field. If no match is found the return is 0.

COMMENTS

If you are using a field as the search for value (part 1) make sure that you TRIM() the value first. This can be done within the LOC(). If you don't, the function will try to match all trailing spaces. Obviously, if you are looking for the exact match, spaces and all, don't TRIM() it.

SEE ALSO

ELOC()

EXAMPLE

define x type i

define s type a size 20

s = 'ABCDEFGHCDIJ'

x = LOC('CD',s)

// x = 3

x = LOC('CD',s,4,5)

// x = 0

define srch_fld type a size 10

srch_fld='CD'

// make sure you trim srch_fld since the # of chars

// you're looking for is less than the size of the field.

x = LOC(trim(srch_fld,'t'),s)

// x = 3


StringList()

Navigation: Reference > Functions >

StringList()

 Print this Topic Return to chapter overview

STRINGS(1,2,3,4,5)

PURPOSE

This function will manipulate a TStrings or TStringList property in a form object.

PARTS

1 f/c/e Required - The object name on the current form.

2 f/c/e Required - The property name, generally 'Lines' or 'Items'.

3 sac Required - What to do:

stCount - Return the number of lines in the list.

stGetLine - Get a specific line in the list.

stGetText - Get all the lines in the list and return as a single string.
stSetLine - Replace a current line in the list.
stSetText - Replace all the lines in the list using a single string. The lines should be divided by cr/lf pairs at the end of each line.
stClear - Remove all the lines from the list. The count will be reset to 0.
stAddLine - Add a new line to the end of the list.
stDelLine - Delete a specific line from the list.
stInsLine - Insert a new line into a specific location.
stLoad - Load a set of lines from a file on the disk.
stSave - Save a set of lines to a file on the disk.
stSort - Sort the lines into ascending order. NOTE: This works only for TStringList properties.
stFind - Find a line based on the line's value. NOTE: This works only for TStringList properties. Also the list must be sorted (see stSort above) or you will not find the correct line.

StLocate - Finds a line based on the line's value without being sorted.

4 f/c/e This part depends on the option specified in part 3.

stSetLine - Required - This is the string you want to use to replace a current line.

stSetText - Required - This is the string you want to use to replace all the lines.

stAddLine - Required - This is the string you want to add at the end of the list.

stInsLine - Required - This is the string you want to insert into the list.

stLoad or stSave - Required - This is the name of the file you want to use, must include complete path.

stFind - Required - This is the value you want to search for.

NOTE: In options stGetLine and stDelLine you must put a place keeping comma since part 5 is required for those but part 4 is not.

5 f/c/e This part depends on the option specified in part 3.

stGetLine - Required - The line number you want to retrieve.

stSetLine - Required - The line number you want to replace.

stDelLine - Required - The line number you want to delete.

stInsLine - Required - The line number you want to insert at. This means that this line and all others after this line will be moved down one and the value in part 4 will be inserted into this position.

RETURN TYPE - Varies

The return value depends on the option set in part 3.

stCount - I - Returns the number of lines in the list.

stGetLine - A - Returns the line value.

stGetText - A - Returns the string with all the lines.

stSetLine - I - Returns the number of lines in the list.

stSetText - I - Returns the new number of lines in the list.

stClear - I - Returns the new number of lines in the list. Should be 0.

stAddLine - I - Returns the new number of lines in the list.

stDelLine - I - Returns the new number of lines in the list.

stLoad - I - Returns the new number of lines in the list.

stSave - L - Returns .T. if the file was saved, .F. if not.

stSort - L - Returns .T. if the list was sorted, .F. if not.

stFind - I - Returns the line number of the string if found. If it isn't the function will return 0.

COMMENTS

Several objects have either TStrings or TStringList as properties. These include TTASComboBox, TMemo and the non-visual object TTASStrList. The only way to manipulate those properties is through this function.

See Also GFLD(1,2,3,4)

NOTE: The special alpha constants above (stCount through stFind) are defined in COMPILERCONSTANTS.TXT.

Here is sample of using stringlist() to find a delete duplicate records in a codebase type file.

// you would place a TASstringlist on your form called slFileData'

define lCntr,aCntr type R size 10

define BoxCount_hndl type I size 5

define BoxMachHldr type A size 20

define PrcssLine type A size 30

define RecNum type R size 10

define ok type L

btn_del_dupe.click:

lcntr = strings('slFileData','lines',stClear) //Need to clear first..

lCntr = 0

scan @BoxCount_hndl key box_code start '' //reads out data into the stringlist

lCntr = strings('slFileData','lines',stAddLine,box_code+machine_id+str(rcn(BoxCount_hndl),10,0))

ends

if lCntr > 0 // Necessary. If no lines exist in the stringlist the next command would throw an error

Ok = strings('slFileData','lines',stSort)

PrcssLine = strings('slFileData','lines',stGetLine,,1)

BoxMachHldr = mid(PrcssLine,1,20)

for(aCntr;2;lCntr;1)

PrcssLine = strings('slFileData','lines',stGetLine,,aCntr)

if mid(PrcssLine,1,20) = BoxMachHldr

RecNum = val(mid(PrcssLine,21,10))

RCN @BoxCount_hndl rcn RecNum Set

del @BoxCount_hndl nocnf

else

BoxMachHldr = mid(PrcssLine,1,20)

endif

next

endif

ret


StringLocStartAtEnd()

Navigation: Reference > Functions >

StringLocStartAtEnd()

 Print this Topic Return to chapter overview

ELOC(1,2,3,4,5)

PURPOSE

This is an instring function. It will return the location of a string of characters (A type field) within another A type field, starting at the end of the field and working towards the beginning.

PARTS

1 f/c/e Required - Field to check for, must be A type.

2 f/c/e Required - Field to check within, must be A type.

3 f/c/e The character position to start checking at. The first position (far left) is 1. If this isn't provided the default value is the end of the field.

4 f/c/e The number of characters to check. If this isn't provided the function will check the entire field (part 2).

5 f/c/e If this is set to Y, the function will ignore differences in case (upper or lower). Default is N.

RETURN TYPE - I

The first character position of the matched field. If no match is found the value returned is 0.

SEE ALSO

LOC()

EXAMPLE

define x type i

define s type a size 20

s = 'ABCDEFGHCDIJ'

x = ELOC('CD',x)

// x = 9

x = ELOC('CD',x,3)

// x = 3

define srch_fld type a size 10

srch_fld='CD'

// make sure you trim srch_fld since the # of chars

// you're looking for is less than the size of the field.

x = ELOC(trim(srch_fld,'t'),s)

// x = 9


StringPortion()

Navigation: Reference > Functions >

StringPortion()

 Print this Topic Return to chapter overview

MID(1,2,3)

PURPOSE

This function will return a portion of a specified A type field.

PARTS

1 f/c/e Required - The value to be parsed.

2 f/c/e The starting character position. The first character of an A type field is position 1. The default value is 1.

3 f/c/e Required - The number of characters to return. If the value given would go beyond the end of the original field, only those characters up to the end of the field will be passed.

RETURN TYPE - A

If the receiving field is too short, the remaining characters will be truncated.

SEE ALSO

MID_REC()

EXAMPLE

define x,y type a size 20

x = 'ABCDEFG'

y = MID(x,2,2)

// y = 'BC'

y = MID(x,6,10)

// y = 'FG'


Tangent()

Navigation: Reference > Functions >

Tangent()

 Print this Topic Return to chapter overview

TAN(1)

PURPOSE

This function returns the tangent of the N type field specified.

PARTS

1 f/c/e The N value.

RETURN TYPE - N

The return value is in radians.

EXAMPLE

define x type n size 12 dec 8

x = tan(1.539)

// x = 31.43957419


TasPath()

Navigation: Reference > Functions >

TasPath()

 Print this Topic Return to chapter overview

TPATH()

PURPOSE

This function will return the path value as set in the TASPRO.INI file. Under the [Setup] heading in the TASPRO.INI file the option of TPath=

NO OTHER PARTS

RETURN TYPE

A

SEE ALSO

DPATH(), CPATH(), XPATH(), GET_INI_PATH()

EXAMPLE

define x type a size 255

x = tpath()

(* x would now contain a value similar to:

'C:\Advanced Accounting 7\' *)


TextWidth()

Navigation: Reference > Functions >

TextWidth()

 Print this Topic Return to chapter overview

TEXT_WIDTH(1,2,3)

PURPOSE

This function will return the approximate size of a specified string in pixels.

PARTS

1 f/c/e The string to use. If you don't specify a value here you must give the number of characters in part 2.

2 f/c/e The number of characters in the string. If you don't specify a string in part 1 then this is required.

3 f/c/e If you don't specify a string in part 1 this is the character that will be used internally to make up the string. If you don't specify a value here the program will automatically use the letter 'X'.

RETURN TYPE - I

This will be the approximate number of pixels the string will take to display in its entirety on your monitor.

COMMENTS

This function uses the font of the current form. If the object you're testing this for uses a different font, or if you change the font on the form at some later time, the value previously returned will probably be incorrect. Also, this is only a approximation. If the user enters a series of Cs or other large character the number of pixels returned by this function may not be enough unless you used that same string in part 1.

This is not a widely used function but we use something similar in trying to approximate the size of entry or printing fields when you're designing your forms or reports.


TLLFunctionCall()

Navigation: Reference > Functions >

TLLFunctionCall()

 Print this Topic Return to chapter overview

TLLFC(1,2,...)

PURPOSE

This function allows you to make a function call directly into a previously loaded TLL without having to use the RESET_FIELD() function first.

PARTS

1 f/c/e Required - The program number returned in the LOAD_PRG() function.

2 f/c/e Required - The name of the function within the TLL.

3-9 f/c/e If you want to pass values to the UDF they would be placed here. You are limited to 7 values that can be passed.

RETURN TYPE - Any

The return value is dependent on the UDF called. If the TLL is not found, or the function is not found then the return type will be L (logical) and the value will be False.

COMMENTS

This function makes use of TLLs very simple. Within the TLL you should make your routines UDFs. Then you can call the function in the TLL with this function call. The number of values you pass is flexible and can be up to 7. Any value can be returned.

NOTE: If you call a TLL using this function you will not be able to call a UDC (CMD) within the TLL. You can call a UDF, however. This does not effect the calling program, just the TLL you are calling. All other commands and functions should work as normal.

EXAMPLE

A sample program is included with the distribution that shows loading a TLL, calling a UDF, and removing the TLL. The main program is TLLDEMO1 and the TLL itself is TLLDEMO2.

SEE ALSO

CALL_PRG()


TrimField()

Navigation: Reference > Functions >

TrimField()

 Print this Topic Return to chapter overview

TRIM(1,2)

PURPOSE

This function will return an A type field with the leading or trailing spaces deleted.

PARTS

1 f/c/e Required - The value to be trimmed. The original field is not changed.

2 f/c/e 'T' - trim trailing spaces; this is the default value.

'L' - trim leading spaces.

RETURN TYPE - A

If the receiving field is not long enough, the remaining characters will be truncated.

COMMENTS

You would use this function when concatenating (adding) A type fields together. If the spaces aren't trimmed, there will probably be extra spaces in the resulting value. This function can get rid of them. You can also use the '*' when concatenating the fields. For more information please see Mathmatical Operators.


Ttoc()

Navigation: Reference > Functions >

Ttoc()

 Print this Topic Return to chapter overview

TTOC(1)

PURPOSE

This function will convert a time (type T) value to a string (type A).

PARTS

1 f/c/e The time value to use. The original field is left unchanged.

RETURN TYPE

A

If the receiving field is not long enough the remaining characters will be truncated.

Example

define text type a size 15

text = ttoc(time())

// text =

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


Ttof()

Navigation: Reference > Functions >

Ttof()

 Print this Topic Return to chapter overview

TTOF(1)

PURPOSE

This function will convert a time (type T) value to a numeric (type N) value.

PARTS

1 f/c/e The time value to use. The original field is left unchanged.

RETURN TYPE

N

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


Ttor()

Navigation: Reference > Functions >

Ttor()

 Print this Topic Return to chapter overview

TTOR(1)

PURPOSE

This function will convert a time (type T) value to a record/long integer (type R) value.

PARTS

1 f/c/e The time value to use. The original field is left unchanged.

RETURN TYPE

R

SEE ALSO

DATE() Convert to time CTOT() TIME GET SET Convert time to record TTOR() Covert time to number TTOF() Convert time to string TTOC()

TIME() YEAR() Date Command Date to Record DTOR() Convert date to Character DTOC() Days in month DAY_IN_MONTH

Increment the Month INC_MONTH DayMonthyear DMY() Month Day Year MDY()

Convert to Date CTOD() Charicter of month CMNTH() Charicter to day of week CDOW()


UpcaseField()

Navigation: Reference > Functions >

UpcaseField()

 Print this Topic Return to chapter overview

UP(1)

PURPOSE

This function returns the string value (type A) specified in upper case characters.

PARTS

1 f/c/e Required - The value to use. The original value remains unchanged.

RETURN TYPE - A

If the receiving field is too short, the remaining characters will be truncated.

SEE ALSO

LOW(), PROP()

EXAMPLE

define x type a size 10

x = up('abcdEFG')

// x = 'ABCDEFG'


UseCodeBase()

Navigation: Reference > Functions >

UseCodeBase()

 Print this Topic Return to chapter overview

USECODEBASE()

PURPOSE

This will return the value of the Use CodeBase flag you have set in the Set Configuration (TP7SETUP.EXE) program.

NO OTHER PARTS

RETURN TYPE - L

If the Use CodeBase flag is set this function will return .True.


Val()

Navigation: Reference > Functions >

Val()

 Print this Topic Return to chapter overview

VAL(1)

PURPOSE

This function converts a string value (type A) to a numeric value (type N).

PARTS

1. f/c/e The value to be converted. The original value remains unchanged.

RETURN TYPE

N - Numeric

EXAMPLE

msg val('100.2')

100.20

msg val('abcd')

0.00


ValidCheck()

Navigation: Reference > Functions >

ValidCheck()

 Print this Topic Return to chapter overview

VALID_CHECK()

PURPOSE

This function will evaluate any ValidExpr properties in all of the objects on the current screen form.

NO OTHER PARTS

RETURN TYPE - L

If any ValidExpr evaluates to False this function will return False, otherwise it will return True.

COMMENTS

During the check process the program will scan through the current active screen for any object that has a ValidExpr property that is not blank. When it finds one it resolves the expression. If the expression returns True it continues on to the next object until all have been tested. If the expression evaluates to False it exits the test and returns False to this function. In normal process you would exit the subroutine you're running and allow the user to fix the problem.

It doesn't matter how many ValidExpr's there are in the screen form. It will continue to check each one until they all return True. This feature allows you to add or remove checks without having to worry about changing your code. You do have to remember to recompile the program to include (or remove) valid expressions.

NOTE: If you want to check the ValidExpr's in a TTASDataGrid you must use the GRID_VALID_CHECK() function instead of this.

EXAMPLE

In the tutorial that is part of TAS Professional an example is provided of this process. The ValidExpr for the Order Number is: SONumber<>0. The VALID_CHECK() function is part of the save routine and is as follows:

navSO.save:

if .not. valid_check() then ret false

custcode = socustcode

save @cust_hndl nocnf

ret true

If the VALID_CHECK() function returns False the save subroutine returns False also and neither the SALES or CUSTOMER record is saved.


Version()

Navigation: Reference > Functions >

Version()

 Print this Topic Return to chapter overview

VER(1)

PURPOSE

This function will return the current TAS Professional name and version number.

PARTS

1. f/c/e If you want to return the current version number, this value should resolve to N.

R - Pervasive Requester version

L - Pervasive Local Engine

S - Pervasive Sever Engine (if Exists)

B - All the Above

C - CodeBase Version.

RETURN TYPE - A

EXAMPLE

define x type a size 15

x = ver()

// x = 'TAS Professional For Windows'

x = ver('N')

// x = '7.2 Build X.x'

NOTE:This Function has been enhansed to return more information as neded after version 7.2 Build 2


X_Charge()

Navigation: Reference > Functions >

X_Charge()

 Print this Topic Return to chapter overview

X_CHARGE(1,2,3,4,5,6,7,8)

PURPOSE

This function is to Interface the X-charge Credit Card system. To use this function will require a third party program & services provided by X-Charge credit card processing software Copyright 2005 CAM Commerce Solutions, Inc.

If you want to implement Credit card processing in your Tas Professional program please contact Computer Accounting Solutions and we will get you and your customers setup using this function. Also when your customers sign up to use X change they will provided hardware to capture credit card information for this process. Call 928-257-1236. Credit Card processing services from X Change are limited to only the United States. This is an easy way to provide credit card processing for your applications.

PARTS

1. sac Required - What to do:

xSetup - Setup Routine for the X-Charge system

xSubmitCC – Submit Credit card

xSubmitDebit - Submit Debit Card

xResponce - Check for Response

xVoidCC - Voids Credit Card Transaction.

xCreditReturn - Credit Return

xVoidReturn - Void of Return

xForceSale - Force Sale

xPreAuth - Pre Authorize of Sale

xDebitReturn - Debit Return

xGuarDL - Check Guarantee with Driver license

xGuarMirc - Check Guarantee with Mirc Code

xReport - Processing Report.

pPInitalize - Initialize the Pin Pad Device (no Parameters)

pPConfig - Configure the Pin Pad Device (no Parameters) Note: Put up Configuration Dialog box

pPPrompt - Prompt the Pin Pad Device

pPClose - Close the Pin Pad Device (no Parameters)

pPDisplaytext - Display Text on Pin Pad Device

pPDisplayLogo - Display Logo on Pin pad Device (if compatible)

pPPromptSignature - Prompt Signature on Pin Pad Device

2. f/c/e

xSetup – Optional - Folder for x-charge transaction folder Note: this can also be stored in the taspro.ini file.

xSubmitCC,

xSubmitDebit,

xCreditReturn,

xDebitReturn,

xVoidReturn,

xForceSale, - Account code (in Alpha)

xReponce - Optional – XNoWait - If Used the Response will not wait for a response but only check and return (otherwise the system will wait for a response from The X-charge system)

xGuarDL,

xGuarMirc – Amount (as Alpha)

xReport - Report type : CCTOTAL,TRANTOTALS, or TRANDETAILS

ppPrompt – Debit Card number (alpha)

ppDisplaytest – Text to Displayed

ppPromptSignature – Text to Display with Signature request.

3. f/c/e .

xSubmitCC,

xSubmitDebit,

xCreditReturn,

xDebitReturn,

xVoidReturn,

xForceSale, - Expiration Date(in Alpha)

Note: In as Scanned transition add the Scan data.

xGuarDL,

xGuarMicr - Customer name

xReport - Start date for report (MM/DD/YY)

ppPrompt – Amount of transaction (alpha)

4. f/c/e

xSubmitCC,

xSubmitDebit,

xCreditReturn,

xDebitReturn,

xVoidReturn,

xForceSale, - Amount to charge (in Alpha)

xGuarDL - Drivers license Number

xGuarMicr - ABA #

xReport - End Date for report (MM/DD/YY)

5. f/c/e

xSubmitCC,

xSubmitDebit,

xCreditReturn,

xDebitReturn,

xVoidReturn,

xForceSale, - Invoice/reference number (in Alpha)

xGuarDL,

xGuarMicr -Optional - Clerk (alpha 20)

xReport - Clerk (Alpha 20)

6. f/c/e

xSubmitCC,

xSubmitDebit,

xCreditReturn,

xDebitReturn,

xVoidReturn,

xForceSale, - CCV Code(in Alpha)

Note : CCV Code is only if not scanned.

xGuarDL - State – 2 character Abbreviation

xGuarMicr - Account Number

xReport - Group by – options : CCENTRY, CLERK, or REGISTER

7. f/c/e

xSubmitCC,

xSubmitDebit,

xCreditReturn,

xDebitReturn,

xVoidReturn,

xForceSale, - As the Address (in Alpha)

Note: Address is only required is not scanned

xGuarDL - Date of Birth (an Alpha in the format of MM/DD/YY)

xGuarMicr - Check number (alpha 6)

xReport - String container class (Note: This needs to be a TASString or memo )

8. f/c/e

xSubmitCC,

xSubmitDebit,

xCreditReturn,

xDebitReturn,

xVoidReturn,

xForceSale, - Zip Code (in Alpha)

Note: Zip Code is only required is not scanned

xGuarDL - Check Number (Alpha)

xReport - String Container Class Object (Lines or stings)

RETURN TYPE – Varies

xSubmitCC,

xSubmitDebit,

xCreditReturn,

xDebitReturn,

xVoidReturn,

xForceSale, - Logical – False if Processing file can not be created.

xReponce – Authentication String (or Error Code)

xGuarDL,

xGuarMicr - Logical - False if Processing file can not be created (use xReponce for Auth code)

ppInitalize - Logical – False if Can’t initialize the the pin pad Device.

ppConfig - Alpha – Description of Error.

ppPrompt - Alpha - Pin key and Pin Block Separated with ‘[‘ and ‘]’

ppClose – Alpha – Description of Error.

ppDisplayText – Alpha – Description of Error.

ppDisplayLogo – Alpha – Description of Error.

ppPromptSignature – Alpha – Bit map of the Signature (Not Tested)

COMMENTS

NOTE: The special alpha constants above (Xnowait, xSetup, xSubmitCC, xResponce, xSubmitDebit, XVoidCC, XCreditReturn, XVoidReturn, XForceSale, XPreAuth, XDebitReturn, XGuarDL, ,XGuarMirc, XReport, PPInitalize, PPConfig, PPPrompt, PPClose, PPDisplaytext, PPDisplayLogo, and PPPromptSignature,) are defined in COMPILERCONSTANTS.TXT.

NOTE: If you use this feature and integrate your software to use X-Charge for your customers. Computer Accounting solutions will split the X-Change commissions with you 50/50 and give you support for free and an unlimited runtime LIC for TAS Professional 7 making this a win win for both developers. Just think real residual income. Making this a win win for both CAS and you the developer. See: www.cassoftwarex.com for more details.

EXAMPLE

See CreditCard.src and CreditCard.DFM


Year()

Navigation: Reference > Functions >

Year()

 Print this Topic Return to chapter overview

YEAR(1)

PURPOSE

This function returns the year of a date value (type D) as a string (type A).

PARTS

1. f/c/e Required - The date value to use.

RETURN TYPE - A

This function returns a 4 character string.

EXAMPLE

define x type a size 4

x = year(date())

// x = '2010'


General Information

Navigation: Reference > Structured Programming Commands >

General Information: Structured Programming Commands

 Print this Topic Return to chapter overview

There are five different structures that can be used within a program. Each one is a little different and would be used in specific situations. Often the decision to use a specific structure is strictly due to your likes or dislikes.

In the examples given below, the beginning and ending lines of the structure are given, and the possible loop options are shown within the structure. There is no requirement to use any of the 'intrastructure' options; however, the beginning and ending commands are required to form the structure properly. Each structure type can be nested up to 20 deep. For example:

IF x = y

IF z = 1

IF q = 1 .AND. test = 'abc'

... etc. till there are 20 IF/ENDIF pairs

ENDIF

ENDIF

ENDIF

You can insert other structure types, and those other structures will not count towards the 20 total. The indentations above are just for example only and are not required.


FOR/NEXT

Navigation: Reference > Structured Programming Commands >

FOR/NEXT

 Print this Topic Return to chapter overview

This is a loop that will continue until the stop level is reached. The general layout of the structure is :

FOR(counter;start_value;stop_value;step_value)

FEXIT

FEXIT_IF lexpr

FLOOP

FLOOP_IF lexpr

NEXT

FOR(counter;start_value;stop_value;step_value)

There are four different sections to this command. They are the counter field, a starting value, a stop value and a step value.

counter The name of the field used as a loop counter. The counter can be I or R type.

start_value The first value to be used in the loop. The counter field is initialized to this value the first time through.

stop_value When the counter reaches this value the program knows to exit the loop at the NEXT command.

step_value How much to add or subtract from counter each time through the loop. If you wish to subtract from counter (i.e., decrement), precede the value with the minus sign. For example, a step_value of -1 will reduce the counter value by 1 each time the loop is executed.

Each time through the loop (except the first time) the program adds (or subtracts if step_value is negative) the step_value. If the result is greater than the stop_value (in the case of a positive step_value) or less than the stop_value (in the case of a negative step_value), the program will transfer control to the line after the appropriate NEXT command.

FEXIT

FEXIT_IF lexpr

These elements of the FOR/NEXT loop will allow you to exit the loop before the counter reaches the stop_value. The FEXIT option exits the loop immediately. The FEXIT_IF lexpr will exit the loop if the expression resolves to .TRUE.; otherwise nothing will happen. The lexpr must be in the form of a comparison expression. For example:

FEXIT_IF x = 1

The FEXIT and FEXIT_IF (assuming the lexpr resolves to .TRUE.) will transfer control to the next line after the NEXT command.

As many FEXIT and FEXIT_IF commands may be included in a single FOR/NEXT loop as the programmer desires.

FLOOP

FLOOP_IF lexpr

These elements of the FOR/NEXT loop will allow the program to transfer control to the beginning of the loop (FOR command) without having to reach the NEXT command. The FLOOP option transfers control immediately. The FLOOP_IF lexpr will transfer control if the expression resolves to .TRUE.; otherwise nothing will happen. The lexpr must be in the form of a comparison expression. For example:

FLOOP_IF x = 1

As many FLOOP and FLOOP_IF commands may be included in a single FOR/NEXT loop as the programmer desires.

NEXT This is the final step in the FOR/NEXT loop. When this command is executed control is returned to the FOR command line. Each FOR must have a NEXT to finish the loop. If the NEXT is not included an error message will be displayed during compilation.


IF/ENDIF

Navigation: Reference > Structured Programming Commands >

IF/ENDIF

 Print this Topic Return to chapter overview

This is a non-loop structure. Each item is only tested once. The general layout of the structure is:

IF lexpr

ELSE_IF lexpr

ELSE

ENDIF

IF lexpr This is the beginning of the IF/ENDIF structure. The lexpr must be in the form of a comparison expression. For example:

IF x = 1

If the lexpr returns .TRUE., the lines after the IF command and continuing until the next ELSE_IF, ELSE or ENDIF command will be executed. Otherwise control will be passed to the next subsequent ELSE_IF, ELSE, or ENDIF command.

ELSE_IF lexpr If the original IF or a previous ELSE_IF comparison expression returned .FALSE., the program will keep testing each subsequent ELSE_IF command until one is found that returns .TRUE. or until an ELSE command is found, or the appropriate ENDIF command is found. If the ELSE_IF lexpr returns .T., the lines after the command will be executed until the next ELSE_IF, ELSE, or ENDIF command.

There can be any number of ELSE_IF commands within an IF/ENDIF structure. However, only one will be executed, and that will be the first one for which the lexpr resolves to .TRUE. Once the program lines have been executed, control is transferred to the appropriate ENDIF command.

ELSE If the original IF and the previous ELSE_IF commands all resolved to .FALSE., the program will always execute the lines after this command and until the ENDIF. This is a way of providing for actions to be taken if all the other IF tests have failed.

ENDIF This is the end of the IF/ENDIF structure. Each IF must have an ENDIF to finish the structure. If the ENDIF is not included an error message will be displayed during compilation.

EXAMPLE

The following example shows the proper way to use this structure:

IF X = 100

...

... && group 1

...

ELSE_IF X = 200

...

... && group 2

...

ELSE_IF X = 300

...

... && group 3

...

ELSE

...

... && group 4

...

ENDIF

(The indentations are for clarity only.) In the example above if x = 100 the lines in group 1 will be executed, if x = 200 group 2, and if x = 300 group 3. Otherwise the command lines in group 4 will be executed.


SELECT

Navigation: Reference > Structured Programming Commands >

SELECT

 Print this Topic Return to chapter overview

This is a non-loop structure. Each item is only tested once. The general layout of the structure is:

SELECT expression

CASE int_value

CASE int_value

...

CASE int_value

OTHERWISE

ENDC

SELECT expression

This is the beginning of the Case structure. The expression must resolve to an I type value. The value will be used in comparisons by the individual CASE commands.

This command is generally used in menu type situations where there is a list of options.

CASE int_value

This part represents the choice in the SELECT structure. The int_value must be in the form of an I type constant. For example:

CASE 1

If the int_value matches the value generated by the appropriate SELECT expression, the lines after the CASE command and continuing until the next CASE, OTHERWISE or ENDC command will be executed. Otherwise control will be passed to the next subsequent CASE, OTHERWISE, or ENDC command.

There can be any number of CASE commands within a SELECT/CASE/ENDC structure. However, only one will be executed, and that will be the first one for which the int_value matches the value in the SELECT expression.

OTHERWISE

If none of the previous CASE values match that in the SELECT command, the program will always execute the lines between this OTHERWISE and the ENDC. This is much like the ELSE option within an IF/ENDIF structure.

ENDC

This is the end of the SELECT/CASE/ENDC structure. Each SELECT must have an ENDC to finish the structure. If the ENDC is not included an error message will be displayed during compilation.

EXAMPLE

The following example shows the proper way to use this structure:

SELECT counter && counter might be a value received from a menu.

CASE 1

...

... && group 1

...

CASE 2

...

... && group 2

...

CASE 3

...

... && group 3

...

OTHERWISE

...

... && group 4

...

ENDC

(The indentations are for clarity only.) In the example above if counter = 1 the lines in group 1 will be executed, if counter = 2 group 2, and if counter = 3 group 3. Otherwise the command lines in group 4 will be executed.


SCAN/ENDS

Navigation: Reference > Structured Programming Commands >

SCAN/ENDS

 Print this Topic Return to chapter overview

This structure is a specialized type of loop. The SCAN command combines a FIND command with a WHILE loop. You can specify the file, key, starting value, scope, and for/while filters for the file searches. The first time the SCAN command is executed, the first appropriate record will be read. If there is a start value, the record will be found. If there isn't the program will start with the record in memory, find the first record in the file or do whatever else the programmer has specified as determined by the settings of the various options. Then, each time through the loop, the program will find the next record that matches the criteria of the different options. When the last record is found the program will transfer control to the line immediately after the ENDS command. When dealing with searches through files, SCAN/ENDS will probably become your most widely used command(s). With the FOR and WHILE filters you have absolute control over the records that are active within the loop. Any TAS Professional command may be used within the loop. The general layout of the structure is:

SCAN options

SEXIT

SEXIT_IF lexpr

SLOOP

SLOOP_IF lexpr

ENDS

SCAN To see all the options available for this command, click here.

SEXIT

SEXIT_IF lexpr

These elements of the SCAN/ENDS loop will allow you to exit the loop. The SEXIT option exits the loop immediately. The SEXIT_IF lexpr will exit the loop if the expression resolves to .TRUE.; otherwise nothing will happen. The lexpr must be in the form of a comparison expression. For example:

SEXIT_IF x = 1

The SEXIT and SEXIT_IF (assuming the lexpr resolves to .TRUE.) will transfer control to the next line after the ENDS command.

As many SEXIT and SEXIT_IF commands may be included in a single SCAN/ENDS loop as you desire.

SLOOP

SLOOP_IF lexpr

These elements of the SCAN/ENDS loop will allow you to transfer control to the beginning of the loop (SCAN command) without having to reach the ENDS command. The SLOOP option transfers control immediately. The SLOOP_IF lexpr will transfer control if the expression resolves to .TRUE.; otherwise nothing will happen. The lexpr must be in the form of a comparison expression. For example:

SLOOP_IF x = 1

The SCAN comparison expression is executed and then, if the expression resolves to .TRUE., the loop will continue.

As many SLOOP, SLOOP_IF commands may be included in a single SCAN/ENDS loop as you desire.

ENDS This is the final step in the SCAN/ENDS loop. When this command is executed, control is returned to the SCAN command line. Each SCAN must have an ENDS to finish the loop. If the ENDS is not included an error message will be displayed during compilation.

EXAMPLE

A very good example of the SCAN loop is in the Tutorial in PART 4 - CREATING A TAS Professional REPORT. In the first report sample a very simple SCAN/ENDS loop is created to output the data from the CUSTOMER file. It looks like this:

scan @cust_hndl key custcode

output_report_data rb_num 1

ends


WHILE/ENDW

Navigation: Reference > Structured Programming Commands >

WHILE/ENDW

 Print this Topic Return to chapter overview

This structure is a loop that will continue until the WHILE lexpr returns .FALSE or the loop is exited. The general layout of the structure is :

WHILE lexpr

EXIT

EXIT_IF lexpr

LOOP

LOOP_IF lexpr

ENDW

WHILE lexpr

The lexpr in this command must be in the form of a comparison expression. For example:

WHILE x = 1

If this expression resolves to .TRUE., the line after the WHILE command will be executed; otherwise control will be transferred to the line after the ENDW command. This expression is checked each time the loop is executed.

The programmer can stay in the loop until an EXIT or EXIT_IF command is executed by making sure this command will always return .TRUE. This can be accomplished easily by the following:

WHILE .TRUE.

If an EXIT or EXIT_IF command is never executed the loop will continue on and will never quit. (Unless, of course, an error occurs.)

EXIT

EXIT_IF lexpr

These elements of the WHILE/ENDW loop will allow you to exit the loop. The EXIT option exits the loop immediately. The EXIT_IF lexpr will exit the loop if the expression resolves to .TRUE.; otherwise nothing will happen. The lexpr must be in the form of a comparison expression. For example:

EXIT_IF x = 1

The EXIT and EXIT_IF (assuming the lexpr resolves to .TRUE.) will transfer control to the next line after the ENDW command.

As many EXIT and EXIT_IF commands may be included in a single WHILE/ENDW loop as you desire.

LOOP

LOOP_IF lexpr

These elements of the WHILE/ENDW loop will allow you to transfer control to the beginning of the loop (WHILE command) without having to reach the ENDW command. The LOOP option transfers control immediately. The LOOP_IF lexpr will transfer control if the expression resolves to .TRUE.; otherwise nothing will happen. The lexpr must be in the form of a comparison expression. For example:

LOOP_IF x = 1

The WHILE comparison expression is executed and then, if the expression resolves to .TRUE., the loop will continue.

As many LOOP, LOOP_IF commands may be included in a single WHILE/ENDW loop as you desire.

ENDW This is the final step in the WHILE/END loop. When this command is executed control is returned to the WHILE command line. Each WHILE must have a ENDW to finish the loop. If the ENDW is not included an error message will be displayed during compilation.


Menu Items

Navigation: Menu Programs > File >

Menu Items

 Print this Topic Return to chapter overview

The following are the menu items available when you click on the File menu.

New If the screen or source editor is active then this will create a new screen form or source file, otherwise this will have no effect.

Open If the screen or source editor is active then this will display the standard open dialog box, otherwise this will have no effect.

Save If the screen or source editor is active then this will save the active item without any further action on your part, however, the screen form/source file will not close.

Save As If the screen or source editor is active then this will display the standard save as dialog box. However, the screen form/source file will not close after the save action. If you do complete the save the name of the object on the tab and at the bottom of the screen will change to the new name.

Close If the screen or source editor is active then this will close the active item.

Print If the source editor is active then this will print the active item.

Exit This will exit from the screen/source editor. If you have active screen/source items that have been modified you will be asked if you want to save the files before the program exits completely.


Menu Items

Navigation: Menu Programs > Edit >

Menu Items

 Print this Topic Return to chapter overview

The following are the menu items available when you click on the Edit menu.

Undo If the screen or source editor is active then this will replace your latest change with what was there previously. All changes are saved internally so you can continue undoing and the screen/source will be set back to what it was one step at a time.

Redo If the screen or source editor is active then this will redo the changes you have replaced with the Undo above. It's like undoing the undo.

Cut, Copy, Paste, Delete, Select All

These are all standard Windows menu items, however, they are active only if the screen or source editor is active.

Find, Replace

These work in the source editor only and will display the standard Find or Replace dialog boxes.

Lookup Field

If the source editor is active you can lookup a field in the data dictionary with this option. If you choose a field in the lookup grid it will be added to your source file at your current edit location.

Goto Line If the source editor is active you can move to a line with this option. A dialog box asking for a line number will be displayed; enter a line number and click on the OK button.

Set Configuration

This will display the Set Configuration program (TP7SETUP.EXE).

NOTE: You must restart the screen/source editor before changes made in the Set Configuration program will be effective.

Convert Remarks

If the source editor is active, and you have a source file that was created by TAS Professional 5.1 or previous, this option will change remarks that begin with a semi-colon (;) to the new form of double slashes (//).


IDE Summary

Navigation: Menu Programs > Program >

IDE Summary

 Print this Topic Return to chapter overview

The following are the menu items available when you click on the Program menu or you can click the corresponding button displayed at the top of the IDE . Some of the items are documented separately.

This will set the screen editor active. If there are screen forms currently loaded the last edited will be the active form.

This will set the program editor active. If there are source files currently loaded the last edited will be active.

This will set the report editor active. Once the report editor has been loaded you should set it active by clicking on the TAS Report Writer button that will appear in your Start program bar.

Data Dictionary

This will display a three grid display. The first is the file names in FILELOC.DBF. The second is this list of fields in the FD for that file. And the third is the key names for that FD. Click on any file name and the FD information will change. Since version 7.4 we have added a feature to use this display to copy table name, file names, field names and key names into the source code editor. double click on the information you want to copy into the editor and it will be copied at current cursor position of your active src file.

This will compile or convert your source file to a RWN or RUN file that can be executed by the runtime.

Run This will display a standard open dialog box. You can choose a file to be run.

NOTE: The filter displayed (RWN or RUN) must match the file you want to run regardless of the extension you enter. When you choose a filter that will be the default the next time you choose this option.

Add, change and delete FDs in the data dictionary.

Other Data Dictionary Options

These are normally part of the Maintain Data Dictionary and have been brought to the Program Menu for ease of use. The options include: Edit File Locations, Create/Initialize File and Reindex CB and Btrieve Files.

Use this program to create/read XFR files. These are the files that allow you to move a FD structure from one data dictionary to another.

Add, change, and delete fields that can be referred to in your programs without first being defined. The definition for the field will be taken from this file.

Add, change and delete records in an existing database file.

Secure a screen form or source file so that your customers/users are unable to change or view the file.

If this is Checked the system will look for all programming files using the File manager. Files tat are stored in the file manager can be .RUN .RWN .DFM .SRC and .RTM type files

Use this option to add, delete or update files in your program manager files.

Display the data dictionary location, etc.


Compiler

Navigation: Menu Programs > Program >

Compiler

 Print this Topic Return to chapter overview

Every program must be compiled before it can be run. The TAS Professional compiler is a pseudo-compiler. That is, it doesn't compile to machine code but to a special run code that is executed by the runtime (TASRUNTIME.EXE). This makes the run files smaller, faster to create and doesn't need to be linked into an executable.

MENU BUTTON

MAIN SCREEN

Program Name/Filter:

Enter the name of the program to be compiled. If you are editing a source file, and it is active (on top), when you click the Compile button the name of that file will automatically be entered into this field. If you want to choose a different file you may enter it direct or click the File Search button. You may use standard Windows® file filters (& and *).

Now Compiling/List:

Will list the source file being compiled.

Compiling Process:

Displays a standard progress bar as the file is compiled.

File Search If you click this button when the cursor is in Program Name/Filter a standard file search dialog box will be displayed.

Compile Click this button after you've chosen the appropriate file.

Run Program If the program compiles properly you will be allowed to run the program by clicking this button.

Exit Exit the compiler

NO ERRORS / ERRORS SCREEN

At the end of the compiling process a new page will be displayed between the Main Screen and Defaults tab. The tab description will be No Errors if the program compiled properly and Errors, if it doesn't. An example of an error screen is below:

Create Error List

If you click this button a new error file will be created in the source editor. It will have the same name as the original source file. If you make that page active and click on any of the Line #xxx lines the source editor will move to the correct line in the appropriate source file.

Print Errors Will send the error information to a printer.

DEFAULTS

This page will allow you to set or change values that will effect buffers and other compiler options

Run Code Buffer Size (k):

The size of the internal compiled run code buffer. Generally 99k will be plenty large except for very large programs.

Compiled Code Buffer Size (k):

The actual compiled commands and options. Generally 99k will be enough except for very large programs.

Constant Buffer Size (k):

The size of the buffer that contains the constants used in your program. The size of this buffer depends on the number of constants used in your program.

Screen Buffer Size (lines):

This applies only to non-Windows programs that are being compiled (TAS Professional 5.1 and previous). When you compile TAS Professional programs (GUI type) this doesn't apply.

Number of Fields:

The number of unique fields used in the program. 600 should be enough for most programs.

NOTE: With version 1.15 the compiler now stores all the fields in the program for any file that is accessed. This means if you're compiling a program with a large number of files or that the files have lots of fields, you may need to increase this number substantially. Increasing this value to 2000 is not unreasonable.

Number of Labels:

The number of labels used, including event labels in your program. 600 should be enough for most programs.

Library Directory:

If you program has any #LIB or #INC files specified, and no paths have been included as part of the file name, the compiler will look to this subdirectory for the files. If this is blank the compiler will check the same subdirectory as the source file.

Include Warning Errors:

If this option is checked the compiler will show both fatal (program didn't compile properly) and warning (there may be a problem, you might want to check) errors. The default value is checked, we recommend that you display these errors also. They include duplicate defined fields, etc.

Compile in Debug Mode:

Check this option if you intend to use the TRACE command in the program you're compiling. It adds the source file name and source line number to each compiled line.

Update: If you make changes to any of the values on this page you must click this button to update the values in the TASPRO.INI file.

COMMENTS

When you compile programs that use GUI screen forms or reports the extension of the resulting file is RWN and is considered a "true" TAS Professional program. However, programs that don't use GUI screens/reports, and you haven't specified the #ForceRWN compiler directive, the extension of the resulting file will be RUN and is considered a TAS Professional 5.1 program. The TAS7 Runtime can run both .RWN and .RUN programs.

SEE ALSO

Compiler Directive


Maintain Data Dictionary

Navigation: Menu Programs > Program >

Maintain Data Dictionary

 Print this Topic Return to chapter overview

Use this program to add, change or delete File Descriptors (FDs or Schemas). This program controls FILELOC.DBF, FILEDICT.DBF, FILEDBF.DBF, FILEKEY.DBF, FILEKNUM.DBF and FILEDES.DBF.

NOTE: There is an in-depth description of how to operate this program in the tutorial. Part 1 Creating a Database

MENU ACCESS

Program -> Maintain Data Dictionary

MAIN SCREEN

ENTER FD NAME HERE

Enter the name of the FD you want to edit. You can click on the drop down arrow to get a list of current FDs. You can also enter the first character or part of the FD name and the drop down list will start with the name that matches.

Edit Once you have entered a FD name, or chosen one from the list, you would click on this button to edit the FD. The fields will be displayed and you will be able to click on the Keys tab to edit/display the key information. You will also be able to print the FD by clicking on the Print button.

New If you are creating a new FD click on this button. When you do the following dialog box will be displayed:

Enter a new FD name and click on the OK button. You will then be able to enter new fields and keys.

Save If you have entered a new FD or are editing a current FD you would click on this button to save the field/key information back to the data dictionary. After you click on the Save button the following dialog will be displayed. You must answer Yes or OK before the FD changes will be saved.

NOTE: If you save an existing FD the key information in FILEKNUM.B is deleted and will not be restored until you run the Restructure menu item from the Options menu (see below).

Close If you are currently editing a FD and don't want to save any changes made, or just want to edit a different FD then you would click on this button to close the current FD. No changes made will be saved.

Delete If you want to delete an existing FD from the data dictionary you would click on this button. You must be editing the FD before you can delete it. You will be asked to confirm that you want to delete after you click this button.

NOTE: When you delete a FD from the data dictionary all files that use that FD in FILELOC.B are also deleted.

Print This will print the FD information. You must be editing a FD before you can print it.

Exit If you click this button the program will exit. If you are currently editing a FD it will be closed before you exit.

FIELDS AND KEYS TABS

Fields On this tab all of the field information for that FD is displayed. To edit an existing field just move the cursor to the appropriate field and press ENTER. To add a new field press CTRL-END and ENTER twice (the first time puts you in edit mode, the second moves to the new line).

Deleting fields

To delete a field name click onto the field row you want to delete press the ESC key the field will become un higlighted and a dotted box will now be on the screen. If this is the field you want to delete press the delete key. Once you are in this insert/delete mode you can move to any field you want by using the up and down arrow keys.

Inserting fields

To insert a field name click onto the field row position you want to insert at. Press the ESC key the field will become un highlighted and a dotted box will now be on the screen. If this is the field row you want to insert. Press the insert key. Once you are in this insert/delete mode you can move to any field row position you want by using the up and down arrow keys.

Navigating the grid

Example screen above. If you look at the screen above and look at the field name APDC.CNTRY you will see the insert/delete box. To turn this mode on click on the row and press the ESC key. At this point you can move the box up and down using the up and down arrow keys. if you press the inser key you can insert a field or press the delete key will delete the field row. To edit the information press the enter key and you can edit the field name press enter to go to the next colume till you finnish the row. This works the same when editing any of the TASPRO entry grids.

Programmers Note : We do not recomend that you insert fields in the middle of a database. If you are changing a file with existing data this could cause loss of data in the restruture of the live data. you can insert any field at the end of the file you want.

Keys The screen below will be displayed when you click on the Keys Tab.

To edit a key click on the key name. The information about that key is displayed to the right of the key name list. To save the key after you've made changes or added a new key click on the Save Key button. To create a new key click on the New Key button. To delete an existing key, click on the key name and then, when the key information is displayed, click on the Delete Key button.

Deleting field segments

To delete a segment field name click onto the segment you want to delete press the ESC key the field will become un higlighted and a dotted box will now be on the screen. If this is the segment you want to delete press the delete key. Once you are in this insert/delete mode you can move to any field you want by using the up and down arrow keys.

Inserting field segments

To insert a segment field name click onto the segment position you want to insert at and press the ESC key the field will become un highlighted and a dotted box will now be on the screen. If this is the segment position you want to insert at press the insert key. Once you are in this insert/delete mode you can move to any field position you want by using the up and down arrow keys

Advanced Features

Ignore Case

This now works in both CodeBase and Btrieve version 6.15 or later. To set key segments Ignore Case, the Dictionary Maintenance Program has been extended to allow entry of a Y or I to each segment of a key, to set it part of Ignore Case. However, only alpha field segments are affected by this feature. You can also specify any combination of key segment features by selecting N for no feature, Y for Ignore Case, E for Empty or Null field and also I for both Ignore Case and Empty or Null field.

Null Key Segments

A Null Key Segment specifies if the key for a special record is to be included in the index file. For instance, some records include a project number. If you are interested in projects, you do not care about all the records that do not have any project number attached to them. This will result in a much shorter index file and faster processing. You do not want this to happen in a primary index that is supposed to show all entries in the data file. Typically there is a secondary index that consists of the project number, a date and an account number for the case just described.

Null Key Segments are sometimes refered to as Manual keys in Btrieve or Null keys in Pervasive or Filtered keys in CodeBase.

In this implementation the Btrieve concept is expanded compared to how it was used in TP5. It is possible to select which segments are to be considered for index entry exclusion. Also alpha fields can be tested to see if they are empty. The CodeBase concept is restricted to filter expressions evaluating to numerical 0 or empty alpha fields. Any expression can be rearranged to show that true or false.

Both Btrieve and CodeBase test the key for any segment Null. Thus compatibility is maintained among the two databases. For instance if you are interested in all people age 28 or above, you make the value in the index segment the result of the expression Age - 27 or 0 if less than 28. To avoid redesigning the key definition file, we use the same field for specifying Null Key Segment as is used for Ignore Case.

It can generally be done safely as Ignore Case operates on alpha fields only and also, if the alpha field is empty, it should be of no interest for Ignore Case lookup too, given it is a secondary index. To use Null Key Segments,

The dictionary maintenance program has been extended to allow entry of a E or I to each segment of a key, to set it part of a Null Key. However, you can specify any combination of key segment features by selecting N for no feature (default), Y for Ignore Case, E for Empty or Null field and also I for both Ignore Case and Empty or Null field.

Technically all keys are filtered in CodeBase using the expression NOT DELETED. What happens with Null Key Segments are that they are added to this expression with an AND operator.

Btrieve works in a little different way in that the record is skipped if there is any numerical segment in the key that has the value 0 or alpha fields that are empty. This is in fact the same as if the fields had an AND operator.

NOTE : to use UpCase or the advanced features in btrieve you must have your file format set in btrieve to 6.15 it will not work in 5.11 format.

OPTIONS MENU

The following items are the menu items on the Options Menu at the top of the screen.

Edit File Locations

This item will display the following screen:

To display an existing file location record click on the ellipsis button in the File Name field. A list of files will be displayed. To create a new file location record enter the file name (maximum of 32 characters), the extension, the FD Name for this file (a list of existing FDs can be displayed by clicking on the drop down arrow), the Record Type (B - Btrieve, C - CodeBase or DBF, N - non-TAS), and the location of the file or path. You can also enter a 40 character description for your own use.

To save a new location record or changes to an existing one click on the Save button. To delete a location record and the file it refers to you need to find that record first by specifying the File Name and Extension, and then clicking the Delete File button.

If you want to change the location (path) of all files with the same extension then click on the Update All button. The following dialog box will be displayed:

Enter the appropriate three characters extension and the new path. You can display locations on your hard drive (or a network drive) by clicking on the ellipsis button in the Path field. Click on the Do Update button when you're ready to continue.

NOTE: A record must exist in the location file for each file you open in a TAS Professional program. A record must exist before you can initialize or create a file. If you delete the location record the file that's referred to will also be deleted.

Print File Locations

This menu item will print the information in the location file.

Create/Initialize File

You must initialize a file before you can save data to it. You would do so with this option. The following screen will be displayed when you choose this menu item:

The options are the same as the Edit File Locations above. The Initialize button will start the actual initialize process.

Reindex Btrieve File

This option will display the following screen:

Enter a path and file name in the first field. You can use any standard wildcards. This defaults to your current data dictionary location. Then click the Find Files to search for all files that match. These files will be listed in the grid on the left. A sample follows:

The Status tells what Btrieve version the file has been setup for. The Num Recs is the number of records in the file. The second grid is a list of files that can't be reindexed. The Type value can be L, file is locked in some way, or N, this is not a Btrieve file.

Once the list of files is displayed click on the Re-Index button and the files will be reindexed one at a time.

NOTE: This works for Btrieve files only.

Reindex CodeBase File

This option is very similar to the Reindex Btrieve file above, except for a couple of changes:

Notice the Pack Files Also option. In CodeBase files (DBF) when you delete a record is doesn't actually get removed from the .DBF file until the file is packed. By choosing this option all deleted records will be removed along with re-creating the indexes. NOTE: Until you pack the files using this process they will continue to grow regardless of the number of records that are deleted. Deleted records are not automatically reused.

The second difference is the Memo Fld column. If there is a (Memo) line in this column for the file then it has a memo file also (.DBT). When you pack the main file it will pack the memo file at the same time.

The 70 error in the Exceptions grid will tell you that the file is opened and cannot be re-opened in exclusive mode. This needs to happen for the reindex routine to work properly.

Restructure File

Use this option when you have made changes to an existing FD, including changes to the keys. When you first choose the option the following dialog is displayed:

MAKE SURE YOU FOLLOWING THE WARNING. IF YOU DON'T MAKE A BACKUP BEFORE YOU RESTRUCTURE A FILE, AND SOMETHING GOES WRONG WITH THE PROCESS YOU WILL NOT BE ABLE TO RECOVER THE DATA.

When you click on the OK or Yes button the following screen will be displayed:

Enter the FD name directly or choose the FD from the drop down list. Once you have chosen the FD click the Restructure button to continue. The program will change each file that uses the FD chosen.

When the process is finished (Number of files remaining will be 0), click on the Exit button.

Fd Differernces

This program allows you to compare the current data dictionary to one in another sub-directory. You reach this option by placing the cursor on the option menu. Below is a sample of the screen.

.Program name: FD_DIFF.RWN (Source Included)

When you choose this option the program will ask you to enter the path of the dictionary to be compare and an optional title for your report. You will also be able to specify which FDs to check. You may use the wildcards ? and * here. If you wish to compare all then just leave this field blank. The program will run through the FDs in the current dictionary that match your entry and then will check for those same names in the remote dictionary. Differences in field sizes, types, decimal characters, even whether they exist or not will be printed. The program will also report whether the keys are different.

File Menu

Print DF

Use this option from the print button on the maitain data dictionary program or the file menu. NOTE : To use this option you have to be editing a file definition.

Print FD Range

Use this program to print a report for a range of data dictionary entry. When you run this program the following screen will be displayed.

Program name: PRINTTASDICT.RWN (Source Included)

COMMENTS

This is a TAS Professional program and, when you choose it from the menu, an instance of the runtime is started and runs WTASDMGR.RWN. Even if you exit TASPRO7.EXE this program will continue running until you exit Maintain Data Dictionary. You should see a button for this instance in your Start program bar.


Import/Export FDs (TAS Merge)

Navigation: Menu Programs > Program >

Import/Export FDs (TAS Merge)

 Print this Topic Return to chapter overview

Use this program to add to (Import) or copy from (Export) an existing data dictionary, one or more FDs. This will allow you to copy a FD from your data dictionary and add it to your customer's dictionary. It will also create the file if it doesn't exist, or, if it currently exists in the receiving data dictionary, the file(s) will be automatically restructured. This is a very powerful program that you can use to make sure that all appropriate data dictionaries are using the same structure for a specific FD.

NOTE: There are 8 files that make up the merge file set. Each file starts with XFR_. These need to be copied to the same directory as the data dictionary that you want to update. The files are: XFR_FILELOC.DBF, XFR_FILELOC.MDX, XFR_FILEDICT.DBF, XFR_FILEDICT.MDX, XFR_FILEKEY.DBF, XFR_FILEKEY.MDX, XFR_FILEDBF.DBF and XFR_FILEDBF.MDX. As a set, they are referred to as the XFR files.

MENU ACCESS

Program -> Import/Export FDs

MAIN SCREEN

Initialize Merge Files

If the XFR files don't exist when you run this program they are created automatically. However, if you aren't sure what's in the XFR files you should initialize them first before exporting FDs.

Export FDs to Merge Files

If you choose this option the following screen will be displayed:

You must choose the FDs you want to be copied to the merge (XFR) files. You can choose all the FDs by clicking on the [image] button. Or, click on a FD and then click the [image] button. Each time you click on either button all FDs or a single FD will move to the Destination list. Only the FDs in the Destination list will be copied to the merge files. You can move chosen FDs back to the Source list by clicking [image] (a single chosen FD) or [image] (all FDs in Destination list).

When you click on the OK button in the Choose box above the FDs will be moved to the XFR files.

NOTE: If there are already records in the XFR files anything you choose will be added to what's already there. However, if you move the same FD that's already in the XFR files the current FD in the XFR files will be replace.

NOTE: If a single FD has multiple files that use it, those files are automatically created/restructured when you run the Import option at the receiving dictionary.

Import FDs from Merge Files

Use this option to update a data dictionary to the FD(s) in the merge files that you've copied to the dictionary path. All files are either automatically created or restructured as appropriate. However, if a file exists but the FD wasn't a part of the current data dictionary, you will be alerted that the file, if created, will be erased. If you want to keep the file, move it to another location, and then continue. If not, just answer Ok and the file will be recreated. NOTE: In all cases you must answer Ok to the create question or the FD will not be updated properly.

Process all files in Merge/Update Files.

If this option is checked this program will process all files added to the merge files. The program originally was designed to check the target database to see if there were any real changes to process. This posed a problem caught after use of the program for almost 10 years. If the programmer only made changes to keys in the target file. This was not enough of a change to process the file wit this program. This option was added in 2009 ver 7.6.4 So if you ran into this problem before and had to go thru hoop maybe you might of mention this problem to us sooner.


Maintain Defined Fields

Navigation: Menu Programs > Program >

Maintain Defined Fields

 Print this Topic Return to chapter overview

Use this program to add, change or delete fields that can be used in your programs without using the DEFINE command. This program controls FILEDFLD.DBF.

MENU ACCESS

Program -> Maintain Defined Fields

MAIN SCREEN

The entry box just above the grid is a FastSearch field. Use it to find a specific record in the grid. This is only active when you are not in edit mode.

Next to the FastSearch field is a check box to turn edit mode on and off. To add, change or delete field records this box must be checked. The navigator bar at the bottom of the grid is active during edit and search mode.

To change a field record move the row indicator to the appropriate line using the FastSearch process, up or down arrow keys, or the vertical scroll bar. Then click on the Allow Editing check box (if it is not previously checked). You will then be able to change any of the values for that field record. To save the record, you can either move to a different row or click on the check mark button in the navigator.

To add a new field record, click on the Allow Editing check box (if it is not previously checked) and click on the plus (+) button in the navigator. A new record will be displayed and the end of the grid and you will be able to enter the information for this new field.

To delete a field record move the row indicator to the appropriate line using the FastSearch process, up or down arrow keys, or the vertical scroll bar. Then click on the Allow Editing check box (if it is not previously checked) and press the Delete key or the Minus (-) button on the navigator bar. You will be asked whether you're sure you want to delete the field, click on the Yes button and the field will be removed.

When you are finished with this program click on the Exit button.


Maintain Database

Navigation: Menu Programs > Program >

Maintain Database

 Print this Topic Return to chapter overview

Use this program to add, change or delete records in an existing file or table.

New feature as of VER 7.2 you can also export data from this program in dBASE III+, delimited/CSV, fixed length/SDF, text formats.

NOTE: There is a in-depth description of how to operate this program in the tutorial Part 2 Maintain Database.

MENU ACCESS

Program -> Maintain Database

MAIN SCREEN

Choose your file here first

Enter the name of the file you want to edit. You can click on the drop down arrow to get a list of current files. You can also enter the first character or part of the file name and the drop down list will start with the name that matches.

Open File Once you have chosen a file click on this button to open it. Once the file is opened you can click on the button to close it. If you want to edit another file you have to close the current file before you can open another one.

After you click on the Open File button the following screen will be displayed:

You must choose the fields you want to be displayed in the grid. You can choose all the fields by clicking on the [image] button. Or, click on a field and then click the [image] button. Each time you click on either button fields or a field will move to the Destination list. Only the fields in the Destination list will be in the edit grid. You can move chosen fields back to the Source list by clicking [image] (a single chosen field) or [image] (all fields in Destination list). You can also reorder fields in the Destination list by dragging and dropping them within the Destination list. The order they appear in the Destination list will be the same order they appear in the grid. Except, the first field in the grid will always be the active index field name.

When you click on the OK button in the Choose box above the fields will be displayed in the grid and the first index in the file will be displayed in the index drop box.

Index drop box (Choose your index here)

Once the grid is displayed you can change the current index by clicking on the drop down arrow and choosing a different value. The first field in that index will be displayed as the first field in the grid and the order will change as appropriate.

Allow Editing

Once the file is open you may click on this check box and edit the record fields. Once you do this the records are automatically locked (assuming you are running in a multi-user mode) when the cursor moves to the row and stay locked until the cursor moves to another row. When checked the Delete all records menu option will be displayed in the file menu.

Navigator Bar

A standard navigator bar is at the bottom of the grid. The keys are explained as follows:

Move to first record in file.

Move to previous record in file.

Move to next record in file.

Move to last record in file.

Add a new record.

Delete current record.

Exit Exit from the program.

Status Bar

There is a status bar at the bottom of the screen that displays the path and name of the file you are editing.

Filter You can enter a filter expression to control which records are displayed once the file is open and the grid is active. To do this press the CTL_F keys. The entry screen below will be displayed. You can enter any expression as long as it uses fields currently active and evaluates to True or False. It is used in the FOR option of the WLISTF command. Be sure to click on the OK button after you have entered the expression. To turn the filter off, press the CTL_F keys again, and click on the Cancel button.

Export Data

To export the data that is in the grid click the export data buttom or the export menu option. When you do this the screen below will be displayed.

Comma separated values (CSV) text files, in which the comma character (,) usually separates each field of text.

Delete All Records (Must be Filtered)

This Menu option is only displayed when you Edit data is checked also if you do not use a filter to filter the viewed record the program will display this message.

If you do have a valid filter the program will ask you if you are sure you want to delete all the filtered records. Only the filtered records will be deleted from the table. This is a permanent deletion of the records and without a backup of the data the data can not be recovered.

COMMENTS

This is a TAS Professional program and, when you choose it from the menu, an instance of the runtime is started and runs WTASDATAM.RWN. Even if you exit TASPRO7.EXE this program will continue running until you exit Maintain Database. You should see a button for this instance in your Start program bar.


Encrypt File

Navigation: Menu Programs > Program >

Encrypt File

 Print this Topic Return to chapter overview

This option will allow you to secure screen forms or source files (.SRC and .LIB) so that you can provide them to your customers, without worry that they may make changes where they shouldn't or otherwise misuse your screens/code.

MENU ACCESS

Program -> Encrypt File

MAIN SCREEN

File to Encrypt:

Enter the path and name of the file you wish to encrypt here or you can click on the [image] button to display a standard open dialog.

Encryption Phrase:

This is a series of characters used in the encryption process. The longer the better. They don't have to make any sense for the process to work.

Encrypt After you have chosen a file and entered the encryption phrase click this button to complete the process. A dialog will be displayed showing whether or not the file was encrypted properly.

Exit Will exit the process.

COMMENTS

A form (DFM) when encrypted will have the extension of DCY. A report format (RTM) when encrypted will have the extension of RCY. A source (.SRC) file when encrypted will have the extension of SCY. A library (.LIB) file when encrypted will have the extension of LCY.

When you encrypt screen forms or report formats you must use the #FORMSENCRYPTED compiler directive along with the encryption phrase you used during the encryption process. If all you're concerned about is not allowing your users to change the form it doesn't matter whether or not they know the encryption phrase since there's no published way to unencrypt a file. However, if you use encrypted forms you will probably also use encrypted source or, not provide the source for that file at all.

When you encrypt source files (.SRC or .LIB) the compiler knows the phrase used and you don't need to provide it to the user. However, you do need to use the #LIBX or #INCX compiler directives when you refer to these files. The main source file may not be encrypted.

NOTE: Don't delete the original file. If you forget the encryption phrase we will not be able to recover it for you!

NOTE: If you are encrypting screen forms or report formats DO NOT put spaces between the words or characters in the encryption phrase.


File Manger in Use

Navigation: Menu Programs > Program >

File Manger in Use

 Print this Topic Return to chapter overview

Use File Manager

If you store your programs, screens, report formats, etc., in the File Manager then this flag must be checked. In the General Setup program. You can also turn this on and off as needed from the program menu see the menu above.

Also See: File Manager Maintenance


File Manager Maintenance

Navigation: Menu Programs > Program >

File Manager Maintenance

 Print this Topic Return to chapter overview

Gone are the days of DOS when all we had to do is distribute our run programs and databases for our applications now in TAS Pro for one program you need about 3 or 4 files maybe more. That's why the file manager is so important to your new windows applications.

The TAS Professional File Manager is used to keep track of all of the different files that make up your project. These include programs with the extension .RUN, .RWN, .DFM (form files for GUI programs), .RTM (report formats), and .SRC (Source code). This program manager will help you manage your projects and help keep all the needed program files together. By using the File Manager you only have to worry about 3 files plus your database files for distribution. However, all of the programs and files are still available on an individual basis. Changes can be made to any single file without having to change them all.

The most important issue with the File Manager is to make sure it's turned on in TAS professional setup program (the Use File Manager check box should be checked). General Setup

The Operation of the file manager is simple its just a file manager and you simply Delete. Import, Export your program and files into the file manager.

To distribute your applications the three files that will be sent out for all your projects are the following files.

wtasfmgr.dbf wtasfmgr.mdx and the wtasfmgr.dbt. Plus TASRUNTIME.EXE and all of your data files that are needed for your application. and any other programs you need to support your application. However without the programs manager you would have to send maybe hundred of single files to distribute your application.

How to Import Updated Programs

From time to time you may be provided with updated programs that need to be imported into the file manager before you can use them. In that case the following instructions apply:

a) Place the updated programs in the same subdirectory where you have installed your target application. Or create a folder called update or anything you want.

b) Run the File Manager program. When you choose this option a screen similar to that below will be displayed:

c) In the Import Path and File Name or Wild Card enter the following: *.RUN.

d) Click the Import button. When the process is complete (it should take just a moment, even if there are lots of files) a dialog box will be displayed alerting you that all files have been imported.

e) Repeat steps c and d above, this time entering in *.RWN, for the file name.

f) If screen form (*.DFM) or report format files (*.RTM) have been sent you may have to import those also. Generally instructions will be provided as to which type of files need to be imported.

g) Once all files have been imported you can double check to make sure you have the correct files by entering the appropriate file name in the box above the Import Path title. The correct file will be displayed giving the date the date and time the file was modified.

Delete Multiple records

From the File menu in the program manager program.

Purpose of Program

Use this part of the Program manager to delete multiple files from your file manager.

Program Operation

You first type in an expression then click the Chk Expression button if there are files that will be deleted they will be listed in the list of files to be deleted.

Note: if you change the expression you must press the check expression button first before you press the delete button.

you can use any of the fields in the file mgr file for this method.

Export Multiple records

Purpose of Program

Use this part of the Program manager to export multiple files from your file manager.

Program Operation

You first type in an expression then click the Chk Expression button if there are files that will be exported they will be listed in the list of files to be exported.

Note: if you change the expression you must press the check expression button first before you press the export button.

you can use any of the fields in the file mgr file for this method.

If you have any questions about the file manager you can contact product support by Email at support@cassoftware.com


Current Configuration

Navigation: Menu Programs > Program >

Current Configuration

 Print this Topic Return to chapter overview

Use this program to display the different paths you have setup for this development directory.

NOTE: There is a in-depth description of how to operate this program in the tutorial A Breif Introduction to Database.

MENU ACCESS

Program -> Current Configuration

MAIN SCREEN

Development Directory

The path you defined as the development directory in the Set Configuration program.

Data Dictionary Path

The value entered in the Set Configuration program for the data dictionary.

Installation Path

Where you installed TAS Professional.

Exit Click this button to exit the program.

COMMENTS

This is a TAS Professional program and, when you choose it from the menu, an instance of the runtime is started and runs WTASCONFIG.RWN. Even if you exit TASPRO7.EXE this program will continue running until you exit Current Configuration. You should see a button for this instance in your Start program bar.


Configure Spell Check

Navigation: Menu Programs > Program >

Configure Spell Check

 Print this Topic Return to chapter overview

Use this program to configure the behavior of the spell check feature.

When you click on this option the following screen is displayed.

The screen and program for this operation is self explanatory.

This same spell check is avalible to use in all of the TAS Professional powered by CAS Programs you may write. So you can provide spell check for your programs as well as using it to help you build the best programs ever.

Related topic

Spell_Checking - Spell Checking command Dictionaries


Dictionaries

Navigation: Menu Programs > Program > Configure Spell Check >

Dictionaries

 Print this Topic Return to chapter overview

Dictionaries for use with TAS Professional Powered by CAS

Language Dictionaries

Afrikaans

American

Aussie

Brazilian Portuguese

Mauricio Longo

British

Czech

Danish

Dutch

Finnish

French

German-gt3 - ("Old" Std German)

GermanNew-gt3 - ("New" Std German)

Hungarian

Italian

Norwegian

Polish

Portuguese

Russian

Spanish

Swedish

Specialized Dictionaries

Technical Words from mathematics, statistics, computing, accounting and other scientific areas. Includes British & American spellings.

Medical

American Spellings.

Legal

American Spellings.

King James Bible + Apocrypha

Public Domain version of the King James Bible + Apocrypha converted into a Dictionary.

Latin

Italian Medical

Russian Scientific Beta Release

Auto-Correct Custom Dictionaries

English

Common English Auto Corrections.

US to British

Auto Corrects American Spellings to British ones.

Thesaurus not implemented in taspro yet.

Roget's Thesaurus - US English

Thesaurus based on the public domain version of Roget's Thesaurus.

Roget's Thesaurus - UK English

UK English Translation of the public domain version of Roget's Thesaurus.

Commercial Offerings

Stedman's Plus Medical/ Pharmaceutical Word List

Developed, and created by Lippincott Williams & Wilkins, one of the largest healthcare publishers. Stedman's Plus Medical/Pharmaceutical Word list features nearly half a million medical, drug and bioscience terms from 57 major medical specialties.

Includes:

* Over 20,000 trade and generic drug names drawn from Facts and Comparisons American Drug Index.

* Over 80,000 medical equipment and surgical terms

* Over 72,000 eponyms

* The most current terms related to diseases, treatments, medical procedures, lab tests, medical/surgical equipment, medical specialties, eponyms, abbreviations, and more!

Note: the boxed/CD-ROM product does not include an Addict-compatible file. www.stedmans.com/section.cfm/59

stedmans@lww.com

A brief commentary on dictionaries

There is a common misconception that the larger the dictionary is the better it is. While this may be true of reference texts, it is not true of dictionaries used with spelling checkers. The ideal dictionary will have the largest cross-section of words that are actually used in everyday documents, but will be very sparse with infrequently used words. Why is this? The answer is actually rather simple. The more uncommon words that the dictionary contains, the higher the chance that the user will misspell a common word in a form that will end up as a properly spelled word. Thus the spelling checker would believe the word to be spelled correctly even though the user quite possible had never even heard of the word before.

Related topic

Spell_Checking - Spell Checking command


Menu Items

Navigation: Menu Programs > Screen Options >

Menu Items

 Print this Topic Return to chapter overview

If the screen editor is active this main menu item will be displayed. If you don't have an active screen form then none of the sub-options will be available.

Add File Fields to Screen

This will give you the opportunity to choose a FD from the data dictionary, choose any or all of the fields, and have those fields placed on the active screen. All appropriate information about those fields is added including the type of object placed, the FieldName property, the name of the object itself, and, except in the case of TTASCheckBox, a TLabel object that is displayed immediately to the left of the entry object. You can either add the fields one at a time by clicking the left mouse button where you want the object to appear, or click the right mouse button and all the fields will be added at once.

Add Grid and Columns to Screen

This will also give you the opportunity to choose a FD from the data dictionary, choose any or all of the fields, and create a new TTASDataGrid with the fields you have chosen added as Columns.

Create Basic Source File

If the screen form has been saved to disk (so that it has an actual name and not New Screen), and there is no source file with the same name, you will be given the option to create a source file for this screen. If you choose this option a basic SRC file will be created and loaded in the Source Editor. As part of this source file will be a title line at the top, the standard #WinForm command line and three proto-events, for OpenFiles, Start and Close.


Add File Fields to Screen

Navigation: Menu Programs > Screen Options >

Add File Fields to Screen

 Print this Topic Return to chapter overview

Choose this Screen Options menu item to add fields to an existing or new screen form.

MENU ACCESS

Screen Options -> Add File Fields to Screen

MAIN SCREEN

When you first choose this option the following screen is displayed:

Either enter a FD name, or click on the drop down arrow to display all of the FDs available.

If you wish to place all of the fields of the FD on the screen then click on the All Fields button. Otherwise, click on the Choose Fields button and the following will be displayed:

You must choose the fields you want to be added to the screen form. You can choose all the fields by clicking on the [image] button. Or, click on a field and then click the [image] button. Each time you click on either button fields or a field will move to the Chosen Fields list. Only the fields in the Chosen Fields list will be added to the screen. You can move chosen fields back to the Available Fields list by clicking [image] (a single chosen field) or [image] (all fields in Chosen Field list). You can also reorder fields in the Chosen Field list by dragging and dropping them within the Chosen Field list. The order they appear in the Chosen Field list will be the same order they are added on the screen form.

When you click on the OK button you will be returned to the screen form. Notice the message that has taken the place of the original Caption for the screen form. This will tell you how many fields you have remaining to place on the form.

To place a single field on the form move the cursor to the approximate position where you would like to place that field and click the left mouse button. If you are adding an A type field something like the following will appear:

The name of the field is placed in a TLabel immediately before the object, in this case a TTASEnter. All of the information that can be setup for that object, including the FieldName, CharCase and Width has been done. Also notice that the number of fields remaining will decrease by one.

Keep placing fields in this manner until all have been put on the screen. The original caption will be replaced and you'll know you're done.

NOTE: Place All Fields At Once - If you don't want to place individual fields you can place them all at one time by moving the mouse to the starting position and clicking on the right mouse button. This will place each field on the screen one after another with the labels lined up on their left sides. You can then move the objects to where ever you wish.


Add Grid and Columns to Screen

Navigation: Menu Programs > Screen Options >

Add Grid and Columns to Screen

 Print this Topic Return to chapter overview

Choose this Screen Options menu item to add a TTASDataGrid with columns to an existing or new screen form.

MENU ACCESS

Screen Options -> Add Grid and Columns to Screen

MAIN SCREEN

When you first choose this option the following screen is displayed:

Either enter a FD name, or click on the drop down arrow to display all of the FDs available.

If you wish to add all of the fields of the FD to the grid then click on the All Fields button. Otherwise, click on the Choose Fields button and the following will be displayed:

You must choose the fields you want to be added to the grid. You can choose all the fields by clicking on the [image] button. Or, click on a field and then click the [image] button. Each time you click on either button fields or a field will move to the Chosen Fields list. Only the fields in the Chosen Fields list will be added to the grid. You can move chosen fields back to the Available Fields list by clicking [image] (a single chosen field) or [image] (all fields in Chosen Field list). You can also reorder fields in the Chosen Field list by dragging and dropping them within the Chosen Field list. The order they appear in the Chosen Field list will be the same order they are added on the grid.

When you click on the OK button you will be returned to the screen form. Notice the grid has been added to the form. Each of the columns has been setup properly depending on the field type. All the information that can be setup for that column including the FieldName, Editor, Header and Width has been done. You can now move the grid to the proper location and resize it as appropriate.


Menu Items

Navigation: Menu Programs > Bookmarks >

Menu Items

 Print this Topic Return to chapter overview

If the source editor is active this menu item will be displayed. At the top half of the menu are 10 Set Bookmark options. If you click on any one of these a small indicator will be placed in the gutter, space to the left of the edit area, with the same number, 0 through 9. Then you can return to that line by clicking on the corresponding Goto Bookmark option. Both the Set and Goto options will have checks placed next to the option in the menu to show that the bookmark is active. You can also place the bookmarks through the keyboard by typing CTRL-K+0...9 and to return to the bookmark type CTRL+Q+0...9.

The bookmarks you place while you are editing a source file are not saved with the file. Also, each source file has its own group of bookmarks. The following is a snippet of what the menu looks like:


Plugins

Navigation: Menu Programs > Plugins >

Plugins

 Print this Topic Return to chapter overview

The Plug in's Menu is a way you can add your own programs to The TAS Professional IDE System. These programs can be any valid .exe or TASPRO .RWN or .RUN program. The file name to edit is named PLUGIN.TAS it is a simple text file then can be edited by notepad or any text editor.

This menu is controlled by a simple text file.

Here is the sample file.

; PLUGIN.TAS

; TAS Professional Powered by CAS Plug in Menu configuration file.

; (c) Computer Accounting Solutions 2005 - 2007

; Here you can edit this file and add your own programs to the TASPRO IDE.

; These programs can be TASPRO 7 programs (.RWN) Old TAS PRO5 type Programs (.RUN)

; or Executable's *.EXE) We believe file associations will also work. (MYZIPFILE.ZIP)

;

; menu Caption , Program , start in folder

Note Pad,notepad.exe,.\

Calculator,calc.exe,

-,-,-

Edit DB,tasdbedit.rwn,.\

;End of Menu

To make your programs available just add a line with the Caption the programs name and the start in folder separated by a commas.

Example

menu Caption , Program , start in folder

NOTE : To add a separator add this line. -,-,-


Menu Items

Navigation: Menu Programs > Help >

Menu Items

 Print this Topic Return to chapter overview

The following are the menu items available when you click on the Help menu.

TASPro Help

This will display this help file.

About This will display a dialog box that shows the build number for the product (and any version if applicable). If you email for support please include the version and build number with your message.

Register When you purchase a licence to use TAS PRO you will click on this option to enter your registration key. Without registration the databases are limited to 150 records. Click here for more inforamtion.


Compiler Errors

Navigation: Error Messages >

Compiler Errors

 Print this Topic Return to chapter overview

The following are all the errors that can be received during the compilation process. The actual error is displayed in bold and an explanation follows.

NOTE: Most errors are followed by the item that caused the error.

All CASE commands must be DO types:

A CASE command is the equivalent of a IF expr DO ... The ENDIF occurs with the next CASE, OTHERWISE, or ENDC. You can't use a THEN, RET, or other option.

An error has occurred during conversion of this field from alpha to the appropriate binary form.

There was an attempt to compile a numeric value and it failed. This would happen if you combined alpha and numeric characters, such as "3x4" or "44ab", etc.

An unknown command modifier was found:

The command that's being compiled has only a limited list of options that can be used in a specific location. You have used an option that isn't allowed.

CASE command without active SELECT command

The compiler has found a CASE command and it isn't within a SELECT/ENDC structure.

Duplicate Label:

You have included a label that matches one that was used previously in this program or a Library/Include file.

ENDC command without active SELECT command

The compiler has found a END CASE command and it isn't within a SELECT/ENDC structure.

ENDIF command without an active IF command

The compiler has found an ENDIF command and it isn't within a IF/ENDIF structure.

ENDS command without active SCAN

The compiler has found a END SCAN command and it isn't within a SELECT/ENDC structure.

Error while compiling Valid Expression:

The expression that has been saved in the ValidExpr property for an entry object (TTASEnter, TTASNumEnter, etc.) has a problem and can't be compiled properly.

Error while trying to load source file (you may have run out of memory or resources)

Something happened in memory or you've run out of disk space for your swap file.

Error while writing to RUN file.

This could occur to both RUN and RWN programs. While the compiled program was being written to disk an error was returned by the OS. You probably have the program running at the same time you tried to recompile it. However, this could also occur if you are having a problem with your hard drive or you've run out of space available.

EXIT command without active WHILE

The compiler has found a EXIT command and it isn't within a WHILE/ENDW structure.

EXIT_IF command without active WHILE

The compiler has found a EXIT_IF command and it isn't within a WHILE/ENDW structure.

FEXIT command without active FOR command

The compiler has found a FEXIT command and it isn't within a FOR/NEXT structure.

FEXIT_IF command without active FOR

The compiler has found a FEXIT command and it isn't within a FOR/NEXT structure.

Field type changed from O to N or R

The O type (Old Form BCD) is no longer used. This message is for information only and will tell you whether it has been changed to N or R type.

Field type must be one of: I,B,R,P,T,D,N,L,A or F:

This would occur within a DEFINE command. You have specified a Type value other than those allowed.

FLOOP command without active FOR command

The compiler has found a FLOOP command and it isn't within a FOR/NEXT structure.

FLOOP_IF command without active FOR

The compiler has found a FLOOP_IF command and it isn't within a FOR/NEXT structure.

If you specify a numeric value as the array specifier in a screen field it must be a legal integer value:

You have used a numeric array specifier and it didn't compile correctly. This would happen if you combined alpha and numeric characters, such as "3x4" or "44ab", etc.

Invalid Compiler Directive:

You have used a compiler directive ("#"+directive) that doesn't exist.

Label not found with code, it may be due to putting parentheses around values that are passed in a CMD:

The compiler was attempting to make sure a label had been defined in the program. However, it wasn't found. What was found, though, was a "(" within the label so you see this error. It is possible that you have used a User Define Command (CMD) and put parentheses around the values you're passing, for example:

DoThis(100, 200, 300)

You should actually use the following, instead:

DoThis 100, 200, 300

Label not found within code:

The compile was attempting to make sure a label had been defined in the program. However, it wasn't found.

LOOP command without active WHILE

The compiler has found a LOOP command and it isn't within a WHILE/ENDW structure.

LOOP_IF command without active WHILE

The compiler has found a LOOP_IF command and it isn't within a WHILE/ENDW structure.

Main source file could not be opened

The source file you have named to be compiled could not be found or there was a problem opening the file so that the lines could be loaded.

Maximum field name length is 15 characters:

This would occur in a DEFINE command. One of the field names you have specified is longer than 15 characters.

Maximum number of dec characters is 8:

This would occur in a DEFINE command. The DEC value is greater than 8, the maximum allowed.

No init value in FOR/NEXT loop

Each FOR command has four parts; counter field, start, stop and increment values. You have not included the start or initialzation field.

No step value in FOR/NEXT loop

Each FOR command has four parts; counter field, start, stop and increment values. You have not included the increment or step field.

No stop value in FOR/NEXT loop

Each FOR command has four parts; counter field, start, stop and increment values. You have not included the stop field.

OTHERWISE command without active SELECT command

The compiler has found an OTHERWISE command and it isn't within a SELECT/ENDC structure.

Problem in the SELECT|CASE structure

This is a general CASE structure error.

SEXIT command without active SCAN

The compiler has found a SCAN EXIT command and it isn't within a SELECT/ENDC structure.

SEXIT_IF command without active SCAN

The compiler has found a SCAN EXIT_IF command and it isn't within a SELECT/ENDC structure.

SLOOP command without active SCAN

The compiler has found a SCAN LOOP command and it isn't within a SELECT/ENDC structure.

SLOOP_IF command without active SCAN

The compiler has found a SCAN LOOP_IF command and it isn't within a SELECT/ENDC structure.

The array brackets ([]) are not matched

You have specified an array field and the array brackets ([ & ]) are not balanced.

The array element specified in a screen field is greater than the maximum number of elements for the field:

You have specified a numeric array field value that exceeds the defined number of array elements for the field.

The Compiled Code Buffer is too small.

This is a value you would setup on the Defaults tab of the compiler. Increase the value of the Compiled Code Buffer, click on the Update button and re-compile the program.

The compiler has used then entire Screen Buffer. Please increase the Screen Buffer size on the Defaults page and recompile this program.

This is a value you would setup on the Defaults tab of the compiler. Increase the value of the Screen Buffer size, click on the Update button and re-compile the program.

The first character of a field name must be alpha (A to Z):

You've used something other than A to Z as the first character of a field name in a DEFINE command.

The math op following is not acceptable:

While working on an expression, the compiler found something it didn't expect. The legal math operators are here.

The parentheses are unbalanced in this expression:

In every expression the compiler expects to find a "(" for each ")" and vice-versa. In the expression displayed they parentheses are not matched.

The quote marks are unbalanced in this expression:

In every expression the compiler expects to find quote marks in pairs. If you start a constant with a single quote (') you must end the constant using a single quote. If you want to imbed a quote within a constant use the other kind to start and stop the quote. For example:

"I didn't get an error with this constant"

However, if you used:

'I didn't get an error with this constant' (all single quote marks)

You'd be wrong, you would get the error above.

The Report File Name could not be found:

The report format specified in a #WinReport compiler directive could not be found on the disk.

The Run Code Buffer is too small:

This is a value you would setup on the Defaults tab of the compiler. Increase the value of the Run Code Buffer, click on the Update button and re-compile the program.

The size of the constant buffer has exceeded the size defined in the defaults. Please reset the default value and recompile this program

This is a value you would setup on the Defaults tab of the compiler. Increase the value of the Constant Buffer Size, click on the Update button and re-compile the program.

The source file did not have any lines:

A source file (either the main file or a #LIB, #INC file) was empty when the compiler attempted to load it or search for a subroutine.

There are too many defined/dictionary fields used in this program. Please increase the compiler options for fields and then recompile:

This is a value you would setup on the Defaults tab of the compiler. Increase the value of the Number of Fields, click on the Update button and re-compile the program.

There is a fatal problem with the following expression. The problem may have to do with parentheses:

This is a general error you may get if the compiler cannot compile an expression. You may have unbalanced parentheses.

This expression is too complex. Please break into two parts:

You will see this if you have more than 20 functions or math operators in a single expression. Also, the total compiled size cannot exceed 1024 characters, however, since each part of an expression requires 5 characters you'll probably run out of functions/operators before this happens.

This field has been previously defined, or is in the Data Dictionary. It cannot be defined again:

This is a warning error you'll receive if you try to DEFINE a field that exists in the data dictionary or you've previously defined in the program. In either case the compiler will ignore this definition and will use the first one it finds. If you turn off warning messages in the compiler you will never see this error message.

This field was used in the program. It must be either DEFINEd or in the Data Dictionary:

At the end of the compilation process, all the fields used are checked to make sure they are either defined in the data dictionary or a DEFINE command in the program. If you received this error a field was used that wasn't in the data dictionary or defined.

This is not an allowed Option:

The compiler has found a value in your command this is not a legal option.

This key was not found in the data dictionary:

A key name you have specified could not be found in the FILEKNUM.B file.

NOTE: Even if you have added the key to the FD using the Maintain Data Dictionary program, if you don't Restructure the file the key will not be available during compilation. Also, if you make changes to an FD and save it back to disk the keys in FILEKNUM.B are automatically deleted and are not recreated until you run Restructure.

This Option is not part of the command:

The compiler has found a value in your command that is a legal option but isn't used in this command.

Too many library/Include files:

You may specify a maximum of 30 different library/include files.

Unable to create RUN file.

This is a memory problem that occurs at the end of the compilation process just before the .RUN program is saved to disk.

Unable to create RWN file.

This is a memory problem that occurs at the end of the compilation process just before the .RWN program is saved to disk.

Unable to load form:

The compiler is having problems loading a screen form that has been specified in the #WinForm compiler directive.

You can only have regular fields and constants in the CHAIN xxx WITH option. You used:

You have probably tried to include an expression as a WITH option value in a CHAIN command.

You cannot have a Value option and multiple field names or array elements

If you specify a VALUE option in a DEFINE command you may not have ARRAY elements and you may define only one field at a time.

You cannot have Valid Expressions in encrypted forms. The expression will not be compiled.

If you are compiling forms that are encrypted, any ValidExpr properties will be ignored.

You have a DEFINE command without any field names

You have specified a DEFINE command and the compiler can't find any field names.

You have a MOUNT command without a corresponding format:

This would occur when compiling a TAS Professional 5.1 program in the MOUNT command. The format specified in the command could not be found.

You have an End Structure type command without a corresponding Begin type command.

This error occurs if there are no active structures in the program and the compiler finds an end structure command, such as ENDIF, ENDC, etc.

You have included too many MOUNT or REMOUNT commands in this program.

This would occur when compiling a TAS Professional 5.1 program. There is a limit of 40 MOUNT/REMOUNT commands in any single program.

You have more field names than markers in the format:

This would occur when compiling a TAS Professional 5.1 program. If you have specified the #FMT compiler directive and the format being compiled has more fields than markers (&) in the format.

You have stacked more than 50 control structures. Reduce the complexity of this program.

You are limited to 50 active structures at any time in the program. You will probably never see this error.

You have tried to include more than 30 library and include files

You may specify a maximum of 30 different library/include files.

You have used a xxx structure ending command when the program expected a xxx

You would see this error if you use the wrong command to end a structure, for example, if you have a ENDC in an active IF structure (you should have an ENDIF). The structure type and the end command used will be displayed.

You have used an ELSE command without first using an IF

The compiler has found a FLOOP_IF command and it isn't within a FOR/NEXT structure.

You have used too many different files.

There is a limit of 100 different data files open in a single program.

You must have the FD in this command.

In the SET_ACTIVE command you must specify the FD. If you don't you will get this error.


Btrieve Setup

Navigation: Btrieve >

Btrieve Setup

 Print this Topic Return to chapter overview

If you are upgrading from a previous version of TAS Professional you have the choice of installing Btrieve at the installation process, or by executing the self-extracting zip file in the installation directory named BTRIEVE.EXE.

NOTE: You should not have TAS Professional loaded when you execute this program or any of those listed below.

NOTE: If you are not going to access Btrieve type files you do not have to install this program. It is strictly for those who wish to stay with the older file manager for their data files.

NOTE: You can also build these registry entry into a GP install program if your aplication needs to make changes to the recomented settings.

To setup Btrieve you have two options. A program included in the distribution, BTRVINSTL.EXE will make the appropriate registry settings for Btrieve in your local computer or you can run W32MKSET.EXE, which will allow you to enter the values in a more detailed basis. BTRVINSTL.EXE doesn't allow you to change the settings, W32MKSET.EXE does.

BTRVINSTL.EXE

This program is in the installation directory. If you execute the program, it will set the following values without any further action on your part:

Max Files = 100

Max Handles = 100

Max Locks = 100

Create 5x Files = True

Delete Tmp Files = True

File Sharing on Local Drives = False

Requester = False

If these values are acceptable than just run this program and you have nothing else to do. This program loads a copy of Btrieve during the operation. After it exits you must wait a minute or two before executing a TAS program to allow Btrieve to remove itself from memory. If you don't, the changes made will not take effect.

W32MKSET.EXE

This is a program provided by BTI / Pervasive to allow you to do the same changes as above. This program is also in the installation directory. When you execute the program the following screen is displayed:

To change the values you choose a Component, Category and Setting option. Most of the changes are in the MKDE (Workstation Edition) setting:

Categories:

File Settings

Open Files - Set this to at least 150

Handles - Set this to at least 150

Record Locs per Client - Set to 300 (minimum recommended)

Create Files in pre 6.x Format - If you are going to access your files with TAS Professional 5.1 you MUST set this to On

Local File Sharing - If you are going to run TAS Professional 5.1 and TAS Professional at the same time on the same computer you must set this to On.

Delete Lock File Off

Local File Sharing Multi Engine

Remote File Sharing Multi Engine

Memory Resources

Cache allocation 4096 (minimum recommended, 8192 better)

Communication buffer size 32768

(if you are running Peachtree, set to the max value of 65827)

Change Component to MKDE Interface and the following should be displayed:

The only change you need to make here is Requester. It should be turned off so set the value to No.

When you have made your changes click on the Save button to write the changes to your registry. Then click on the Exit button to exit the program. As with BTRVINSTL.EXE above, you have to wait a couple of minutes for Btrieve to stop before you run a TAS Professional program or your changes will not be used.W32MKSET.EXE

you can also copy the following into a file called btrieve.reg and import these settings into your registry entry.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Btrieve Technologies]

[HKEY_LOCAL_MACHINE\SOFTWARE\Btrieve Technologies\Microkernel Engine]

[HKEY_LOCAL_MACHINE\SOFTWARE\Btrieve Technologies\Microkernel Engine\Version 6.15]

[HKEY_LOCAL_MACHINE\SOFTWARE\Btrieve Technologies\Microkernel Engine\Version 6.15\Microkernel Interface]

[HKEY_LOCAL_MACHINE\SOFTWARE\Btrieve Technologies\Microkernel Engine\Version 6.15\Microkernel Interface\Settings]

"Target Engine"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Btrieve Technologies\Microkernel Workstation Engine]

[HKEY_LOCAL_MACHINE\SOFTWARE\Btrieve Technologies\Microkernel Workstation Engine\Version 6.15]

[HKEY_LOCAL_MACHINE\SOFTWARE\Btrieve Technologies\Microkernel Workstation Engine\Version 6.15\Microkernel Interface]

[HKEY_LOCAL_MACHINE\SOFTWARE\Btrieve Technologies\Microkernel Workstation Engine\Version 6.15\Microkernel Interface\Settings]

"Load Retries"=dword:00000005

"Local"=dword:00000001

"Requester"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Btrieve Technologies\Microkernel Workstation Engine\Version 6.15\Settings]

"Max Files"=dword:000001f4

"Max Handles"=dword:000001f4

"Max Locks"=dword:000003e8

"Balanced Trees"="0"

"Create 5x Files"="1"

"Logging On"="0"

"Logging Fmt"="6"

"Cache Size"=dword:00080000

"Max Communication Buffer Size"=dword:00004000

"Compression Buffer Size"=dword:00000400

"Extended Buffer Size"=dword:00004000

"Merge Sort Buffer Size"=dword:00000000

"Max Transactions"=dword:0000000f

"Transaction Durability"="0"

"Systrans Bundle Limit"=dword:000000c8

"Systrans Time Limit"=dword:000003e8

"Disk Wait Limit"=dword:000003e8

"Page Group Size"=dword:0000001e

"Max Clients"=dword:0000001e

"Worker Threads"=dword:00000001

"Background Threads"=dword:00000004

"Preallocate"="0"

"Minimal States"="1"

"Home Directory"="C:\\WINDOWS"

"Work Space"=""

"Syserr Notify"="0"

"File Sharing On Local Drives"="1"

"File Sharing On Remote Drives"="1"

"File Sharing Enable Bias"="0"

"File Sharing Max SysTrans Count"=dword:00000001

"Startup Logo"="1"

"Hide Icon"="1"

"Delete Tmp Files"="1"

"Trace File"="C:\\WINDOWS\\MKDEWE.TRA"

"Trace"="0"

"Trace Databuf Len"=dword:00000020

"Trace Keybuf Len"=dword:00000020

"Trace Ops"="hex:64,00"

"Window Pos"="hex:00,6e,00,00,00,6e,00,00,00,2e,04,00,00,47,03,00,00"

"Max Communication Buffers Size"=dword:00000fa0

"Logging On "="0"

//end of reg file

If all failes contact us at support@cassoftware.com


Btrieve/Pervasive

Navigation: Btrieve >

Btrieve/Pervasive

 Print this Topic Return to chapter overview

TAS Professional powered by CAS ships with the Btrieve 6.15 workgroup engine, which many of our users find meet their needs. However, if you require more power, speed, and reliability in your applications, CAS recommends an upgrade to the latest release of this database engine, which TAS Professionals IDE can implement seamlessly. We have included the below information for your review.

CAS is an authorized reseller of the Pervasive.SQL database, so contact us for all your Pervasive needs.

Call 1-800-358-4222 or (928)257-1236 to order your upgrade today

Pervasive.SQL V8 offers:

Industry-leading performance

· Btrieve® Performance - transactional API for the fastest access to your data
· Improved SQL Optimizer - delivers faster SQL performance. ODBC, JDBC, ADO / OLE DB and PDAC all take advantage of these improvements
· Turbo Write Accelerator - maximizes the efficiency of your disk I/O
· Full backward compatibility - leverage your legacy applications and databases

Embeddability for seamless application development and deployment

· Development Class Library - masks the complexity, configuration and administration of the database from within the application
· Full Installation Toolkit - allows transparent deployment of the database engine as part of the business application
· Continuous Operations - 24 x 7 availability of data, even during backups!

Low Total cost of ownership

· Pervasive System Analyzer - eliminates deployment issues related to component management
· Auto-Reconnect technology - avoids minor networking issues by seamlessly reconnecting workstations to a server engine in case of a network error
· Cross-platform dynamic parameters - no need to remaster the database environment from platform to platform
· Cross-platform consistency - common behavior across all editions and platforms simplifies cross-platform deployment and administration
· Server/Requester version independence - dramatically simplifies your deployment

Pervasive.SQL V8 is a superior data-management solution that can be seamlessly embedded into mission-critical applications, providing the crucial backbone users rely on to power their success. With its small footprint, easy installation and simple deployment, Pervasive.SQL V8 is the embedded data-management solution of choice for developers the world over.

A Complete Family Of Solutions

No matter your current size, needs or growth, the Pervasive.SQL V8 product family supports you in your drive to success, by providing everything you need to easily develop, deploy and maintain today's most advanced client/server and Web applications. Pervasive.SQL V8 scales across the spectrum of computing environments - from individual workstations to high-volume Web servers.

Pervasive.SQL V8 Server is perfect for both client/server and Web environments. It's the ideal solution for larger departments and growing enterprises that demand the highest level of performance, security, reliability and multi-platform support.

Pervasive.SQL V8 Workgroup lets you access all your critical data, regardless of where it resides on a peer-to-peer network. It combines the reliability, security and performance of the client/server architecture with the flexibility of the workgroup environment, and can also bring the scope and power of the server engine to the single desktop - without compromising quality or performance.


Btrieve Error Codes

Navigation: Btrieve >

Btrieve Error Codes

 Print this Topic Return to chapter overview

Btrieve(tm) Error codes

The Btrieve(tm) Record Manager returns a status code after each operation that an application performs. If the operation is successful, Btrieve returns Status Code 0. If the operation is not successful, Btrieve returns one of the nonzero status codes described in this section.

Summary of Btrieve error codes

1: The operation parameter is invalid.

2: The application encountered an I/O error.

3: The file is not open.

4: The application cannot find the key value.

5: The record has a key field containing a duplicate key value.

6: The key number parameter is invalid.

7: The key number has changed.

8: The current positioning is invalid.

9: The operation encountered an end-of-file mark.

10: The key field is not modifiable.

11: The specified filename is invalid.

12: Btrieve cannot find the specified file.

14: Btrieve cannot create or open the pre-image file.

15: The application encountered an I/O error during pre-imaging.

16: The application encountered an expansion error.

17: The application encountered a close error.

18: The disk is full.

19: The application encountered an unrecoverable error.

20: The Record Manager or Requester is inactive.

21: The key buffer parameter is too short.

22: The data buffer parameter is too short.

23: The position block parameter is not 128 bytes long.

24: The page size or data buffer size is invalid.

25: The application cannot create the specified file.

26: The number of keys specified is invalid.

27: The key position is invalid.

28: The record length is invalid.

29: The key length is invalid.

30: The file specified is not a Btrieve file.

31: The file is already extended.

32: The file cannot be extended.

34: The specified extension name is invalid.

35: The application encountered a directory error.

36: The application encountered a transaction error.

37: Another transaction is active.

38: Btrieve encountered a transaction control file I/O error.

39: A Begin Transaction operation must precede an End/Abort Transaction operation.

40: The file access request exceeds the maximum number of files allowed.

41: Btrieve does not allow the attempted operation.

42: A file previously opened in Accelerated mode was not closed.

43: The specified record address is invalid.

44: The specified key path is invalid.

45: The specified key flags are invalid.

46: Access to the requested file is denied.

47: The number of files opened exceeds the maximum allowed.

48: The alternate collating sequence definition is invalid.

49: The extended key type is invalid.

53: The language interface version is invalid.

54: The variable-length portion of the record is corrupt.

55: The application specified an invalid attribute for an autoincrement key.

56: An index is incomplete.

58: The compression buffer length is too short.

59: The specified file already exists.

60: The specified reject count has been reached.

61: The work space is too small.

62: The descriptor is incorrect.

63: The data buffer parameter specified on an Insert Extended operation is invalid.

64: The filter limit has been reached.

65: The field offset is incorrect.

66: The maximum number of open databases has been exceeded.

67: Btrieve cannot open the SQL data dictionaries.

68: Btrieve cannot perform the RI Delete Cascade operation.

69: The Delete operation specified a file that is damaged.

71: There is a violation of the RI definitions.

72: Btrieve cannot open the RI-referenced file.

73: The RI definition is out of sync.

74: Btrieve aborted the transaction.

76: There is a conflict on the referenced file.

77: The application encountered a wait error.

78: Btrieve detected a deadlock condition.

79: A programming error occurred.

80: Btrieve encountered a record-level conflict.

81: Btrieve encountered a lock error.

82: Btrieve lost positioning.

83: Btrieve attempted to read a record outside the transaction.

84: The record or page is locked.

85: The file is locked.

86: The file table is full.

87: The handle table is full.

88: The application encountered an incompatible mode error.

91: The application encountered a server error.

92: The transaction table is full.

93: The record lock types are incompatible.

94: The application encountered a permission error.

95: The session is no longer valid.

96: A communications environment error occurred.

97: The data buffer is too small.

98: Btrieve detected an internal transaction error.

99: Btrieve requester unable to access NetWare Runtime server.

100: No cache buffers are available.

101: Insufficient operating system memory is available.

102: Insufficient stack space is available.

103: The chunk offset is too big.

104: Btrieve does not recognize the locale.

105: The file cannot be created with Variable-tail Allocation Tables -(VATs).

106: The chunk cannot perform a Get Next operation.

107: The application attempted to perform a chunk operation on a pre-v6.0 file.

109: The application's transaction has become too complex.

130: Btrieve ran out of system locks.

133: More than 5 concurrent users attempted to access the same Btrieve file.


Convert Btrieve Datadict to CodeBase

Navigation: CodeBase >

Convert Btrieve Data Dictionary to CodeBase

 Print this Topic Return to chapter overview

1. Run the TP7SETUP.EXE program. When the program asks if you want to copy a set of data dictionary files to the new subdirectory, answer yes. This will copy the appropriate files from the TAS7 subdirectory.

NOTE: Make sure the Use CodeBase checkbox is not checked.

2. After the setup routine is completed, execute the TASRUNTIME program. Run the program WTASCNVTCB.RWN. This will be in the original TAS7 subdirectory. Click on the START button to begin the process. This program will copy the files, fields, keys and other information from your current Btrieve data dictionary to the new CodeBase version.

3. When the program above is complete, run the program DBF_FLDS.RWN, also in the same subdirectory. Again click on the START button. This program goes through your data dictionary and makes sure there are records in the FILEDBF file for each record in the FILEDICT file. You can run this as many times as you wish, it will not delete what is already there.

4. When you're finished with the above your data dictionary has been converted. Exit from TASRUNTIME and restart TAS Pro.

NOTE : Important you can not run the WTASCNVTCB.RWN program from the TAS Pro IDE TASPRO7.EXE.

If you do it will cause the program to error it must be run without TASPRO7.EXE running because the IDE has the Data dict files open.


Convert Btrieve Files to CodeBase Files

Navigation: CodeBase >

Convert Btrieve Files to CodeBase Files

 Print this Topic Return to chapter overview

If you want to convert multiple Btrieve files to DBF (CodeBase) you can use the program WTASCONVERT.RWN. To execute the program click on the Run button and choose the program or enter the program name.

MAIN SCREEN

When you first execute this program the following screen is displayed:

Click on the Choose Files button and a standard dual list box will be displayed. All of the files that are in your data dictionary that have a type of T or B will be displayed in the left hand list:

You must choose the files you want to convert. You can choose all the files by clicking on the [image] button. Or, click on a file and then click the [image] button. Each time you click on either button, all files or a single file will move to the Convert to DBF list. Only the files in the Convert to DBF list will be converted. You can move chosen files back to the Btrieve Files list by clicking [image] (a single chosen file) or [image] (all files in the Convert to DBF list).

Once you have chosen all the appropriate files click on the OK button. Click on the Cancel button to exit the process.

When you return to the main screen, if you have chosen files to convert, the Convert button will now be enabled. Click on that to start the process.

For each file that is converted the name will appear in the entry field above the buttons and a separate form will be displayed showing the progress. When the process is done the program will exit.

COMMENTS

If the conversion doesn't work you should try the following:

1. Run DBF_FLDS.RWN again. The Short Field Name length + Maximum Width of Array Fields cannot exceed 10 characters. So, if you have an array of 50 the length of the Short Field Name should be 8 characters or less. If this is not the case running DBF_FLDS.RWN again (if you have the current version) should take care of this problem.

2. Load the FD in WTASDMGR (Maintain Data Dictionary) and save it again. This will update the position counters in FILEDBF.


Client/Server Setup

Navigation: CodeBase >

Client/Server Setup

 Print this Topic Return to chapter overview

Setting up the Client/Server option for CodeBase is very easy. Just follow the steps below:

NOTE: You must be licensed for the client/server before you will be able to use it. To tell if you are licensed look at the screen that appears upon start-up. The second character in the License Type field must be C or U. If not you will have to upgrade your license to use client/server. All TAS Professional development licenses are ready for client/server since they have a 'C' License Type.

1. Download the TP6CS.EXE file from www.business-tools.com/downloads/tp6cs.exe. Note: Business Tools Inc. Closed there doors in May 2003 If you need support for Codebase and CS Please Contact us at support@cassoftware.com

2. Execute the file, click on the Unzip button, and install the programs in a subdirectory on the same computer that will act as the server. The default subdirectory is \CBServer.

3. Copy the C4DLL.DLL file from the server directory to the computer/subdirectory where you have TAS Pro installed. This should replace the file that is already there. If you are not asked to log-in when you start TAS Pro you have not copied this file correctly.

4. Start the server program by executing the file S4SERVER.EXE. The following screen should be displayed:

5. You need to determine the name of the computer where the server is running. How you do this depends on the OS you are running:

Win 98 a. Right click on Network Neighborhood.

b. Click on Properties.

c. A dialog box with tabs should be displayed, click on Identification.

d. The Computer Name value is what you are looking for.

Win 2k a. Click on the Start button.

b. Move the cursor to the Settings option.

c. Click on Control Panel.

d. Click on the System icon.

e. A dialog box should appear that says System Properties at the top.

f. Click on the Network Identification tab.

f. The Full Computer Name is what you are looking for. NOTE: This might have a period at the end of the name. Unless you put that period there, you can ignore it.

XP a. Click on the Start button.

b. Move the cursor to the Settings option.

c. Click on the Control Panel.

d. Click on the System Icon.

e. A dialog box should appear that says System Properties at the top.

f. Click on the tab that says Computer Name.

g. The Full Computer Name is what you are looking for. NOTE: This is actually after the Computer Description. Also, this might have a period at the end of the name. Unless you put that period there, you can ignore it.

NOTE: The above assumes you have changed the standard XP setup back to something that is recognizable. If you like the standard XP setup, or haven't changed it yet, then do the following:

a. Click on the Start button.

b. Click on Control Panel.

c. Click on Performance and Maintenance.

d. Following the title: "or pick a Control Panel icon" click on the System icon.

e. Click on the tab that says Computer Name.

f. The Full Computer Name is what you are looking for. NOTE: This is actually after the Computer Description. Also, this might have a period at the end of the name. Unless you put that period there, you can ignore it.

6. The name you get in step 5 above is the Server Name to be used when logging in (see below).

7. VERY IMPORTANT - If you have a fixed IP address for each computer (most importantly, the server) the network won't be able to find that computer unless you tell the network where it is. This is accomplished with the LMHOSTS file. A sample of this file is on your computer with the extension .SAM. Use the Start->Search->Find Files... program to search for the LMHOSTS.SAM file. This is a text file that can be edited with NOTEPAD or something similar. You should create your own version of the file in the same subdirectory without the .SAM extension. Follow the instructions in the .SAM file and you should have no problems. HOWEVER, the simplest process is to allow the network to assign an IP number automatically. This is the default setup for Microsoft TCP/IP and is the recommended procedure unless you have a network professional at your disposal.

What to do from the client computer

1. Make sure you have copied over the C4DLL.DLL from the server subdirectory to the subdirectory where you have installed TAS Pro. This can be on the server machine. You're not required to have multiple installations of TAS Pro.

2. Run TP7SETUP.EXE.

3. If you have copied over the correct DLL you should now see two new fields on the General page. These are Server Name and User Name. The User Name will default to PUBLIC.

NOTE: The server automatically creates a user with the name of PUBLIC and no password required. You should replace this with user entries that are appropriate to your company.

4. The names you enter here will be used as default values when you log in. There is no requirement to put anything here.

5. All file settings need to be made in relation to the server location. For example, assume that you have created a stand-alone server (recommended), and all of the data files, including the data dictionary, are on that server (again, recommended). Assume that the data dictionary location is \TAS7 and the data files are in \TAS7\DATA. Normally, if you accessed the server as, for example, G:, then you would set your data dictionary to G:\TAS7, etc. However, since the server software is running on that machine, the software would look at that as C:\TAS7, which is what you must use.

So, the step here is to change the Data Dictionary drive letter if you have been using a peer-to-peer version previously. If this is a new installation, enter either the drive letter as appropriate.

NOTE: Something very important to consider: You don't have to give the user access to the server computer. Even if the user can't "see" the files on the server they can still access the data through the server software. This will give you absolute control over which files the user can access by controlling the programs they can run, etc. If the user doesn't have access to the server, you will have to put a copy of the EXE files someplace where he/she does. This would also include the TASPRO.INI file.

NOTE: The TP7SETUP (and TP7RTSETUP) program will not attempt to check for a set of data dictionary files at the specified location if the client/server version of C4DLL.DLL is active in their computer. This means you have to make sure the data dictionary is properly setup yourself before starting up the user.

Logging into the server

After you have completed the steps above you are ready to restart TAS Professional. When you start either TAS Pro or the runtime the following form will be displayed:

The values in Server Name and User Name depend on what you have entered in TP7SETUPSETUP above, if anything. The User Name will default to PUBLIC unless you have entered a different value in TP7SETUPSETUP. There is no default for the Password, it must always be entered.

If you have entered the correct Server Name you should be able to click on Logon without entering a Password (for PUBLIC only). The start-up process will continue and the license screen will be displayed. From that point on there is no visible difference between client/server and peer-to-peer.

When you exit from TAS Pro or the runtime you are automatically logged off the server.

Modifying server settings

Download the CodeBase Administrator from www.business-tools.com/downloads/cbadmindl.exe. Execute the program, click on the Unzip button, and install the programs in the CBADMIN subdirectory. You do not have to install this program on the server. If you want to control who has administrative access then control access to this program. Also, you must be logged into the ADMIN user. Initially, this user doesn't exist. To add the user to the Accounts file you must log into the CB Admin program on the same computer where the server is installed. Once the ADMIN account has been added, you will be able to log into the user from any computer. The ADMIN account controls who can make changes to the Accounts file.

You will need to log into the server from the administrator just like you do from TAS Pro. However, the defaults displayed are not from the TASPRO.INI file. Also, a Port ID is one of the entry options. Just ignore this field.

Once you've logged into the server you will be able to add new accounts, change the log file, disconnect users, check and see which files are opened, etc. This program can be run from any client, it does not have to be run from the server.

Before you can enter accounts you must setup the location of the System files. To do this, after you have logged into the server, click on Server->Settings. The following screen should be displayed:

You must enter a value for System Directory. It should be the same directory where you installed the CB Server software (default is C:\CBServer). And, just like all the other files, is relative to the server location. You should save the information by clicking the OK button, then exit from the CBAdmin program. Exit the Server (by clicking on the Exit button on the server screen) and restart the program. Then you will be able to update all the other information for the server.

You may modify the server settings by clicking on the Start Administrator button on the server screen or by clicking on the CodeBase Admin icon. The file name is CBADMIN.EXE. A full help file is included at CBADMIN.CHM.

Take the time to read through the documentation that comes with the CodeBase Administrator program. The options aren't extensive or difficult to understand.

NOTE: The CBAdmin program will access any server running on your network.

VERY IMPORTANT: The CBADMINDL.EXE contains a version of COMDLG32.OCX that may overwrite what you already have in your Windows\System (or WINNT\SYSTEM32) subdirectory. You should probably make a backup of that file before you install this program.

Comments

Once you have installed the server program you'll be very surprised, and pleased with how easy it is to install and run, especially compared to other client/server programs you may be familiar with. Don't forget that the CodeBase server may be run on ANY Windows 98, NT, or XP computer. You do not have to set this up on a computer running a server version of Windows. Also, you can have multiple servers running at one time on multiple computers. However, at this time, you can access only one server at a time from your programs.

The "C" license limits you to 10 users at one time per server. The "U" license allows you to have an unlimited number of users at one time per server.


AutoAddFlds

Navigation: CodeBase >

AutoAddFlds

 Print this Topic Return to chapter overview

There is an entry in the TASPRO.INI file that doesn't appear in any of the setup programs. It is in the [Setup] section and the item name is AutoAddFlds. Normally, you won't see this appear in your INI file. However, internally, in TAS Pro, it is automatically set to 1000. This means that every program you run automatically allows for 1000 extra fields that are added during runtime. This is in addtion to any extra fields you specify in the program.

When you open a CodeBase type file the runtime automatically loads all the fields from the data dictionary for that file at the time it's opened. This is necessary due to the way the index search fields work. By loading all the field specs you can avoid having to add extra code to your programs.

Most of the time, 1000 extra fields will take care of all your needs. However, in some situations, it will not. In that case you can either increase this value by adding it to your TASPRO.INI file, e.g., AddNewFlds=2000, or, by including the #ADD_FLDS compiler directive in the appropriate program.


Save data from one file into another

Navigation: CodeBase >

Save data from one file into another

 Print this Topic Return to chapter overview

When accessing Btrieve files you can read a record from one file and save it into another using just the FINDV and SAVE commands, as long as both files use the same FD. In CodeBase this does not work. You must use the XFER command (REC_BUFF option) and move the record buffer from the found record to the record you're going to save.

If, however, you want to access the fields for each file you must set the appropriate file active with the SETCBACTIVE command.


Using Type V fields

Navigation: CodeBase >

Using Type V fields

 Print this Topic Return to chapter overview

In previous versions of TAS Professional it was either allowed or required that you use a type V field when you wanted to create a compound index. This hasn't been the case for some time, however, with the move to CodeBase this is now no longer functional. Due to differences in the way the buffers and indexes are maintained in Btrieve and CodeBase you must enter compound indexes as a regular index with multiple segments.


How the restructure process works for DBF files

Navigation: CodeBase >

How the restructure process works for DBF files

 Print this Topic Return to chapter overview

You would restructure a file when you change the FD in Maintain Data Dictionary. When the program (MDD) restructures a CodeBase (type C) file it calls the RESTRUCTURE_DBF() function. The following occurs:

1. The original files are renamed to $$$$RST.ext where ext = DBF, MDX and, if appropriate DBT (Memo file).

2. A new file is created with the modified FD.

3. Both old and new files are opened.

4. The program searches through the new file and matches ShortFieldNames in the old file. If there isn't a match in the old file for a new file field, it is ignored during the restructure process.

5. A record in the old file is read.

6. The fields are transferred from the old to the new if there are matching names (see #4).

7. The new record is saved.

8. Loop back to #5 until all the records in the old file have been read.

NOTE: The most important part of this process is that if you change the ShortFieldNames in the modified FD that those fields in the current files WILL NOT be moved to the new file.

NOTE: The restructure process also does an automatic pack since only the active records in the old file are read.


Codebase Database

Navigation: CodeBase >

Codebase Database

 Print this Topic Return to chapter overview

TAS Professional powered by CAS comes included with a Peer to Peer and a 10 user C/S version of the codebase database engine included to use with your TAS Professional applications. This is a short introduction to codebase. If you need to use codebase in other applications other then TAS PRO you will need to purchase your own copy of codebase.

If you are using codebase on a C/S and need more users you will have to purchase your own server. However there is still a licence to use TAS Pro in C/S.

For information feel free to contact us. Or Contact then on there website at www.codebase.com

Codebase Introduction

The CodeBase family of high-performance database programming tools provides a wide range of solutions to meet the needs of almost any application. Our solutions work with all popular operating systems and programming languages.

Use CodeBase when you need database access locally, in a shared network environment, or over the Internet.

Speed

Our high-performance database engine allows you to query millions of records in a single second. You can perform bulk appends, edits and deletes at speeds that are impossible with other products.

Enterprise-Level Solutions

Use the power of CodeBase to handle even the most demanding requirements. Your applications can share databases across your network, or around the world using the client/server model. The CodeBase Database Server protects your data with security features which you can administer remotely.

· Execute powerful SQL queries in your application or through any tool that supports ODBC.
· Use ADO or ADO .NET with our CodeBase SQL.
· Call CodeBase engine functions directly from your source code.
· Use our report writer to create reports which you can run within your application.

Constrained Environments

CodeBase is not limited to desktop computer platforms. It can run on constrained environments such as PDAs or embedded devices. Applications built with CodeBase for Windows CE 4.0, CodeBase for Pocket PC, or CodeBase for J2ME load fast and use a minimum of system resources.

Royalty-Free

CodeBase allows royalty-free distribution for all supported configurations, including client/server. This means you can even distribute the CodeBase server engine and all associated utilities free from royalties.

FoxPro, dBASE and Clipper File Support

CodeBase supports multi-user file compatibility with the data, index and memo files of FoxPro, dBASE and Clipper. Thousands of commercial applications directly use or import/export data in the xBASE format.

Large Files

The maximum table size is 4.2 billion gigabytes (4,611,686,018,427,387,904 bytes) under both 32-bit and 64-bit operating systems. This is large enough for any application today or in the foreseeable future.

Award-Winning

Check out the complete list of features that have made CodeBase an award-winning database engine for many years.

Product Features

Flexible Engine API

The CodeBase Engine API provides comprehensive database functionality under all popular development environments and operating systems. You get a complete set of high and low-level capabilities. High-level functions let you accomplish a lot in a single function call while low-level functions let you do precisely what you want.

Furthermore, the Engine API is easy to learn. This is because of its modular well organized design, intuitive function names, and full documentation. It includes a comprehensive User's and Reference Guides with lots of examples.

Blazing Access Speed - Turbo-charges your applications

Our high performance database engine allows you to query millions of records in a single second. You can perform bulk appends, edits and deletes at speeds that are impossible with other products. We even expose our 'low-level' API to give you every opportunity to tweak your application for maximum speed. CodeBase includes full support for multi-threaded standalone and client/server applications. You can see how fast CodeBase will work for you by reviewing some of our speed demo benchmark results, or experience it yourself by downloading our speed demo. Also, you can refer to our Precision Query Technology.

Portability - Added flexibility

Does your application need to run on more than one platform? If so, you'll be glad to know that there are versions of CodeBase available for every major operating system including Windows XP, 2000, NT, Me, 98, 95, CE, OS/2, DOS, Macintosh, Linux, and a variety of UNIX platforms including Solaris, SunOS, HP-UX, AIX, SCO and others. 64-bit operating system support is also available.

The CodeBase Engine API is virtually same between all supported programming languages, allowing ease of development in more than one language.

FoxPro, dBASE & Clipper File Compatibility: A High-Performing Standard

CodeBase-powered applications are multi-user file compatible with FoxPro, dBASE and Clipper (xBASE). You can read and write the data, index and memo files of xBASE at the same time as xBASE.

Enjoy great performance using xBASE files for several reasons. First, the internal xBASE algorithms are simple and efficient, and the database files compress well which minimizes disk I/O. The format also lets you split a database across different disk drives allowing you to increase disk I/O throughput as much as necessary. Finally, operating system disk defragmentation utilities work excellently on xBASE files which allows maximum efficiency.

The xBASE database format is one of the most popular in the world. Thousands of software products either use or import/export data in the xBASE format. Consequently, you can use CodeBase with many development tools and applications.

SQL programmers will appreciate the unique record number field with super fast record retrieval (no index is required) and no storage overhead. One last benefit for xBASE programmers is that the corresponding API option will be intuitive and easy to use.

Client/Server

Access databases across your network or across the Internet. Take advantage of the performance, stability and remote administration of client/server.

Very Easy to Deploy - Reduces distribution and update headaches

Installing or updating applications built with the CodeBase Native API is incredibly easy! Simply deliver a single DLL, or even statically link CodeBase into your C/C++ applications for zero runtime files. Even under client/server, there are only a few extra files required in order to run the entire database server. Unlike Microsoft and other's database products, there are no registry entries required, no system DLLs that need to be replaced, no DLL Hell, and no requirements to ship a host of run-time files either. CodeBase makes delivery of database applications SIMPLE!

Web-Ready

CodeBase can be used to make your databases available on your web site or corporate intranet using a number of different methods. More...

Small Footprint - Keeps .EXEs small and loads fast

Not only is CodeBase fast, but it is also very compact. This means your executables load faster, and use less system resources. Smaller programs can even help your apps run faster by helping to avoid the disk swapping that occurs when operating systems like Windows runs out of available memory. CodeBase applications are typically smaller than a tenth the size of similar applications written with FoxPro, dBASE, Visual Basic, Delphi, or even the standard database engines bundled with most compilers. For constrained environments such as PDAs or embedded devices, you can make your applications even smaller by using CodeBase for Pocket PC or CodeBase for J2ME.

Programmers with specific needs can reduce the footprint of CodeBase even more. By setting one or more conditional compilation directives, you can remove unneeded functionality from CodeBase.

Precision Query Technology™

With our Precision Queries, you get a unique combination of speed, high level functionality and control. The speed partly comes from sophisticated Bit Optimization, indexing, compression, and bulk data transfer algorithms; in addition, a clever programmer can improve the speed even more by controlling precisely how the indexes are used. Other examples of how Precision Control can be used to improve speed and to get exactly the result you want are as follows:

Search to a specific position in the query and continue from that position. Very little work is done by the computer to move to the starting position. Navigate forward and backward. Sort and filter with or without indexes. Move through the master table and look up other tables in the query under program control. If a record, in a table being looked up from another table, is missing you can control whether that composite record is skipped, whether to go to the next closest record, whether an error is generated, or whether the missing record is replaced by a temporary record of nulls and blanks. Quickly count the number of records in the result set. Indexes can be utilized based on partial index keys.

Scalability - Protect your investment

There is no better way to protect your programming investment than by using a fully scalable database engine. CodeBase scalability means that you can take the same program source code and have it function as either a single- user, networked multi-user or client/server application. With CodeBase, all you have to do is switch DLLs or link with a new library, and you instantly get the functionality you need, without ever having to alter your code! CodeBase grows along with your application's needs.

Very Large Table Support

The maximum table size is 2.1 billion records. In addition, compression support can be used to save disk space and improve performance. The maximum size of index files, which contain sort information, is 4096 gigabytes. We estimate that a table containing 128 indexes, each built on a 60 character field, could support approximately 2 billion records. Furthermore, a single memo field, which contains variable length string or binary data, can be as large as 4 Gigabytes.

Support for International Languages

CodeBase broadens the reach of your applications by including support for international languages including, French, German, Modern Spanish, Portuguese, Italian, Swedish, Norwegian, Finnish and Japanese. We can easily add support for more collating sequences, so if you need support for a new collating sequence with CodeBase, simply let us know.

Source Code Included

CodeBase includes source code to the Engine API absolutely free. This protects your investment by allowing you to rebuild the library with any changes you might need. It also means you can quickly eradicate any bugs by immediately applying fixes from our tech department and simply rebuilding the CodeBase engine.

Features

• Flexible Engine API

• High Performance

• Portable

• FoxPro/dBASE/Clipper File Compatible

• Client/Server

• Easy Deployment

• Web-ready

• Small Footprint

• Precision Query Technology™

• Scalable

• Large Tables

• International Languages

• Source Code Included

• CodeBase Administrator

• CodeReporter

• CodeControls

• Royalty-Free Distribution


Error -910 - Skip error

Navigation: CodeBase >

Error -910 - Skip error

 Print this Topic Return to chapter overview

If you get this error with the message: skip must be made from valid record number; this means you've tried to do a FINDV N or P, or you are in a SCAN command and, for some reason, you have cleared the record buffer or at least the record number. This would generally happen during a SAVE command. In this case add the NOCLR option to the SAVE command and your loop should work just fine.

You can also check for an active record before you do the next or previous by using the IFNA() function. If it returns True then you know the next or previous will just return an error and you can protect it before the FINDV command. In the case of a SCAN, make sure you don't clear the record number or buffer of the file you are scanning.


Code Base Error Codes

Navigation: CodeBase >

Code Base Error Codes

 Print this Topic Return to chapter overview

Using the FLERR() function returns the numbers associated with Btrieve error messages for CodeBase and Btrieve files.

General disk access errors

-10 Closing file

-20 Creating file

-30 Determining file length

-40 Setting file length

-50 Locking file

-60 Opening file

-70 Reading file

-80 Removing file

-90 Renaming file

-100 Seeking to a file position

-110 Unlocking file

-120 Writing to file

Data file specific errors

-200 File is not a data file

-210 Unrecognized field name

-220 Unrecognized field type

-230 Record length too large

Index file specific errors

-300 Tag entry missing

-310 Not a correct index file

-330 Tag name not found

-340 Unique key error

Expression evaluation errors

-400 Comma or bracket expected

-410 Expression not complete

-420 Data file name not located

-422 IIF() needs parameters of same length

-425 SUBSTR() and STR() need constant parameters

-430 Number of parameters is wrong

-440 Overflow while evaluating expression

-450 Right bracket missing

-460 Sub-expression type is wrong

-470 Unrecognized function

-480 Unrecognized operator

-490 Unrecognized value

-500 Unterminated string

Optimization errors

-610 Optimization error

-620 Optimization removal error

-630 Optimization file flushing failure

Relation errors

-710 Relation error

-720 Matching slave record not located

Severe errors

-910 Unexpected information

-920 Out of memory

-930 Unexpected parameter

-950 Unexpected result

Memo Errors

-1110 Memo file corrupt

-1120 Error creating Memo file

See also Btreive error codes


Compiler Directive Examples

Navigation: Miscellaneous >

Compiler Directive Examples

 Print this Topic Return to chapter overview

#ALL_LOC

#endp //the other part of the #proc

#fmt //include screen/report forms in the TAS 3 style. See example.

#ForceRWN //will always create RWN file

#FormsEncrypted ThisIsTheEncryptionStringABCDEFG10101

//no quotes around the string

//the longer the better

#inc C:\TAS\INCLUDE //no quotes around file name.

//variables not allowed.

//extension is assumed to be .SRC

#incx C:\TAS\INCLUDE //no quotes around file name.

//variables not allowed.

//extension is assumed to be .SCY

#lib C:\TAS\LOOKUPS //no quotes around file name.

//variables not allowed.

//extension is assumed to be .LIB

#libx C:\TAS\LOOKUPS //no quotes around file name.

//variables not allowed.

//extension is assumed to be .LCY

#MainMenu //this program will replace default

//menu in runtime.

#proc //the first part of the PROC/ENDP block

#tdata 128 //adds 128k to temporary data buffer

#udx //will compile both UDCs and UDFs

#winform FirstScreen //no quotes around file name.

//you can specify path during compilation only.

Routines within a library (either #lib or #libx) must start and stop with a specific line. The beginning of the library routine must be a colon followed by the routine label name. It must end with a double colon. So, for example, a simple library routine that just displays a small message when the program calls the appropriate label:

:SimpleTest

#Proc

SimpleTest:

msg 'This is a simple test'

ret

#EndProc

::

Anything after the trailing double colon is ignored, so you can put anything you want there to help you document the routine. Notice the use of the #Proc/#EndProc directives. They are not required in a library routine, however, if you do use them they must be within the beginning colon and ending double colon.


Drop Down Lists

Navigation: Miscellaneous >

Drop Down Lists

 Print this Topic Return to chapter overview

Two of the buttons on the main screen in TAS Pro have drop down arrows to the right of the button. These are Open and Run. The Open button works for both Screen Forms and Source Files depending on what is active at the time. If you have opened forms or source files previously, or have run programs using the Run button option, the last 10 items will be displayed when you click on this drop down arrow. If there is nothing to show, no files will appear.

You will also have two other options in the drop down list, these are: Clear MRU List and Remove Obsolete. These lists are what is called Most Recently Used. That is, the last file opened or program run is at the top of the list. If you wish to clear the items on the list the choose the Clear MRU List and they will not redisplay. If you wish to check the list for files that no longer exist, then click on the Remove Obsolete. If the file (Screen, Source or Run) can no longer be found, it will be removed from the list.


TAS 3 FMT Style

Navigation: Miscellaneous >

TAS 3 FMT Style

 Print this Topic Return to chapter overview

If you want to include the older TAS 3 style forms in your 5.1 program you must include the #FMT compiler directive near the beginning of the program. This will alert the compiler to look for the appropriate lines and include them. A TAS 3 style screen form might look something like the following:

\s scr

element number: & (1 to 19)

All of these should change:

Name [& ]

Key [& ] Key num |& |

Array value (should equal number) &

\

n1

KEY_BUFF_NAME

KEY_NAME[n1] KEY_NUM[n1]

nn[n1]

\\

Note: It doesn't matter whether your put the field names on the same line or different lines.


Time Field Format Options

Navigation: Miscellaneous >

Time Field Format Options

 Print this Topic Return to chapter overview

The following are the various options for displaying (entering) the Time field:

TimeField5 HH:MM (24 hour spec, no AM/PM) (tf_5)

TimeField7 HH:MM AM/PM (tf_7)

TimeField8 HH:MM:SS (24 hour spec, no AM/PM) (tf_8)

TimeField10 HH:MM:SS AM/PM (tf10)

TimeField11 HH:MM:SS.MS (24 hour spec, no AM/PM) (tf11)

TimeField13 HH:MM:SS.MS AM/PM (tf13)

NOTE: If you are using the TTASTimeEnter object and check the ElapsedTime property for TimeField7, TimeField10 and TimeField13 the number of hours will increase by 2 and there will be no AM/PM designator. For example, TimeField7 would be HHHH:MM.

HH = Hours

MM = Minutes

SS = Seconds

MS = Hundreths of a second


Decimal Character

Navigation: Miscellaneous >

Decimal Character

 Print this Topic Return to chapter overview

In some countries the decimal character is the period (.) and in some it is a comma (,). To keep things standard in the compiler the decimal character will always be represented by the period.


Backup Files

Navigation: Miscellaneous >

Backup Files

 Print this Topic Return to chapter overview

When you save a form in the Screen Editor or a source file in the Source Code Editor the current file, if any, is copied automatically to a backup file. This will preserve the last form or source file prior to the current changes. The form (normally with the extension of .DFM) is copied to the same name with the extension of .BFM. The source file, normally with the extension of .SRC, is copied to the same name with the extension of .BAK.

Note : There is no backup procedure when using the program manager at this time. We may be adding a backup feature in the program manager in future version of TAS Professional powered by CAS.


Context Sensitive Help

Navigation: Miscellaneous >

Context Sensitive Help

 Print this Topic Return to chapter overview

You can get context sensitive help in both the Screen Editor and the Source Code Editor. In the Screen Editor right click on the object. A popup menu will be displayed. One of the options near the top of the menu will be Get Help Information. Click on that item and the appropriate page from the help file will be displayed.

In the Source Code Editor you can right click on the command or function in the command tree list (right side of the screen). You can also select the command or function in your source code file and then right click on the selected command/function. In either case the appropriate page in the help file will be displayed. If you didn't select the entire word, or too much, the help routine will tell you it couldn't find the correct item.

The above is the command tree in the source code editor.


Automatic Event Creation

Navigation: Miscellaneous >

Automatic Event Creation

 Print this Topic Return to chapter overview

Every object that has events connected to it can have a skeleton for those events created automatically in the source code. To accomplish this do the following:

1. The name of the appropriate source file must be in the TTASForm SourceFile property, or there must be source code attached to the form itself.

2. Left click on the object to select it.

3. Right click on the object to bring up a pop-up menu.

One of the options near the top should be: Add Object Events: name of object. If this is greyed out then you don't have a source file active for this form, that is, you don't have the name of an existing source file in SourceFile or the SourceAttached property is not checked.

4. Choose that option. Nothing else will happen, however, if you change to the source code editor, you should see lines added for the appropriate events, depending on the object.


FAQ

Navigation: Miscellaneous >

FAQ

 Print this Topic Return to chapter overview

FAQ Frequently Asked Questions

In this Section of the manual we are going to creat a catch all Q & A section this may include Email message found oun our TAS Professional Email user group http://groups.yahoo.com/group/taspro/join

Question: I am putting a path in the target and start in in a windows shorcut and its not working? .

Answer: If you pass a Path name in your Shortcut. You will ether need to make sure your path does not have any spaces. Or put your path in Quote mark (")

Example: ( Target: c:\TASprogram\tasruntime.exe Start in:c:\my Documents\tas) Will Give you and error.

(Target: c:\TASprogram\tasruntime.exe "Start in :c:\my Documents\tas") Will work.

Canvas does not allow drawing ERROR Message

I found this problem on Windows Vista..

If there is no default printer driver on the server computer, or if the "Permissions" for the default printer driver are not properly set, users may encounter the error message "Canvas does not allow drawing" in the report generation the report will not appear on screen. Sometimes this is the result of security software which has altered the permission settings of your printer driver.

Resolution:

1) Verify that a default printer driver is installed and specified on the print server computer. If there is none, install one using the MS-Windows "File/Add Printer" option on the Windows "Printers and Faxes" control panel. This problem took me several hours to find so I have posting this information here in the DOCS.


Work Station Setup

Navigation: Miscellaneous >

Work Station Setup

 Print this Topic Return to chapter overview

We have included a program you may use to configure workstations to use your programs. The program is controlled by the wssetup.ini file you can edit this file to make this program work for your systems.

Configuring a Workstation

Follow these instructions if you plan to have multiple workstations using TAS Professional over a network. You only have to perform a complete the installation once on your network. The machine on which you performed those steps is now already configured as an TAS Professional workstation, so you do not need to configure it again. Instead, follow these steps at all other workstations that will be running your application:

From each workstation run the program WSSETUP.EXE. This should be in the same subdirectory where you have installed your application. When the program is run it starts automatically, no other entry is required on your part. If it has been run before a dialog box will be displayed alerting you to that. It can't be run twice on the same workstation.

As each step is finished it will be displayed in the memo box on the form. When it's complete, the screen should look something like this:

The Close button will be enabled and you should just click it to exit the program.

During this process the program will create a local subdirectory called C:\ADVWS\. It will make a copy of the TASPRO.INI file in the original installation and place that in this subdirectory. That's the only file that will be here and can be deleted at any time.

On the user's desktop will be placed two icons, one for the Main Menu and one for Setup. You can delete either or both but then the user will have no easy way to start the program.

The user's computer registry will be modified for the Btrieve and TAS Pro settings.

The benefit of putting a copy of TASPRO.INI on each user's computer is the ability to do several things:

a) If the user accesses the server with a different drive letter then others, that's ok since the Data Dictionary Path and Default Path in the INI file is set properly for that user.

b) If the user wants different colors on his/her screen then other users, that's possible. Just run the TAS Setup program and adjust the colors as desired.

c) If the user has different email settings than other users, these can be setup strictly for this user also.

d) If the user wants to have the fax and email print options available, and others don't, or vice versa, that can be Setup also.

You need to make sure that both the Default Path and the Data Dictionary Path point to the location of the main installation on the server computer. This should be done automatically for you but it's a good idea to check and make sure the settings are correct.

If you are running workstations you need to make sure that the file locations in Maintain Location file have no drive letters. For example, if you would normally use C:\ADV7\ then use \ADV7\ only. We recommend that you use the path of .\ this way if you need to move the folder to another location these settings will work with no changes. The Default Path in the TASPRO.INI file will make sure that the user is logged on to the correct location. If you are going to access files on a different drive and you must specify a drive location then ALL must use that same drive location or you will get #12 errors (file not found) when trying to run the programs.

Repeat these steps at any other workstations that need to be set up to run your aplication.

You can repeat these steps for a workstation by deleting the C:\ADVWS\ subdirectory and the two icons on the user's desktop.

To Control this programs behavior there is a file named WSSETUP.INI

[CONFIG]

Title=ADV 7 Workstation Setup.

Local Path=C:\ADVWS

DfltRunPrg=ADVmenu_flex.rwn

Program name=Advanced Accounting Version 7 by CAS

Setup name=Advanced Accounting Setup

Run Icon Name=cas.ico

Setup Icon Name=cas.ico

Program Folder=Advanced Accounting

Debug=0

TAS6EVO=0

Allow Reinstall=1

Setup on Desktop=1

Create RT Setup=1

Clear Mail Setting=1

[Program]

Display Name=Advanced Accounting 7 by CAS

Icon file=Adv6.ico

[Setup]

Display Name=Advanced Accounting Setup

Icon file=Adv6sub.ico

Help file=adv7Docs.chm

[Error]

Who to Call=Computer Accouting Solutions

Number to Call=1-928-257-1236


How to convert from 2 - 3

Navigation: How to convert from 2 - 7 >

How to convert from 2 - 3

 Print this Topic Return to chapter overview

How to Convert TAS Plus 2 to TAS pro 3.xx

This document is a compilation of information from both Computer Accounting Solutions and the TAS 5.1 Manual Copyright by Business tools Inc. Licensed to Computer Accounting Solutions © 1985 -2002 by MGM Holding Inc. Last Updated 03/05/2009

TAS2 or TAS Plus

1.) run the program runs under Tas 2 to export the data to fxd writfxd.run This program writes out .t files and .f files the .t files are your exported dictionaries and the .f files is the tas2 data in fixed format.

Note: One time I Had a problem using this program it turns out there was nothing wrong with the program it had to do with problems in the tas2 Dict files. In this case a previous program had added some test files to the systems and they were no longer valid data after I deleted these problems went away.

2.) Copy your .t and .f files into your tas 3 project folder.

TAS Pro 3

3.) In the TAS 3.0 System there is a program file called cvrttdtf.run this program will convert the TAS 2 dictionary to the TAS3 Dict this program is run under tas 3

Note : If you are using the pervasive SQL database engine you will have to rebuild your TASDICT.M and TASFILE.M files to at lease ver 6.15 as version 9 will not write data to the 5.10 Btrieve format it will read but not write. If you get a btrieve error #46 "Access to the requested file denied" this is probably your problem.

4.) Now you need to init your files delete all the data files .m files except for tasdict.m and tasfile.m

5.) to create empty btrieve files use the CAS program called newinit.run this will create empty files.

6.) readfxd.run to import this data. This program read the .f file data into your data files. After this is run it might be a good idea to reindex all of the files in the system. But at this point you now have tas 3 data files.

After this is done your TAS2 or TAS + data is in TAS3 Btrieve type files.

See next


TAS 3 to 5.1

Navigation: How to convert from 2 - 7 >

TAS 3 to 5.1

 Print this Topic Return to chapter overview

TAS 3 to 5 and 5.1

INTRODUCTION

This chapter covers the process of converting from TAS Professional 3.0 or TAS Professional 4.0 to

TAS Professional 5.1. The amount of data to be converted, in the case of TAS Professional 3.0, or the

number of programs in both cases will determine the time involved to complete this process. In converting

both data and programs automated procedures have been provided to help you with this task. We appreciate your continued use of Computer Accounting Solutions (CAS) products and hope you find this process easier than

those in the past.

Converting from TAS Professional 3.0 to 5.1

With this new release we have reintegrated many of the commands and features of TAS Professional 3.0 to ease the conversion to this new version. These include allowing the characters #!$% in field names,

Continuing the old form of BCD numbers, creating the 4 external memory areas and several commands that we superseded in 4.0 are back. In general the conversion of programs and data should be straight forward and without troubles.

NOTE: This process assumes that you have created a new sub-directory separate from where TAS50 is

installed. If you haven't done so yet then please do that now.

The TAS50 sub-directory should only hold the programs provided by CAS. Through the use of the SET TAS50= and putting the TAS50 subdirectory in your path (both in your environment) you will be able to access the Pro 5.1 programs from any other drive or sub-directory on your computer.

Converting the 3.0 Data Dictionary

Convert 3.0 Data dict to 5.1

The first step in converting from 3.0 to 5.1 is to convert your data dictionary. This will bring all your Old field names into the new version. The 5.1 data dictionary is considerably different than 3.0. It is Now made up of 8 different files instead of 2.

The new ones include two different key information files; a defined field dictionary; a file relationships file; a file that holds the Btrieve initialization information for each file so that files can be initialized at a user site without the full data dictionary; and a listing of printers available. As explained above you should create a new sub-directory for this conversion.

For ease of explanation, we will assume that all programs are on drive C and that the new sub-directory you've created is C:\NEWPRGS and that the old sub-directory is C:\TAS30. For this conversion to work it doesn't matter what drive you're on, where TAS Pro 5.1 is, or what the name of the sub-directories

are. Just insert your names for the ones set here. The process is as follows:

1.) Create and log into the new sub-directory. Again, we're going to assume that you've created a sub-directory called NEWPRGS on drive C. When this is complete you should be at the DOS prompt in the new sub-directory: C:\NEWPRGS>

2.) Copy the data dictionary from the TAS Pro 5.1 sub-directory to C:\NEWPRGS. This would be

(we will not be showing the DOS prompt anymore but unless instructed differently you should always be at DOS): COPY C:\TAS50\FILE*.B This will copy the 8 dictionary files into your new sub-directory.

Also COPY c:\TAS50\ERRMSG.B

3.) Copy the OVL files: COPY C:\TAS50\*.OVL This will copy 2 files; TAS50.OVL and TASCOLOR.OVL.

NOTE: It has come to our attention that old data from TAS3 could have Y2K Issues and you need to be aware of this. This data can be repaired by writing a program to make Y2K adjustments to the short dates stored in TAS3.

Set Configuration

4.) Run the Set Configuration program by typing at the DOS prompt: R50 C:\TAS50\TASCINFO

This should bring up the Set Configuration program Move the cursor to the Default Dictionary Path near the bottom of the screen. Do this by pressing the ENTER key until the cursor is in that field. If you haven't made any changes in the TAS50 sub-directory then this field should be blank until you reach it. Then

Your current sub-directory should be automatically filled in. Press the F10 key and answer Y to the save question. The program will exit and return you to the DOS prompt.

Convert Dictionaries 3 to 4 or 5

5.) Now we're ready to convert the old dictionary. Type the following at the DOS prompt:

R50 C:\TAS50\CNVTDICT

Note : If you are using the pervasive SQL database engine you will have to rebuild your FILE*.B and ERRMSG.B files to at least ver 6.15 as version 9 will not write data to the 5.10 Btrieve format it will read but not write. If you get a btrieve error #46 "Access to the requested file denied" this is probably your problem.

The program will ask, at the top of the screen, for the location of TASFILE/TASDICT. At the bottom of the screen it should say Dict Path: C:\NEWPRGS\ (or whatever you named this subdirectory). IF IT DOESN'T STOP NOW AND RECHECK STEPS 1 THROUGH 4. Enter the location of the 3.0 dictionary, in this example you would enter: C:\TAS30\

6.) Next the program ask you for Schema name. We're going to assume that you want to convert the entire dictionary so you'll just press ENTER here and put no value in the field. However, if you want to convert just a single schema/FD you would enter the name here, or you can also use wildcards, i.e., BK*, or BKAR*, etc.

7.) You will now be asked whether or convert from the old form BCD to new type fields. This will convert all your 3.0 N type fields to new 5.1 N type. If you answer N here they will be converted to 5.1 O type (old BCD) fields. In either case both T (time) and D (date) fields will be converted to the new format that is in keeping with what Btrieve expects for those type fields. The decision to convert your BCD fields hinges on two questions you have to ask yourself. First, if you are going to want to access your Btrieve data with other programs they cannot understand the BCD format. You will be forced to convert to the new floating point type. We Recoment you answer this questions YES..

Second, if you are using overlays as keys and part of these overlays are N type fields when they are converted you will need to reset those as segmented keys instead of overlays. This is accomplished by using the Data Dictionary Manager explained in Chapter 3. This is again in keeping with what Btrieve, and other applications that access Btrieve, expect. If you aren't interested in accessing your data with other programs then you should answer N here. This will give you the most compatibility with the 3.0 version.

NOTE: In either case the program will convert your date and time fields to the new format. Internally they are still only 4 bytes, however, the data itself is different. This means that any overlay keys you have that include a date or time field will have to be converted to a segmented key. This is a relatively easy process. You would run the Data Dictionary Manager choose that schema (what we now call FD - file descriptor), press ^K (CTRL+K), and choose the offending key from the list. At the entry fields you will see the overlay as the only segment in the list. You will enter each field in the overlay in the order they appear, one to each segment. Save the key info, save the FD, reindex it and you're done.

initialize the new files

8.) The next step is to initialize the new files. Again, at the DOS prompt type:

R50 C:\TAS50\INITALL

It will ask for the files to be initialized. Just press the ENTER key for all. Next it will ask for location. At this time we'll assume that all the files will be in the current sub-directory so press ENTER again. As each file is initialized a message about this will be displayed on the screen. The process continues until all files are initialized. If for some reason a file you are creating using this method already exists in the current sub-directory you will be asked whether or not you wish to initialize it. Generally you would answer Y. If you have followed these instructions this shouldn't happen.

9.) At this point you have created your new data dictionary and you can either convert the data now or the programs. Since we're already in the middle of the data we'll continue with that. However, should you want to convert programs now instead skip to the next step and then

return here when you are ready for the data.

NOTE: Converting the data can take a considerable amount of time depending on the size of your files, speed of your computer, etc. We suggest you do this over a weekend or at least overnight. The process is automatic once it starts and shouldn't require any further input on

your part. Should something happen during the conversion, power failure, etc. and you wish to restart then delete all the new files (don't delete the data dictionary files), go back to step 8 and initialize again and then do this step again.

NOTE: This process changes your old data dictionary. You should make a backup of TASFILE.M and TASDICT.M so that should you need to make further changes to any 3.0 programs you will have a good data dictionary.

From the DOS prompt type the following:

R50 C:\TAS50\CNVTDATA

Again, the program will ask for the location of TASFILE/TASDICT. This should be the same path you entered in step 5. Next it will ask for the files to be converted. Again, press just the ENTER key for all files or put in the FD name as appropriate (you can use wildcards). As each

file is converted the name of the file and the number of records remaining will count down to 0. The program will automatically go from one file to the next until all are converted.

NOTE: One of the biggest problems you can have here is if the old file doesn't exist. If that occurs the program will display an error message on the screen and wait for a response. If you aren't there the computer will patiently wait until you get back. This can be a problem if you

did this overnight and expect all the files to be converted in the morning. So, try to be sure that there is a file that exists in the appropriate sub-directory for each you are going to convert, or,plan to check the computer several times during conversion.

10.) We're now ready to convert the programs. There were two different options for source code in TAS Professional 3.0. They were .SRC or .EDT files. If you edited programs with the source code editor you have .EDT files. If you used a text editor then you probably have .SRC files, although, many people learned the codes for the .EDT format and, due to limitations of the editor, learned how to program by the numbers. In TAS Professional 5.1 there's only one format, .SRC. The editor can handle this format and it's the same file if you wish to use a text editor.

The conversion program doesn't care which you used, although, you can only convert one type

at a time.

To start the conversion program type: R50 C:\TAS50\CNVTPALL The first question it asks is what type of program you're converting. Since this is the 3.0 conversion you will enter either E (.EDT type) or S (.SRC type). Next enter the file path and name, wildcards are acceptable. So to convert all the BK*.EDT programs in the TAS30 subdirectory you would enter E for the program type and then the following for the file name(s): C:\TAS30\BK*

The program will then ask if you wish to convert DEFINE fields that are type N from BCD to new form floating point. In this case you would answer N if you have DEFINEd overlays in which one or more of the fields is an old form BCD.

Convert TAS5 Dicts to TAS7

Convert Data Dictionaries to Codebase

There is one more step you have to make to have your programs run under TAS Professional 7 powered by CAS runtime you have to run the convert codebase dictionaries. If you are here now is where the real work begins converting these programs from the old DOS type screens to the new Windows screens can be time consuming. Most of your program will run with no problem using the new runtime.

If you have any questions or need help in converting your applications we will try to help you by email support@cassoftware.com with your questions.


Converting 3.0 Programs

Navigation: How to convert from 2 - 7 >

Converting 3.0 Programs

 Print this Topic Return to chapter overview

10.) We're now ready to convert the programs. There were two different options for source code in TAS Professional 3.0. They were .SRC or .EDT files. If you edited programs with the source code editor you have .EDT files. If you used a text editor then you probably have .SRC files, although, many people learned the codes for the .EDT format and, due to limitations of the editor, learned how to program by the numbers. In TAS Professional 5.1 there's only one format, .SRC. The editor can handle this format and it's the same file if you wish to use a text editor.

The conversion program doesn't care which you used, although, you can only convert one type

at a time.

To start the conversion program type: R50 C:\TAS50\CNVTPALL The first question it asks is what type of program you're converting. Since this is the 3.0 conversion you will enter either E (.EDT type) or S (.SRC type). Next enter the file path and name, wildcards are acceptable. So to convert all the BK*.EDT programs in the TAS30 subdirectory you would enter E for the program type and then the following for the file name(s): C:\TAS30\BK*

The program will then ask if you wish to convert DEFINE fields that are type N from BCD to new form floating point. In this case you would answer N if you have DEFINEd overlays in which one or more of the fields is an old form BCD.

NOTE: ** VERY IMPORTANT ** This conversion routine converts your old programs line-for-line. However, if you have DEFINEd overlays you need to make sure, after conversion, that the entire block of DEFINEs is at the beginning of the program. This is due to the way the 5.1 compiler adds fields to the field list during compilation. You may think you've got a contiguous block of data in memory but in reality you may not. By putting all the defined fields in that block at the beginning of the program you can be assured, they will be contiguous

in memory at runtime. This only applies to those DEFINEd fields that are also part of a DEFINEd overlay.

Once you enter the file name(s) the program will start the conversion process. During conversion the defined field are first located so that the screen/report formats can be converted properly. Next the lines are converted to the 5.1 .SRC format. As each line is converted the

program displays the line number and the percentage completed. Due to differences in programs and the process required the percentage will probably never be exactly 100 upon completion and is meant to be an approximation only. This process is very fast and should take

less than an hour. However, this is very dependent on the number of programs you're converting and the speed of your computer.

When this process is complete you should have a file in the new sub-directory with the same name as the program in the old. These will all have the extension .SRC.

Compile the converted programs

11) The next step is to compile the converted programs. We have found 3 general problems in this conversion process and they show up here. They are:

A) Multi-defined fields. In TAS Professional 3.0 you could define a field in a program several times and never get an error. This caused many problems when running, especially if you defined the field as one type at the beginning and another further down in the program. The compiler would always use the last DEFINE command so you would think the field was alpha when it was actually numeric and might spend hours trying to figure it out. In 4.0 we solved this problem and gave a syntax error for multiple defines. In 5.1, with the push to convert 3.0 code, we have made this a warning error in the compiler, and the DEFINE command itself will be ignored. This means that only the first DEFINE will be effective. The warning error is displayed, printed or sent to the .ERR file as appropriate. You should make sure that none of these are going to effect your program. However, if these are all the errors you get, the program will compile successfully and you will be able to run the program. This happens alot in many programs.

B) Another problem that was not caught by the 3.0 compiler was extra parentheses in an expression. In 5.1 the expression compiler is much more sophisticated and catches those kinds of errors. There's no way to tell which ones are just conversion and which are actually bad so this does become a syntax error and needs to be fixed before you can compile the program. This is generally not a big problem, and only happens occasionally.

C) The last is when your program accesses TASFILE or TASDICT fields in the dictionary. Since the data dictionary has changed completely so have the field names. If you have a program that does this you will have to go through it and change these references yourself. This should be very rare and shouldn't take you much time at all. We decided not to put this in the conversion routine due to the time it would take to check each and every field on the off-chance one of them was a TASFILE or TASDICT field. The corresponding field

names for those old dictionary files are:

OLD NEW FILE

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

DICT.NAME DICT_FIELD_NAME FILEDICT

DICT.SCHEMA DICT_BUFF_NAME FILEDICT

DICT.SKEY DICT_OVERLAY1 FILEDICT

DICT.OFFSET DICT_OFFSET FILEDICT

DICT.TYPE DICT_TYPE FILEDICT

DICT.SIZE DICT_SIZE FILEDICT

DICT.DEC DICT_DEC FILEDICT

DICT.UPCASE DICT_UPCASE FILEDICT

DICT.KEY KEY_NAME2 FILEKEY

DICT.KEYN KEY_NUM2 FILEKEY

DICT.OVLY DICT_TYPE3 FILEDICT

DICT.SIZEH Internal size is calculated at runtime.

DICT.ARRAY DICT_ARRAY_ELE FILEDICT

DICT.DECH DICT_HDEC FILEDICT

DICT.SIZEHLD DICT_HSIZE FILEDICT

DICT.OFFH DICT_HOFFSETFILEDICT

BTLFNAME LOC_FILE_NAME FILELOC

BTLSCHEMA LOC_BUFF_NAME FILELOC

BLTMLOC LOC_LOCATION FILELOC

1 This is actually no longer a field but just a key. If you try to set this equal to something

you will get a field not found error during compilation. You need to set the

DICT_FIELD_NAME and DICT_BUFF_NAME equal to their individual parts and then

just use the key.

2 With segmented keys the whole key structure has been separated from the fields. There

really is no need anymore for key names to exist in the field structure so these are a little

more difficult. You can either use these fields, which are 24 element arrays, or use the

fields in FILEKNUM. A single record exists in this file for each key. The key name is in

KNUM_KEY_NAME and the number is in KNUM_KEY_NUMB.

3 Overlays are now just a separate type of V.

12.) The conversion process is now complete. All that's left is to run the programs. If you desire

you can slowly (or quickly) add the new features of TAS Professional 5.1 or you can just stick

with the 3.0 code. In fact, we have converted the 3.0 editor/screen painter/report writer so that

you can continue to edit program in 3.0 .EDT format. You will have to convert them to 5.1 before they can be compiled but that takes just a few moments, as you can see. The decision is yours.


Converting from TAS Pro 4.0 to 5.1

Navigation: How to convert from 2 - 7 >

Converting from TAS Pro 4.0 to 5.1

 Print this Topic Return to chapter overview

Converting from TAS Professional 4.0 to 5.1

There are several new commands in 5.1 and some new features. These include larger source code sizes,

virtually no limits on compiled segment sizes, full use of extended memory, and many more. We have

also returned to the 3.0 method of combining screen and report formats in the source code. However,

we've also given you the option of keeping some or all as separate files on the disk.

There are three commands that no longer exist. These are LOAD, CALL and RELEASE. All three

dealt with .BIN files and there are better ways getting the same results. Either use the INT command or

run an external program. With extended memory the programs would not have run and would have shut

down your system. Also, we have eliminated the source code library management routines since we've

made the other changes. There's no longer any need to limit your source files to 64k maximum nor keep

all those different .SCP/.SRP/.SRB files. If you have source code in one of these maintenance files it

will have to be exported before it can be converted to 5.1

NOTE: This process assumes that you have created a new sub-directory separate from where TAS50 is

Installed. If you haven't done so yet then please do that now. The TAS50 sub-directory should only

hold the programs provided by CAS. Through the use of the SET TAS50= and putting the TAS50 subdirectory

in your path (both in your environment) you will be able to access the Pro 5.1 programs from

any other drive or sub-directory on your computer. This process assumes your TAS Professional 4.0

programs and data are located at C:\APP40\

The following are the steps to converting to TAS Professional 5.1:

1.) Create and log into the new sub-directory. Again, we're going to assume that you've created a

sub-directory called NEWPRGS on drive C. When this is complete you should be at the DOS

prompt in the new sub-directory:

C:\NEWPRGS>

2.) Copy the OVL files:

COPY C:\TAS50\*.OVL

This will copy 3 files; TAS.OVL, TAS50.OVL and TASCOLOR.OVL. You can delete or just

ignore the TAS.OVL file. We have included it in the distribution set for the program

TASEDP30.RUN only.

Set Configuration

3.) Run the Set Configuration program by typing at the DOS prompt:

R50 C:\TAS50\TASCINFO This should bring up the Set Configuration program as explained in Move the cursor to the Default Dictionary Path near the bottom of the screen. Do this by pressing the ENTER key until the cursor is in that field. If you haven't made any changes in the TAS50 sub-directory then this field should be blank until you reach it. Then your current sub-directory should be automatically filled in. Press the F10 key and answer Y to the save question. The program will exit and return you to the DOS prompt.

Copy the data dictionary

4.) Copy the data dictionary and files from the old sub-directory to the new:

COPY C:\APP40\*.B* Your data and dictionaries are now converted!

Note : TAS 4, 5 and 5.1 use the same dictionary files there is not need to covert them.

Converting 4.0 Programs to 5.1

NOTE: The conversion routine creates files with the same name and extension as those being

converted. Because of this you will want to make sure that the 4.0 source files are in a different sub-directory from the sub-directory where you plan to put the converted files. If you don't you will end up with files that are 2 bytes long! The conversion routine doesn't change the original file so you can safely use the original source files in their original location and just make sure you're saving the converted files to a new sub-directory. This would already be the case if you followed the instructions at the beginning of this section.

convert the programs

5) We're now ready to convert the programs. To start the conversion program type:

R50 C:\TAS50\CNVTPALL

The first question it asks is what type of program you're converting. Since this is the 4.0 conversion you will enter 4. Next enter the file path and name, wildcards are acceptable. So to convert all the BK*.SRC programs in the APP40 sub-directory you would enter 4 for the program type and then the following for the file name(s): C:\APP40\BK*

The program will then ask you if you wish to append any #INC (include) files that are referred to in the source code. It will also ask if you wish to add screen and report formats. If you answer Y here and the format is NOT found the MOUNT command in the source code will be changed to MOUNT fmt_name xxxx EXTERN. This signifies that the format for this particular MOUNT is external (or outside) of the source code. If you answer N here then the compiler directive #EXT_FMT will be added to the beginning of the program. This tells the compiler that all formats are external to the source code.

Once you enter the file name(s) the program will start the conversion process. The conversion process from 4.0 to 5.1 is actually very simple. If you don't include screen/report formats and you don't append #INC files all you need to do is copy all the *.S* files from the C:\APP40\

sub-directory and then add the #EXT_FMT compiler directive to the beginning of each main source file.

You also need to run the CHKZEROS program to make sure there are no lingering binary 0s in any of the source files. If you run the conversion routine it will do this for you.

When this process is complete you should have a file in the new sub-directory with the same name as the program in the old. These will all have the extension .SRC. The conversion utility doesn't know whether or not the source code is part of another program or separate so all .SRC files will be converted and copied over. If you've appended the #INC files you can delete all those not necessary since they've been included already.

NOTE: This process does not effect library files. Those will still be separate.

compile the converted programs

6.) The next step is to compile the converted programs. You should get no errors that didn't appear in the 4.0 programs. You may need to change the records in COMPINFO.B. We've found that just a single DEFAULT record will probably suffice since you can set the default

values so high.

7.) Your conversion from 4.0 to 5.1 is now complete. We hope you enjoy the new features and all That memory!

At this point depending upon what version you came from most of your programs should work as they did before you may need to make some small changes however to get the benefits of each upgrade you will have to modify the programs with these new features in mind. In some cases you might be best to rewrite your application.

Since writing this we now have TAS Professional 7. This is a full windows GUI programming system featuring Screen painter, report formatter, Code editor/compiler/WINDOWS INSTALLER. It can run your TAS 5.1 program after they have been compiled using TAS 7 or run compiled under TAS5. At one time BTI release a product called TAS6EVO with TAS 7 powered by CAS you do not need this program any longer. This is good news because this program now becomes the windows runtime for TAS pro 5.

Convert Data Dictionaries to Codebase

There is one more step you have to make to have your programs run under TAS Professional 7 powered by CAS runtime you have to run the convert codebase dictionaries. If you are here now is where the real work begins converting these programs from the old DOS type screens to the new Windows screens can be time consuming. Most of your program will run with no problem using the new runtime.

If you have any questions or need help in converting your applications we will try to help you by email support@cassoftware.com with your questions.


Introduction

Navigation: Tutorial >

Introduction

 Print this Topic Return to chapter overview

TAS PROFESSIONAL TUTORIAL

Powered By CAS

To contact us

Computer Accounting Solutions

2736 Colorado

Kingman AZ, 86401

P. 928.257.1236

Email: support@cassoftware.com

Web site : http://cassoftware.com

INTRODUCTION

TAS Professional is designed to be a complete application development tool for graphical operating systems. It provides application building tools for the programmer new to application development, as well as the seasoned developer demanding professional quality development tools designed to work together from the beginning. These powerful utilities include:

Data Dictionary Manager

Database Maintenance Programs

Form Editor

Report Editor

Source Code Editor

Runtime Compiler

Program install builder

2 Database Managers to Choose from

TAS Professional includes over 150 commands, each with many options, and over 230 functions that can be used in expressions. Many of the TAS Professional commands can be compared to macro functions found in other high level languages. In other words, a single TAS Professional command can often replace several entire lines in other languages. Add to this the ability to create User Defined Commands (UDCs) and User Defined Functions (UDFs), and you now have a very powerful development tool.

Currently, TAS Professional runs only on the Windows® operating system, however, in the future we plan to run on Linux systems and directly on the Internet. Due to the design of TAS Professional, any programs you create to run on Windows® will run, without change, on these other platforms also. You will be able to change database managers at will. You won't even need to recompile the programs! This means that from the same set of programs you can have some users running Windows® some running Linux, maybe others on platforms to come, and all can be running the exact same set of programs accessing the same database. This is what we like to call write once run anywhere.

We also have plans to introduce other database engine to be used so you the programmer can decide what database engine is best for you or your customers.

What TAS Professional isn't? You're not going to write an operating system with TAS Professional. It isn't meant to replace programs like C++ or Delphi®. It was designed to give you the capabilities to easily and quickly develop general purpose business/financial programs with a graphical user interface (GUI). So, TAS Professional is also much easier to learn and use than C++ or Delphi®. Also with TAS Professional you do not need to buy any other software to develop very powerful scaleable solutions for yourself or for customers. When your ready to deploy your application to others all you need to do is purchase a nominally priced runtime for each server that will be using your application. Also with our new program manger you can reduce the numbers of files on the server from hundreds to only 3.

Programs compiled using TAS Professional requires a runtime program (TASRUNTIME.EXE) to execute. This reduces compilation time to a fraction of what's required for those other languages and produce very small runtime programs. Instead of multi-megabyte executables, you end up with a program that might be 50,000 bytes. It's this runtime program that gives you the ability to run the same program on multiple OSs, different platforms, eventually even totally different computer types with no changes required. Our term for this is: "Real write once/run anywhere." Truly, you'll only have to write it once, and you'll really be able to run it anywhere we have an appropriate runtime.

One of the reasons TAS Professional is so flexible and powerful is that it is built around a Data Dictionary. The Data Dictionary is a special TAS Professional data file that is used to keep track of every specification of every field in every record and file you create. This means that once you define a field you never have to worry about defining it again. Each time you want to use that field in a program, TAS Professional automatically looks up the specifications in the Data Dictionary. Storing the specifications in this way greatly increases the ease and speed with which you can create multi-file applications. By using similar fields with the same characteristics in different files, you can retrieve related records, such as finding all invoice records based on a given customer code.

TAS Professional uses Btrieve (copyright Pervasive Software) or CodeBase (copyright Sequiter Software) to perform all data file I/O, record and file locking in a multiuser system. A significant benefit of either of these is speed.

With TAS Professional you can typically find any record in a data file in one second or less. With smaller databases, finding a record can be almost instantaneous. Saving or updating records is equally fast. In addition, the speed is consistent regardless of the file size. It takes virtually the same amount of time to save a record in a file with 100,000 records as it does in a file with 1000 records. Even more important, you aren't forced to have a dedicated server with expensive software. In fact, if you have 5 users or less you don't need a dedicated server at all, unless you choose to.

TAS Professional allows up to 24 different sorts (keys) to be maintained on-line for each data file. With TAS Professional, you never have to re-sort a data file just to find a record

We will discuss the other parts of TAS Professional much more as you get deeper into the tutorial. So, let's start!


Getting ready to run the tutorial

Navigation: Tutorial >

Getting ready to run the tutorial

 Print this Topic Return to chapter overview

Since this is your first time using TAS Professional , let's start at the very beginning.

1. On your desktop there should be three new icons, or a new program group has been created in your Start->Programs list. This tutorial assumes that you have the icons on your desktop. Click on the TP Setup icon. The following form will be displayed.

2. The display above assumes that you have installed TAS Professional in the C:\TASPro\ subdirectory. Your data dictionary path may be different. NOTE: Make sure that the Use CodeBase option is checked.

3. Click on the Set Dev Path button. A form allowing your to enter a new development path will be displayed.

4. Click anywhere in the path entry field after the current path. This will put the cursor at the end of the current path. Enter TUTORIAL and click on the OK button. Using the above example you're entry should be something like: c:\TASPro\tutorial. The program will automatically add the trailing slash ("\") at the end.

5. This directory was setup for you during installation. Click on the OK button and you will be back at the main setup screen. Click the OK button again and the program will exit. You have now setup the development directory and the proper data dictionary location.

NOTE: You can still access programs in other subdirectories. By defining a development directory that becomes your default directory until you change it using this same process.

6. Click on the TAS Pro icon, the main development screen above should be displayed. To double check your setup. Click on the Program menu choice at the top of the screen. Then click on the Current Configuration menu item. The screen below should be displayed. Make sure the values are correct. If they aren't go back to step 1 above and start over again.

7. You won't be allowed to make any changes to these values here; this is just to display the current information. Click on the Exit button to close the configuration screen and exit the program.

You are now ready to begin the tutorial. You can exit the tutorial at any time and restart. Until you change the Development path using the setup program each time you start TAS Professional you will start in this subdirectory.


A brief introduction to Databases

Navigation: Tutorial >

A brief introduction to Databases

 Print this Topic Return to chapter overview

Before you begin the tutorial, please spend just moment learning about the structure of files in a database and the tools you might use to manage the information contained in those files.

Database Fields, Records, and Files

One way to visualize a database is to think of it as a table of rows and columns. In fact, this is the classic manner in which databases are described in computer literature. In the example shown below, each horizontal row of the table is considered a record and contains all the data about that person. Each vertical column is considered a field.

Let's say you wanted to find the address of Bill Smith. First you would go vertically down the Name row until you found the Smith record. Then you would go horizontally across the columns until you found the Address field.

In a sense, a similar type of thing happens when TAS Professional searches for the Smith address. The difference is TAS Professional can search thousands of records in the time it takes you to search only a few. This is one of the real strengths of a computerized database like TAS Professional.

In TAS Professional, the term database is used to describe a related group of information in an application. Data file is used to refer to a specific file in the database. In a database with one file the data file is the database.

File Managers, DBMSs and ADEs

There are basically three general categories of database programs. Each is designed to do different things. The simplest form of a database program is called the File Manager. As the name implies, this type of program is designed to manage a single file at a time.

The advantage of a File Manager is that it is fairly easy to learn and use. The disadvantage is it doesn't do very much. File managers allow you to add, delete, and search for records in only one file at a time. Because of this, they typically aren't used for serious business applications.

You could use a file manager to computerize the index card file in the previous example, since that database contained only one file. Let's say you then wanted to add a second file such as a Sales Journal to your database. At that point a simple File Manager would no longer work. You would need a DBMS (Data Base Management System) to manage two or more files.

A DBMS is more sophisticated than a File Manager and because of this it is usually more difficult to master. However, a DBMS gives you several advantages over a simple file manager since you can have multiple files active at the same time.

Even more important, a DBMS lets you relate files to one another. This is done by selecting certain fields that appear in more than one file. For example, you might have a Customer File which contained a field called Custcode (short for customer code). If a related field (perhaps named SO.CUST.CODE) also appeared in our Sales File, it would be possible to relate the two files. (See the figure below.)

relating files can be very important in creating real world database applications. Let's say you want to send a "valued customer" letter to each person in your Customer File who has made a single purchase of over $500. To do this you will need to search both the files shown above. First you will search the Sales File for records in which the Amount field is over $500. When you find one, you will need to find out who the customer code belongs to. You accomplish this by relating the record via the SO.CUST.CODE field to a record in the Customer file with a matching Custcode field.

The next step up from the DBMS is the ADE or Application Development Environment. ADE's are systems used to create other programs (applications). Typically, ADE's include a powerful DBMS plus utilities to create custom menus, data input screens and sophisticated reports. These systems are also sometimes called IDE, Integrated Development Environment.

TAS Professional is a very special program since it can be used as an ADE, as a DBMS or as a File Manager. It combines two powerful DBMS with a programming language and an easy-to-use "interface." Making TAS professional a very powerful IDE

Now you're ready to start working through the tutorial. You'll learn to create, link, and maintain data files; add, change, delete, and search for records; and build and then enhance a simple application with a customized data input screen and error-checking. Then you'll create reports to summarize and print your data, and develop a menu for using your application. Finally you'll learn how to restructure data files and modify an existing application program. In short, you'll see how easy it is to use TAS Professional.

If you still have TAS Professional loaded than you're ready to start. If not, please click on the TAS Pro icon or choose the program from the Start->Programs->TAS Professional list.

NOTE: When you see "enter," it means type in the appropriate command or data and press the ENTER key. When you're just supposed to press the ENTER key by itself, it'll say that. Now; let's get started!


Part 1 - Creating a Database

Navigation: Tutorial >

Part 1 - Creating a Database

 Print this Topic Return to chapter overview

PART 1 - CREATING A DATABASE

In this section you will create a Customer data file using the Maintain Data Dictionary option from the Program menu (Program is one of the menu choices at the top of the screen – see below).

NOTE: To make a menu choice you first click on the header, in this case Program, and then enter the appropriate choice character (the character that is underscored), or click on the menu option line.

All TAS Professional files must be 'defined' in the Data Dictionary before it can be accessed by any program. This will tell the program how many fields there are, the type and size for each field, and what fields, or group of fields, are to be used as keys (or indices).

Using the Maintain Dictionary Option

In this example you will create a database to manage the following information about your customers:

1. Code 7. Zip

2. Name 8. Area Code

3. Company 9. Phone Number

4. Address

5. City

6. State

You will use the Maintain Dictionary option to create a database with these 9 data fields. When you are finished you will have a working database. You can then add records to it. You can also change, delete or search for records and use these fields in programs or reports you create.

If you have chosen Maintain Data Dictionary from the Program menu as described previously the following screen will be displayed.

Click on the New button. The following screen will be displayed.

In the entry space highlighted above enter the FD name: CUSTOMER. Then click on the OK button. This is the name of the structure for the file you are creating. Through the use of the Data Dictionary you can have multiple files that use the same structure, also known as the File Descriptor (FD). In most cases, however, you will always have a file that has the same name as the FD. This isn't required but is easiest when trying to remember the FD and/or file name. In this case you will use the same name for both.

NOTE: If you have already started this process and want to edit the FD again, or add to it, enter the name in the main screen (where it says ENTER FD NAME HERE) or click on the drop down button and choose it from the list displayed. Then click on the Edit button and the current FD information will be displayed.

Since you're just entering a new FD there are no lines currently displayed. To enter new lines for this FD just click in the first column of the grid (the Long Field Name column). Type in CUSTCODE (the first field in this FD) and press ENTER. The cursor will automatically move to the Short Field Name column.

NOTE: The CodeBase data manager uses a standard DBF type format. This format restricts the field names to 10 characters, where TAS Professional uses a standard 15 character field name. To avoid having to reduce the number of characters in all fields to 10 we provide you with the capability to specify a long (15 character) and short (10 character) field name. If you plan on accessing the DBF files using programs other than TAS Professional you should use a name here that means something to you. These won't be used in your programs.

If you want to enter a short field name that will mean something to you in the future than do so now, otherwise just press the ENTER key and the program will automatically fill in this column.

The next entry is the field type. To get a list of the choices available click on the drop down button. The available types are A - Alphanumeric, N - Numeric, D - Date, T - Time, L - Logical, B - Byte, I - Integer, R – Record, M - Memo. Since this field may contain any printable character including numbers, letters, and symbols, enter A for alphanumeric.

Next you will enter the field size. Type 3 and press ENTER. This will make the field 3 characters long.

Next is the number of decimal characters. Because this field is type A (alphanumeric), it is bypassed automatically.

The next entry is the number of array elements for this field. For this field it is 0 since you're keeping just one customer code for the record.

NOTE: A word about arrays. An array allows you to keep multiple values of the same type using the same field name and changing just the element number. This is useful when keeping track of certain types of information, for example, sales by month. You might have an array called MONTHLY_SALES with 12 elements. Element 1 (corresponding to the sales for month number 1) would be MONTHLY_SALES[1], element 2 - MONTHLY_SALES[2], etc. to element 12, MONTHLY_SALES[12]. Since you can use any legal TAS Professional expression as the element specifier (the value within the square brackets), this becomes a very flexible way of accessing field values. For example, using the same field as above the amount of a sales order might be saved in the monthly sales field as follows:

MONTHLY_SALES[month(date())] = TOTAL_ORDER_AMT

This would save the value of TOTAL_ORDER_AMT into the element of MONTHLY_SALES that corresponds to the month of the current date. (date() returns the current system date and month() returns the month number (1-12) of a date value. In this case TAS Professional first gets the current system date and then the month number of that date. This is then used for determining the element number in MONTHLY_SALES. If the date is August 10, 1992 then the element number is 8).

The next entry is Upper Case. Since this is an alphanumeric field you can force the entry to all upper case characters only. Since this is a code that you will be using to search for customers you will want to make sure that all characters are entered in upper case. The codes: abc and ABC are not the same to a computer. You might not check all the possibilities when searching for the customer and the code 'abc' would come after any ZZZ codes so you might not even see it in a list. To force the field to upper case you can either click on the check box or press the space bar, both will put a check mark in the box.

You can then enter a 40 character description for this field. This is to help you document the fields within the FD.

After you press the ENTER key at the Description field the program will move to the next line in the grid.

NOTE: If you made an error or if you want to change something, you can go back to that line by click in the appropriate row and column. You can also press the ESC key to exit the editing mode and then the UP and DOWN ARROW keys will allow you to move around the grid. You can make any changes to an FD as desired without concern since you will be allowed to decide whether to keep any changes made at the end before the program updates the data dictionary.

The program automatically moves to the next line. In this case, since you are entering a new FD, the cursor is again at the end of the list. At this point you're ready to enter the next field. Use the field specifications in the following table for the rest of the fields in the Customer data file. (The Array sizes are 0.)

NOTE: It is very easy to manipulate grid lines. To insert a new line press the ESC key to exit editing mode. Then press the INSERT key. A blank row will be displayed immediately above the current row. To delete a row again press the ESC key to exit edit mode and press the DELETE key. To return to edit mode all you have to do is press the ENTER when the cursor is in the appropriate column.

Entering Keys for CUSTOMER Database

After you have entered the rest of the fields you are now ready to specify the key fields. Key fields are used to determine the way a database or file is searched or sorted. To enter the keys click on the Keys tab as shown above.

The program will display the screen above. Click on the New Key button to add a new key. This will set the Order to default to Ascending, Modifiable and Duplicates will both be set to True (there will checks in the boxes next to the option) and Ignore Case will be set to False (no check in the box).

The first step is to enter the key name. For this first one enter CUSTCODE.

NOTE: The key name does not necessarily have to be the same as a field name; however, if there is only one field as a part of the key you should use the field name. You can click on the drop down button to get a listing of fields for this FD.

The next entry is whether the key will be sorted in Ascending (increasing) or Descending (decreasing) order. Normally this would be ascending. In this case press the ENTER key to accept the default.

If you don't care whether or not a key value changes after the initial entry the Modifiable option should be checked. Press the ENTER key to move to the next option.

This next field, Duplicates, can restrict whether or not duplicate keys can be saved. Since this is the customer code you don't want to allow duplicates press the space bar or click on the check box to set this option to no duplicates allowed. Press the ENTER key to move to the segment entry grid.

NOTE: When the cursor moves to a check box the description (or, if there is no connected description the box) will be surrounded by a dashed line. If you want to check (or un-check) the box you have two options; you can click on the box with the mouse, or you can press the space bar on your keyboard. Both will reverse the current setting for the check box. When a check box is set (checked) the value associated with that box is either "Y" or True. When it is clear (un-checked) the value is "N" or False.

Then comes Modifiable. If you set this flag to False (the box is not checked), then the user will not be able to make changes to the index field once it has been saved. In this case we want to allow changes, so leave this box checked.

Press the ENTER key again and you will come to the Ignore Case flag. If you check this box then when the record is saved the program will set the index field(s) into upper case before the index itself is updated. This has no effect on the actual field, just the index. However, by setting the index into all upper case characters the records will sort as though the user entered all upper case characters. This will also make searching for the record by this index much easier. The user won't have to remember which characters are upper and which are lower case. We use this feature for the CUSTNAME index. NOTE: This only works for CodeBase type files.

Any TAS Professional file may have up to 24 different key segments. That may be 24 keys each with only 1 segment or 1 key with 24 segments. To search a file using a different method (or field) requires that you have different keys. In this case you will end up with 4 different keys, each with only 1 segment. Determining how many keys to have and how many segments will make up each key is up to you. However, we recommend that you use a few keys as possible and keep the size of each key as small as possible. This will keep the file access fast.

NOTE: If you have more than one segment in a key it sorts in the following manner: The first field is used as the primary sort and then the file is sorted further by the following segments. For example, you might have a key with two segments; the first is the customer code and the second is an invoice date. If you were to search within a file by that key you would see all records for a particular customer code in date order. Then when the search reached the end of that customer it would start with the next customer in order again, beginning with the first sale date for that particular customer. If you wanted the file to be accessed in date/customer code order also you would create a second key where the first segment would be the sale date and the next would be the customer code. Then when you accessed the file using that key you would see all sales for that date in customer order, then the next date, etc.

Press the ENTER key to put the grid in edit mode. Then enter the field name CUSTCODE. Since there is only one segment in this key (and all others in this example) when the cursor moves to the next line just click on the Save Key button. The key will be added to the key list grid (on the left side of the screen). The information you just entered will still be displayed since that key will be chosen.

NOTE: To change a key previously entered you would click on the appropriate line in the key list grid. The appropriate information will be displayed for that key. You can then make any changes you wish including moving segments around, inserting and deleting segments, and changing the key name. (Be careful about changing the key name after a file is created and part of existing programs since the key name may have been used and will cause problems the next time you compile those programs).

NOTE: To rearrange the segments click on the block to the left of the segment name, and, while holding the mouse button down, move the segment to the proper location. When you release the mouse button the segment will move to the new location.

NOTE: If you change or add a key to a FD you must either Initialize the file (if there are no records already entered, or at least none you want to keep), Reindex the file, or Restructure the file. If you have not changed the FD structure you need not Restructure the file; Reindex is the preferred method in this case.

Now enter the other three keys using the data in the following table. The entries are as follows (all are Ascending; also the key name and the only segment name are the same):

After you have entered the last key press the Save key. The program will ask if all is correct: click on the Yes button or press the ENTER key to accept the default.

Initializing the New File

Since this is a new FD, the program will automatically ask if you want to create a new file. Press ENTER or click on the Yes key.

The screen above will be displayed. The fields are all self-explanatory except the Rec Type. This field tells TAS Professional what type of field this is. Btrieve files are type B, CodeBase files are type C. The initialization program defaults to type C. You can change the path by entering the correct location in the field or by clicking on the button which will bring up a path search dialog.

NOTE: In Btrieve type files the File Name and Extension are put together to get the entire file. So, if the extension was B and the Rec Type was also B the above would be CUSTOMER.B. However, CodeBase files use the extension DBF at all times. The Extension value in this case is more used for which company files are being accessed since you have the capability of keeping separate sets of files for each company. The default company code, in this case, is C. In TAS Professional file names (not including the extension) are limited to 32 characters. The path is limited to 128 characters but can be any legal Windows path.

To continue with the process, click on the Initialize button. This must be done before any data can be entered. After the initializing process is complete the fields above will be cleared. Press the Exit button to return to the Data Dictionary Maintenance program. Press the Exit button in the Data Dictionary Maintenance program (also referred to as MDD).

This completes Part 1 of the tutorial.


Part 2 - Maintain Database

Navigation: Tutorial >

Part 2 - Maintain Database

 Print this Topic Return to chapter overview

PART 2 - MAINTAINING A DATABASE

Now that you have created a CUSTOMER database with TAS Professional, you can start using it right away. You can add, edit, and delete records and generally keep things up to date. This type of activity is known as "maintaining a database."

In this section you will edit the Customer data file using the Maintain Database option from the Program menu.

The screen above will be displayed when you choose the option from the menu. The first entry to make is the file name. Click on the down arrow and all of the files in your data dictionary will be displayed. In this case you want to choose CUSTOMER.B.

NOTE: If you have a lot of files in your database you may want to enter 1 or more characters before you click on the drop down arrow. This will start the displayed part of the list with the file that matches. You can also enter the entire file name. Don't forget the extension.

Choosing Fields to be Displayed

Once you have chosen the file, click on the Open File button. The following screen will be displayed.

The fields in the Source list are all those available. You move them to the Destination list two ways. You can move all the fields by clicking on the double right arrow (>>). Or, click on an individual field (or fields by holding down the SHIFT or CTRL key while clicking on the field(s)) and then click on the single right arrow (>) to move that field (or fields). You can move them back by doing the same in the Destination list. You can also rearrange the fields in the Destination list by using a standard drag-and-drop process. The order the fields appear in the Destination list will determine how they appear in the editing grid. Each field is a separate column in the grid.

In this case you're going to choose all the fields so click on the double right arrow and then click on the OK button.

The screen above will be displayed. The fields chosen are the columns in the grid. There are no records in this file so there are no rows in the grid. The keys available for this file are in the drop down box to the right of the Close File button.

To the left of the Close File button is a FastSearch™ field. If there were records in this file you could search for them by entering characters in this field. As you enter each character the program will find the record that matches most closely. If you delete characters the search routine will move backwards.

To the right of the Key List is the Allow Editing check box. If you check this option the grid will go from search mode to edit mode and will allow you to add, change or delete records. Since you want to add new records click on the Allow Editing check box now. The FastSearch™ field box will disappear and you will be able to add records.

At the bottom of the screen (and below where the grid will be when you open a file) is a standard navigator bar. By clicking on the appropriate button you can move to different rows in the grid, save changes made to a record, delete a record or to add a new record (row) to the end of the grid. The guide to the buttons is listed below.

When you're in search mode the Save Record and Restore from Disk buttons have no effect. When you're in edit mode the First and Last buttons will have no effect.

NOTE: If you modify a record and save it (either by moving to another row or clicking on the Save Record button) you will not be able to move beyond the rows you have already visited. The reason for this is that if the records you have already displayed may now be in a different order. Since you might access records in the new order the program controls which records can be displayed. To eliminate the restrictions click on the First button (or press the Home key on the keyboard). The records will re-organize as appropriate and you can return to edit mode if you wish.

Add a Record to a File

After the file name is entered and fields selected the above screen is displayed. You can confirm the file that has been opened by checking the name at the bottom of the screen. The screen above has been shortened from the actual version.

To get into edit mode press the ENTER key. The cursor will start in the CUSTCODE field. Enter 001 for the CUSTCODE. After you press ENTER the cursor will automatically move to the CUSTNAME field. This should feel comfortable to you since this is very similar to the process you went through when you entered the original fields. Next enter Abbot, Larry R., then Bug-B-Gone Exterminators (CUSTCOMP), 13145 Ant Street (CUSTADDR), Tacoma (CUSTCITY), WA (CUSTSTATE), 98422 (CUSTZIP), 206 (CUSTAREA) and 555-1214 (CUSTPHONE). After you have entered the CUSTPHONE value press the ENTER key. You will be asked if you want to add a new row. If you answer Yes (or OK) the cursor will move to the next row (a new row will be added) and the previous record will be saved. If you answer No or Cancel the record will not be saved. You can, however, click on the Save button (check mark) in the Navigator bar and save the record that way.

NOTE: Some of the columns do not appear on the screen. As you enter values the grid will shift to the left and the field you are entering will always be visible.

NOTE: Until you move to a different row either by adding a new row at the end of the list as you did above, by moving to a row previously entered or by clicking on the Save Record button, the data you enter will NOT be saved to the file. This applies to both new records or changes to existing records.

After you enter the first record the screen should look like the above. Enter the next four records using the data the following table. You may also choose your own data to enter if desired.

Finding Records in a File

Now that you have created a CUSTOMER database and saved some records in it, you can begin experimenting with some of the features of TAS Professional .

As mentioned earlier in this manual, TAS Professional can typically find any one record in one second or less. TAS Professional does this by searching for records according to key fields. Recall that when you designed the CUSTOMER database, you designated four fields to be keys. They were:

CUSTCODE

CUSTNAME

CUSTSTATE

CUSTZIP

This means you can search for records in the CUSTOMER database by customer code, by customer name, by state or by zip code. You could also start at the beginning or the end of the file and step through the records one by one. Of course that would take a lot more time than searching with a key. In this program the keys are listed in the drop down box to the right of the Close File button. Since the first key is the default, CUSTCODE is listed as the active key when the file is opened. To search for records in the file you must not be in Edit mode. This means the Allow Editing box is unchecked.

NOTE: You can switch back and forth from editing to search mode by either clicking on the Allow Editing check box or by pressing the ALT and E buttons at the same time (referred to in the future as ALT-E). This will have the same effect and will either put you in edit mode if you are currently in search mode or vice versa.

Once you have entered all the records turn off the edit mode by clicking on the Allow Editing box (if it is still checked) or pressing ALT-E. The FastSearch™ field box will be displayed on the left size of the screen at the top (see below – the screen has been shortened so that certain features will display with just a few records).

Click in the FastSearch™ field if the cursor is not there already. If you start typing 0, 0, 3 in the FastSearch™ field the select line (the highlighted line) will not move until you enter 3. This occurs since the first two characters enter (0 & 0) match the current record. Once you enter 3 the highlighted record will now be 003 – Larson. You can get into edit mode automatically by double clicking on the highlighted line or clicking on the Allow Editing check box. This is much more effective if you have hundreds or thousands (or more!) records in the file. Search time, however, will be almost identical.

If you want to search on a different index all you have to do is click on the Key Name drop down box and choose one of the keys in the list. If the first field in the key is of a different type than you are currently searching the FastSearch™ field type will change, the first column will change to the new key field and you will start over at the beginning of the file using the new key.

You can also scroll through the file by clicking on the scroll bars. However, the scroll bars in the grid will not be effective until you click within the grid.

Another way to find records in the data file is to use the Home (move to the beginning of the file for the active index), End (move to the end of the file), PageUp or PageDown keys. The Down Arrow key will move down (toward the end of the file) one record and the Up Arrow key will move up (toward the beginning of the file). Note that you may not be in editing mode to use these keys. And, of course, you can also use the navigator keys.

Change (Edit) a Record

What happens when one of your customers moves? How do you change his (or her) address? It's really very easy. TAS Professional lets you change (edit) or add to data that already exists in your database. In this section we'll show you how.

Now let's say you want to update the address for Brenda Levins. If you are in edit mode, press the ESC key. Then press the UP or DOWN arrow until you get to the appropriate record (or click on the Next or Previous key on the navigator bar). If you are in Search Mode click on the Allow Editing check.

Position the cursor on the CUSTADDR field to change the record. If the entire field value is not already highlighted, double click anywhere in the field to do so. Enter 456 Bondman Ave. W. as the new address. Click on the Save button on the navigator bar (looks like a check mark) or move to a different row (record) on the grid. Both will save the current record to the disk.

NOTE: If you have made changes to a record but have yet to save it to the disk you can restore the original information by clicking on the Refresh button on the navigator bar (last button, looks like a semi-circular arrow).

Delete a Record from a File

Deleting a record from a file works much the same way as changing a record. That is, first you find the record (see options above), then you delete it by pressing the Delete key or clicking the Delete button on the navigator (minus sign).

Let's say you just learned that Brenda Levins sold her business and you want to delete her record from the database. Move to the appropriate row, if you aren't already there, using the procedures explained above.

Press the Delete key on your keyboard. A standard dialog message will appear asking you to confirm your delete request. If you are sure this is the correct record to delete just press the ENTER key to accept the default (Yes) or click on the No button. The record will be removed from the file and the row on the grid will also be removed.

When you are finished click on the Exit button. This will close the WTADATAM program and completes Part 2 of the tutorial.


Part 3 - Creating a new sales program

Navigation: Tutorial >

Part 3 - Creating a new sales program

 Print this Topic Return to chapter overview

PART 3 - CREATING A NEW SALES PROGRAM

In this section you will learn how to use the Screen editor and the Program editor to build an application called SALES. This SALES application is really a simple sales journal. You could use it to record daily sales activity including Order Number, Customer Code, Sales Amount and other pertinent information. In later parts of the tutorial, we'll learn how to add a menu and report to this application.

TAS Professional lets you create complete applications, not just simple databases. Let's take a moment to talk about what an application is. In its most basic form an application is a program combined with at least one customized data input screen and one database file.

The real significance of this is the customized data input screen. In TAS Professional the screen editor is a true WYSIWYG (What You See Is What You Get) application. You layout the screen (or form) to look exactly like you want it to when the application is run.

There are generally at least two parts to any TAS Professional application, a screen or form (extension (what the file name ends in) DFM) and a source file (extension SRC). You can have an application with multiple screens, one or more report formats and one that has no screens. However, in this case, we're going to have a single screen form and a single source file. When creating screens you can generally put most of what you want the user to see right into the field objects themselves so that little work need be done in the source file. Once you have the screen and source file you then compile the program. This creates a RWN (or Windows® Run program). When the program is run the runtime uses the RWN (compiled program) and the DFM (screen format).

NOTE: The screen form (and report forms for that matter) are not part of the compiled program for a very important reason. Once you have compiled the source file you can continue making changes to the screen/report forms and not have to recompile. As long as you don't add a field to the screen that hasn't been referred to in the program, you never have to recompile. So, you can change colors, text, location, remove fields, etc. Not only can you do that, but we also have a version of the Screen/Report editor that you can purchase for your customers that will allow them to do the same thing. Next time you have a customer that wants to change the text on a form, or move things around; all you have to do is provide them with this special program (TAS Professional User Editor) and they can do it themselves! If you don't want to provide them with this capability, just don't tell them about it!

NOTE: This section assumes that you have already worked through the CREATING A CUSTOMER DATABASE and MAINTAINING A DATABASE sections of this tutorial and are familiar with the conventions presented there. If not, you should go back and work through those sections first.

Design your Database on Paper First

The first and most important step in building a database application is to design it on paper before even turning on the computer. A little time spent thinking things through now can greatly reduce the time (and frustration) spent fixing things later on.

Your design doesn't have to be fancy. In fact, a good place to start is to list the types of data (information) that will make up an application. Here's a list of what you need to keep track of in our SALES example.

The next thing to determine is how the data is going to be stored. In this example, you will be entering sales order records based on the customers' purchases. You already have the customer records from the previous sections, so you do not need to keep the customer specific information in the sales file. You do, however, need to keep the Customer Code in the sales file so you can link (relate) the sales records to a specific customer.

This does two things for us. First, it reduces the data entry required to enter a sales order. When the Customer Code is entered, the program will find the corresponding record in the customer file and display the appropriate information. You will be adding the code to do this later.

Secondly, it reduces the amount of disk space required to store our application. Each file stores only the data required and the fields necessary to link to other files in the application.

The following table shows how the data you are keeping track of will be stored.

The Customer file already exists so you will only be entering the Sales file. The first thing you need to determine is the type and size of each field in the Sales file. The size of the field is determined by the largest entry you expect to put in that field. For example, you wouldn't make the Sales Amount field only four characters long, since that would limit the sales amount to a maximum of 9.99.

Here are the data types, lengths and key types for the SALES (name this FD "SALES") file:

NOTE: In the field information above we don't include the Short Field Name. Just press the ENTER key when you're in that field and accept the default value.

The keys specified allow searching and reporting based on the Order Number, the Date of Transaction, or the Customer Code. Note that we now allow duplicates of the Customer Code. Since you can have multiple sales for a single customer you need to allow duplicates here; however, we still don't allow the code to change for the same reasons we had when setting the Customer Code key.

The final thing to design on paper is what you want the computer screen to look like. Often you can get good ideas by looking at the paper forms around your office. For example, if you were building an invoice tracking system, you might design the computer screen so it looked like your paper invoices. With TAS Professional you have the ability to make the screen look any way you want.

Preview of Sales Screen Form

For our SALES example, we'll keep things fairly simple. The data input form will look something like this (the dots on the form display only in the screen editor):

You will learn how to build this screen in the next section.

The Data Dictionary

The first step in creating your application program is to add the SALES file to the data dictionary. Review what you learned in PART 1 - CREATING A DATABASE. Using the Maintain Dictionary Program and the specifications above, enter the FD (file descriptor) for the SALES file.

Create the Screen Form

Now that you know what you are going to keep track of in your database, you are ready to use the Screen Editor to "paint" a data entry form on the screen.

From the Main Menu click on the Screen icon. A blank screen will be displayed under the menu bar. However, if you look at the status bar at the bottom of the screen you will see Screen Painter in the first section. You can always refer to this section to make sure you're at the right place.

Now click on the New icon (it's the first one in the menu bar). Something similar to the screen below will be displayed. The actual layout will depend on your screen size settings. Part of the image below has been cropped to fit on the page.

NOTE: You can run the screen editor in as little as 800 x 600, however, we don't recommend it. Your minimum resolution should be at least 1024 x 768. The higher the resolution the more you'll see without having to move things around.

The screen displayed above is basically a blank canvas. You can put anything you want on it. Above the screen is what is called an object pallet. There are four different tabs that make up this pallet. They are: TASWin – all of the objects that are unique to TAS Professional ; Standard – objects that might be typically part of a standard screen; and, Additional – these are objects that you would use occasionally . Each of these is described below:

TASWin Page

TASEnter - Use this object to enter any type A (alpha - string) field. There are other objects to enter numbers, dates and times. However, you can use this object to enter any value in your program.
TASNumEnter - Use this object to enter any numeric (N, B, I or R) type field. There are other objects to enter strings, dates and times.
TASDataGrid - This may be the most important object available. This will display a list of records or array field values on the form in a certain order in columns. You can allow the user to delete rows (records or array elements), insert rows (array elements only), add new rows to the end of the grid, and, through the use of the DATA_GRID command, add columns, remove columns, shift them around, etc.
TASComboBox - This object is similar to the TASEnter with a few extra options. You can create a list of values that the user can choose from if the click on the drop down button or as they are typing.
TASCheckBox - Use this object to replace a standard Y/N question. If the user checks the box the value returned to the field attached to the object will be Y; if unchecked, it will return N. You can also make the attached field a type L (logical). In that case the object will return .True. (clicked) or .False. (unclicked) as would be expected.
TASRadioButton - Use this object to replace a standard Y/N question. If the user checks the box the value returned to the field attached to the object will be Y; if unchecked, it will return N. You can also make the attached field a type L (logical). In that case the object will return .True. (clicked) or .False. (unclicked). The major difference between this object and the TASCheckBox is in usage. Generally, you would put two or more TASRadioButton objects on a TGroupBox. The group box allows only one radio button to be chosen at a time. Using this, you can give the user multiple choices with the knowledge that they can only choose one.
TASPageControl - This can be used to create a standard multi-page notebook on your form. You can place objects (including another TASPageControl) in the panel below the tabs and the objects will be seen only when the user chooses the appropriate tab.
TASTimeEdit - Use this object to enter/edit time values. You can also include a check box as part of this object. NOTE: The TASTimeEnter object is recommended for usage instead of this. The TASTimeEdit was retained strictly for compatibility with early versions.
TASComboEnter - This is a special version of the standard TASEnter object. Using this object you can allow the user to enter a value 'normally', and/or by chaining to a program routine when the user clicks on the button.
TASDGColTemplate - This is a duplicate of the TASDGItem (Columns) in a TASDataGrid object. Through the use of this object you can add to or update an existing grid through the use of the DATA_GRID command. This is a non-visible object.
TASNavigator - This is a special object that provides the user with a group of buttons that can be accessed by the user to scroll through the records in a file, delete a record, save a changed record or refresh a record from the file even after changes have been made. Use the NAVIGATOR command to link this object to a file and key. This is required before this command will have any effect.
TASStrList - This object can be used specifically to create a string list. To manipulate the list you can either use the appropriate property editor or the STRINGS() function. This is a non-visible object.

TASDateEdit - Use this object to enter any type D (date) field. There are other objects to enter numbers, strings and times.

TASTimeEnter – A newer version of the TASTimeEdit object. It allows for more flexibility in entering time and hours and is the recommended object to use.
TASMemo – This object is used in CodeBase files where you have included a Memo field as part of the FD. It acts as a small word processor and allows you to add and change memos directly to a file.

Standard Page

MainMenu - This object creates the menu that appears at the top of the form. The items that make up the menu are actually MenuItem objects. You create those by using the MenuItemEditor.
PopUpMenu - This object creates a menu that appears when the user right clicks on an object (you must specify the Popupmenu object name as the PopupMenu property). The items that make up the menu are actually MenuItem objects. You create those by using the MenuItemEditor.
Label - This object will allow you to put a fixed string on the form. It is the simplest of all objects that you will use and, along with TASEnter, probably one of the most used.
Memo - Use this object to put a mini-word processor on your form. If you want to allow your user to enter messages or notes, etc. you would use this object in connection with the STRINGS() function. This is different from the TASMemo above in that it cannot be connected to a field.
Button - This will display the standard Windows button on the form. The user will be able to 'click' on this button (press the left mouse button while the arrow is over the object) and have this execute an Event that will call a routine in your program. This is a common object and will probably be used often on your forms.
GroupBox - This object is used in connection with TASRadioButtons. When multiple radio buttons are placed on a single group box the user will be able to set only one of the options active at a time.
Panel - This object is similar to the Bevel in that it can put a border around other objects but it has other uses also. The types of styles available are greater than with a bevel and it 'owns' the objects placed on it. This means that if you set the Visible property of the panel to .False. all object that are on the panel, automatically become invisible also. The same applies to the Enabled property. This can be very useful when you know you want to effect a group of objects all the same way at the same time.

NOTE: The Panel object can also be used as a button since it has a CLICK event just like a button. This is very helpful when creating forms where you want to use buttons that have a different background color than a standard button. You can also place both an image and text (Label) on the panel object.

GlyphBtn - This will display a slightly different Windows button on the form. In this case the button can have a glyph (.bmp graphic) that is part of the button along with the caption. If you don't include the graphic this is identical to the standard Button object. The user will be able to 'click' on this button (press the left mouse button while the arrow is over the object) and have this execute an Event that will call a routine in your program.

Additional Page

Image - Use this object to display an image on the form.

Shape - This object will allow you to draw a simple shape on the form. It can be used in the same manner as the Bevel, to put a box around an object or group of objects. Other than that, it has no other purpose.
Bevel - Use this object to put a bevel around entry objects or other screen objects. Even though this is a visible object there is no interface with the user other than beautifying your form.
StatusBar - This object is generally used to display information to the user at the bottom of the form. You can split up the bar into panels, each of which can be individually modified. The panels that make up the menu are actually StatusPanel objects. You create those by using the Status Bar Panel Editor.
ToolBar - This object creates a tool button bar that appears at the top of the form. The items that make up the bar are actually ToolButton objects.
DualListDialog - This is a non-visual object at design time that can display a very useful dialog at runtime. To execute this dialog you will use the DUAL_LIST_EXEC() function. Refer to this for an image of what the dialog will look like to the user. You will also use the STRINGS() function to determine what options the user has chosen, and perhaps, to set the options (strings) the user has to choose from.
AlarmClock - This object will place a clock on your form. It can be either digital or analog in shape and can be used to set an alarm that will call a routine in your program. If you want to execute an event at a regular interval you should use the RtnTimer instead of this object.
RtnTimer - It won't appear on your form at runtime, however, it can call a routine in your program at a semi-regular interval. If you want to execute an event only once a day at a specific time your should use the AlarmClock instead of this object. This is a non-visual object.

NOTE: All objects start with the letter T, it has been removed in the examples above for clarity. However, the TASEnter object is really TTASEnter, Label is TLabel, etc. This is how they are referred to in the documentation.

NOTE: Not all screen objects are in the above list since we have over the years added more objects to the programmers pallet.

Object Inspector

On the left side of the screen editor is the Object Inspector. Each object has properties. These properties can generally be set either at design time (what you're doing now) or runtime (when the user is running the program). To set them at design time you enter or change the value in the field next to the property name. Each property has been defined in the help file (documentation) for this object. To display that information click on the Help menu option at the top of the screen, click again on TAS Pro Help. A standard Windows help box will be displayed. By entering the name above, the appropriate help screen will appear.

The Object Inspector will always display the information for the current object. The name of the active object, and its type, will be displayed at the top of the Object Inspector (or OI for short).

The properties in the OI are logically divided into sections. So, for example, in the Position section are items like Top, Left, Height and Width. In the TAS Pro section are properties that involve connection to the program (FieldName, Events, etc).

Adding/Moving Objects on the Form

To place an object on the screen form you click on the icon and then click at the appropriate location on the form. A default version of the object will be displayed. You can then change the size by clicking on one of the sizer (or grabber) blocks that surround the object and, while holding the left mouse button down, move the mouse as appropriate.

You can also move the object anywhere on the form by clicking anywhere inside the object and, while holding the left mouse button down, move the object where you want it. As you're moving the object an outline shape of the object will move with the mouse. When you release the mouse button the object will 'move' to the new location.

Another way to move or resize the object is to change the property values that apply. These are Top, Left, Height and Width. All values are in pixels with the top left of the screen form position Top=0 and Left=0.

Multiple Screen Forms

You can have more than one form open at a time. Each form that is opened, or created when you click on the New button, will be on their own tab. The name of the form is on the appropriate tab. To move between forms all you have to do is click on the appropriate tab.

You can also copy and paste object from one screen format to the other.

Saving/Closing Screen Forms

To save an open screen form click the Save button. If this is a new screen a standard save file dialog will be displayed and you will be able to specify a form name and path. You can also save an existing form to a new name by clicking on the File->Save As menu option. Again, the save file dialog will be displayed and you can enter a different name, and possibly a new path, for the form. This allows you to easily reuse current screen forms and create new ones with minor or major differences.

You can also close the screen form without saving it by clicking on the Close button. If the form has been changed you will be given the chance to save the screen form before it is closed. The same applies if you exit TAS Professional completely and there are forms open that have been modified.

Creating the Sales Screen Form

To add the following objects to the form you will first click on the appropriate icon on the pallet and then click on the screen form. The object will be automatically selected. If you click inside the object, and hold down the left mouse button, you will be able to drag the object anywhere on form. While you're moving the object the left and top coordinates will be displayed in a little box immediately under your mouse cursor. It will be in the form of Left,Top. Or, you can enter the appropriate numbers directly in the Left and Top properties in the OI (Object Inspector). The same applies to the Width value. As you adjust the size of the object the Width and Height values will be displayed in the form of Width x Height. As always, the numbers are in pixels.

The first step is to make the form itself the correct size. Depending on your screen resolution this will probably be making it smaller. You can do this in two ways; move the cursor to the lower right corner until it shows as a two-headed diagonal arrow. While holding the left button down (before the mouse arrow changes shape), move it toward the upper left corner. Unfortunately, this doesn't display size as your moving, however, by referring to the ClientHeight and ClientWidth values in the OI you'll see the results. The other option is to change those two values directly. Which ever works easiest for you is just fine. However, you want to end up with ClientHeight = 235 and ClientWidth = 541.

While you're still on the background form, enter "Sales Order Entry" in the Caption property. This will be displayed at the top of the screen form.

NOTE: When ever we display an alpha string to be entered into a property it will be surrounded by quotes. However, when you actually enter the value do not include the quote marks, just the value between the quotes.

NOTE: Something we won't consider here is what font to use. Obviously, in Windows the options are extensive. The default option, when adding objects to a form, is to use the same font that has been setup for the form itself. That's what we'll do. You should be aware, however, that you can change the font type, size, color, etc., for each and every object that you place on the form. Not only that, you can change those values at runtime! However, that is beyond the scope of this tutorial. You can also set the default font type and size in the setup program (TP7SETUP.EXE) so that new screens are automatically assigned that font. For more information about this please refer to the Setup information in the TAS Professional help file.

Let's put the first text and field on the screen form; we'll do the text first. Click on the Standard tab on the pallet, then click on the A icon (Label object). Move the mouse cursor anywhere towards the upper left corner of the screen form and click the left mouse button. This will put a Label object on the form with the default name of Label1. The name will also be put into the Caption property so the name will be displayed as the visible part of the text on the form. Now click somewhere on the Label1 text (inside the outline created by the grabber blocks) and, while holding the left mouse button down, drag the object so that the number under the mouse pointer is 40, 24. You can also enter the appropriate property values. If you'd rather do that then the values are Left = 40 and Top = 24.

The screen below shows what the form will look like when you first put the Label object on it. Notice the small blocks that surround the visible representation of the object. These are the grabber blocks that you can use (by dragging them with the mouse) to make the object width larger or smaller (the blocks on either end) or the change the height (the blocks on the top and bottom). By grabbing the blocks on the corners you can change the height and width at the same time.

NOTE: Normally we'd change the object name to something that is more meaningful, however, the text fields (Label objects) can generally stay with the name that's assigned by the screen editor. If you wish to change them, you're more than welcome to. Obviously, you can't have two objects with the same name and you can only use numbers, alphabet characters and underscores in the object name.

Still working with the first text object let's now make it say something reasonable. In the Caption property enter the value "Order Number:" If you double clicked on the property and the property editor is activated you will need to press the OK button, otherwise you can just press the ENTER key to accept the new entry. Now the Label object on the screen form should display your text entry. We're ready to move on to the actual field object.

NOTE: If you double click in the Caption property a multi-line editor will be displayed. In every instance we'll use in this tutorial you'll only edit the first line. If you press the ENTER key and move to the second line make sure you delete that extra line by pressing the BACKSPACE key.

Click on the TASWin tab on the pallet to get back to the TAS field entry objects. Since this is a numeric type field we're going to use the TASNumEnter object. Click on the icon with the '##' inside the entry block. This should be the second icon from the left. If you move the cursor over the icon the object name should appear as a hint. As you did with the Label object after you click on the icon next click on the screen form.

NOTE: Even if you drop the TASNumEnter object right on top of the Label you won't change the Label at all. When you move the TASNumEnter the Label will reappear just like it was. In fact, stacking objects on top of one another is something you may want to do in a future program but that is beyond the scope of this tutorial.

NOTE: The TASNumEnter object automatically creates a button that can be used in your programs to lookup a value, etc. However, in this case, and in the others we use in this tutorial, we have no need for the button to appear. So, in the OI, set the ButtonWidth to 0 and it will disappear.

Set the position of the new object so that Left = 128, Top = 16 and Width = 64. The Height value does not need to change since it should be 21 automatically.

You might want to see that you can activate any object on the form by clicking on it. So, if you click on the Label object the grabber blocks will appear around the text you entered previously and the properties for that object will appear in the OI. Make sure you click back on the TASNumEnter object before you continue.

In this object there are a few extra properties that you need to be concerned with. The first we'll look at is Name. Each object you put on your screen forms will have a name. If you should need to access that object in your program this is the name the command or function refers to. You should get into the habit of naming your objects with something that is logical. So, for example, start the name of this object with "num" since it's a numeric entry field. Next, you might use something similar to the field that will interface to this object, or what it actually represents, so, in this case, use OrdNum (for Order Number). This will make the Name = numOrdNum. Using a variation of upper and lower case characters makes the name easier to read, however, it makes no difference to the program. You could've used NUMORDNUM or numordnum, each would refer to the same object. Notice that we didn't use any underscores or periods. You could use underscores if it makes more sense for you to do so. Periods are not acceptable at all since they are used to separate pieces of the object name internally. So, put "numOrdNum" into the Name property.

In the TASNumEnter object there is a special DisplayFormat property to control how the number value is displayed. Since this field will contain a value that will only be positive and there are no decimal characters you want to set DisplayFormat = 0. You will see the value in the visible representation of the object change as soon as you press the ENTER key.

Don't worry about the properties of DecimalPlaces or MaxLength since those will be set automatically. You could set MaxValue and MinValue, if you wish, but that is not necessary in this tutorial.

As you scroll down the objects in the OI you will get to the TAS Pro section. The property we're concerned with here is the FieldName. This property will tell the object which field to interface to in your program. You don't have to put a field name into the object, but if you don't you'll have a much harder time getting the information in and out and none of the events will work.

Field Name Lookup

The easiest way to choose a field name is to click on the ellipsis (3 dots in a button) that will appear in the property entry block when you click on FieldName. Do that now and the screen below should appear.

Depending on the files in your data dictionary the first FD that appears may be different than the above. If you've put the SALES FD in to the data dictionary then click on the Data Files drop down box down arrow. A list of FDs will be displayed. Click on SALES and the following should be displayed.

This first object is going to be connected to SONUMBER and it's already highlighted, so just click on the OK button. The field name will be automatically placed in the FieldName property.

NOTE: The next time you load the FieldName search editor the list will start with the FD you last searched. This will make putting a series of fields on your form much easier.

NOTE: Once you have chosen a field in this method you can have the editor automatically set the width of the entry object by double clicking on the Width property value. This is an approximation only. It may be wider than you need or not wide enough. But it will at least give you a place to start. If nothing happens either the field name can't be found or it's the correct size already.

With that we're now done with the first text and entry field objects on the screen form. Your form should now look something like this.

Now you need to put the rest of the objects on the screen form. The Labels are the easiest so we'll list those first. All you have to do is place them on the form, make sure they're in the right location, and enter the correct caption (use the list in the box below).

Next come the entry objects. Each object is given its own paragraph. We start with the object type and then list each of the properties and what you should set as their value. The properties are set in bold and the values are to the right of the equal sign. Any special notes will be given where necessary. In the sample screen below the default Text property values for each TASEnter object has been cleared. This is not required since those values will be cleared automatically when the file is opened and the screen is displayed.

TASDateEdit: Name=dateSODate YearDigits=dyTwo Left=400 Top=16 Width=88

FieldName=SODATE

TASEnter: Name=entSOCust Left=128 Top=64 Width=64 FieldName=SOCUSTCODE

TASEnter: Name=entGLAcct Left=128 Top=112 Width=96 FieldName=SOGLACCTNUM

TASNumEnter: Name=numAmount Left=128 Top=152 Width=96 FieldName=SOSALESAMT

TASEnter: Name=entCustName Left=264 Top=64 Width=227 FieldName=CUSTNAME

TASEnter: Name=entCustComp Left=264 Top=88 Width=227 FieldName=CUSTCOMP

TASEnter: Name=entCustAddr Left=264 Top=112 Width=227 FieldName=CUSTADDR

TASEnter: Name=entCustCity Left=264 Top=136 Width=227 FieldName=CUSTCITY

TASEnter: Name=entCustState Left=264 Top=160 Width=24 FieldName=CUSTSTATE

TASEnter: Name=entCustZip Left=296 Top=160 Width=91 FieldName=CUSTZIP

TASEnter: Name=entAreaCode EditMask="!\(000\);0; " Left=392 Top=160 Width=39

FieldName=CUSTAREA

NOTE: This is the first time we used the EditMask property in a TASEnter object. The EditMask above tells the program to put parentheses at either end of the entry and, if the user enters anything, it must be a numeric character. The 0 after the first semi-colon tells the object not to save the parentheses, these are for entry only. There is a space character after the second semi-color. It's very important that you include this extra space. It tells the object to use the space character as the default input character. You must have some sort of character in this location, we chose the space character. For more information about the EditMask property refer to the help file.

NOTE: Please be very sure that there are no spaces before the leading "!" in the EditMask field. If there is your data will not display properly. If you use the built-in EditMask editor it may put an extra space at the beginning of the mask.

NOTE: Don't included the quote marks at the beginning and end of the EditMask property value. They are there strictly to show you the extra space at the end.

TASEnter: Name=entPhone EditMask="!000-0000;1; " Left=440 Top=160 Width=72

FieldName=CUSTPHONE

TASNavigator: Name=navSO Left=128 Top=200 Width=232 AfterActionFocus=numOrdNum ClearRecOnSave=Checked

TButton: Name=btnExit Left=456 Top=200 Width=75 Caption=E&xit

NOTE: To set the AfterActionFocus property above you must click on the drop down arrow in the property box. Then choose the numOrdNum object from the list (you'll probably have to scroll down the objects listed).

When you're done the screen should look something like this:

Saving the Sales Screen Form

The next step is to save this screen form to disk. Click on the Save button and, since this is a new screen format, the following dialog will be displayed.

Enter SOEntry (upper or lower case does not matter) for the File name value and press ENTER or click on the Save button. The screen form will be saved to disk and the name on the tab will change to SOEntry and, if you look at the bottom of the editor screen, you will see the full path and name for this file. The extension for screen form files is .DFM.

You're done with the first part of creating this program, the screen form. The next step is to create the source file for the program that will work with the screen.

Creating the Screen Automatically

There is a slightly easier way to create screens. Click on the New button to create a new screen form. Then, on the Main Menu at the top of the program, click on Screen Options. Next choose Add File Fields to Screen. The following screen should be displayed:

Enter the S key and click on the down arrow and the SALES file should be selected. If not, select the SALES file.

Since we want all the fields from the SALES file on the form you can now click on All Fields. If you wanted to choose which fields to add you could click on Choose Fields and a standard dual list choice box will be displayed, allowing you to specify which fields to add. If you choose All Fields the following screen should be displayed:

Notice at the top of the form the screen header now tells you you're in Auto add fields mode and the number of fields remaining to be placed.

There are two ways of placing fields. The first is to move the cursor approximately where you want the field and clicking the left mouse button. This will place a single field. The fields will be in the same order they are in the data dictionary.

The second method is to click the right mouse button. Starting with the mouse location all the fields will be placed on the form in order, one after another. The form below shows the result of this.

Now, all you have to do is move the fields and the labels to the correct location and enter the caption you want in the label name. The fields are sized approximately for the number of characters that can be entered so you don't even have to worry about that. In the two TASNumEnter fields you do need to set ButtonWidth to 0 to remove the buttons. The rest of the screen form design process is the same as you previously learned. This is just a short cut for adding the fields to the form. You may find it easier to start this way rather than having to add each field and label separately. Also, the objects are named in a standard fashion automatically, using the names of the fields.

Create the Program Source File

Once you have saved the screen form you can create a source file for that form easily and quickly. Click on Screen Options in the Main Menu. Next click on the Create Basic Source File. You won't see anything happen, however, a new source file has been created for this form. Click on the Program button and the screen below will be displayed.

To better show the entries that have been made, just the source has been reproduced below.

On the right side of the screen you will see a tree listing of all the commands and functions for TAS Professional. As with a standard tree structure, some of the items (commands only) have a plus (+) sign to the left of the entry. If you click on this symbol the options for the command will be displayed.

If you double click on a command (or option, function, etc.) it will be inserted in your code at the current cursor location. If you double click on a command name that has sub-options, the entire command, including all the sub-options, will be inserted into your source file. You can then remove the items that you don't need.

The source editing form is very similar to a standard Windows® editor, except that the lines don't wrap when you get to a certain line length. Most of the features you would expect are part of this editor, including cut, copy and paste; drag and drop, etc. There are a couple of other options that are unique to a source code editor that you may not be familiar with, these are:

Goto Line: Each line in your source file has a line number. The numbering starts from 1 and the lines are numbered sequentially, including all blank lines, etc. The current line and column location are displayed in the left column immediately after the source editing area. To go to a specific line press the CTRL+G keys. A dialog box will be displayed and you can enter a line number.

Bookmarks: You can put up to 10 different bookmarks in the source file. These are not saved with the source file, but, are active as long as the file is being edited. What they allow you to do is mark a specific line. Then you can return to that line by pressing the appropriate keys or choosing the bookmark from the Bookmark menu option at the top of the screen When you set a bookmark on a line a small block with the appropriate number (0-9) is placed in the gutter (space to the left of the editing area).

To set a bookmark from the keyboard, press the CTRL+K+number keys where number must be 0-9. To return to the bookmarked line press the CTRL+Q+number key. To turn off a bookmark press the same CTRL+K+number keys you used to set it. Also, you can 'move' a bookmark to another line by doing the same on a different line than it was originally set.

Undo/Redo: If you make changes to the source file that you find you really don't want the easiest way to get rid of them is through the Undo feature. This option (along with Redo) is on the Edit menu. To undo changes from the keyboard enter the CTRL+Z keys, to redo (reverse the undo) enter the SHIFT+CTRL+Z keys. This is a very valuable feature and one you'll probably use often.

Find: Standard Windows® find option. This is on the Edit menu. From the keyboard use the CTRL+F keys.

Replace: Standard Windows® find and replace option. This is on the Edit menu. From the keyboard use the CTRL+R keys.

Lookup: An option unique to TAS Professional is the ability to search for field names using the same lookup routine you first saw in the screen editor. This option is also on the Editor menu or you can enter the CTRL+L keys. The field lookup dialog is displayed. If you choose a field (double click on the field name or press the OK button) it will be inserted into the code at the cursor location.

Convert Remarks: Remarks are messages to the future that you, or someone who might follow you, will refer to when trying to figure out what you were doing in a piece of program code. The more remarks you put the easier it will be to maintain or modify the program in the future. In TAS Professional there are two 'normal' ways of specifying remarks. If the remark is going to be short, a single line or less, you would use "//" (two forward slashes). Everything after the remark, on that same line, will be ignored when the program is compiled.

The second option is when you're going to have a remark that is going to take multiple lines. You can use the // remark at the beginning of each line or you can start the remark with "(*" (parenthesis + asterisk) and will continue over as many lines as you wish, until you put the closing characters which are the "*)" (asterisk + closing parenthesis).

In previous versions of TAS Professional the semi-colon (;) was the remark character, and that will still work in the compiler. However, the source editor doesn't recognize that as a remark. So, if you choose this option – on the Edit menu, the editor will change all of the old remarks (;) to new (//).

Enter the Actual Code Lines

The actual code lines for this program are fairly simple. The code breaks down into four different sections; Form, Open Files, Finding Customers, Saving Records and Exiting the Program.

Form Section in Source Code

The screen forms (and report forms for that matter) are not incorporated directly into the final compiled program, for reasons we explained previously. However, you still need to tell the source code what the names of the screen and report forms are. This has two purposes; the first is during compilation the program will check the screen forms and will make sure that any field referred to by that form exists in the data dictionary or has been defined in the program. It also adds the field to the list of fields used in the program. The second purpose is, by the location of the screen form reference, it tells the program which screen should be loaded when the program is run.

NOTE: You don't need to have any screen forms at all in a program. For more information about this please refer to the Compiler Directive information in the help file, specifically the #FORCERWN directive.

This has been entered for us automatically already. The lines are:

//SOEntry

#winform SOEntry

If you haven't changed the defaults in the setup program you will notice that the comment is displayed in blue italics. This is to quickly give you a visual clue to the source line. If you don't like blue (or italics) refer to the Setup section in the help file for more information on how to change this and other options.

Next is the line that tells the source code to use SOEntry.DFM. Notice that name of the screen form and the source file (the comment above) are the same. This isn't required but you'll probably find it easier to maintain your programs if the screen and report forms use the same or similar names as the source file.

The "#" (pound sign) at the beginning of the line tells the compiler that this is a Compiler Directive. This isn't actual executable code but is a directive or reminder to the program of something that has to be done. In this case, this is the screen form that needs to be checked and loaded when the program is run (since it's the first screen form listed). Generally, even if you have multiple screen forms, you should list them at the top of the source file. Then you will always be able to quickly and easily check which files need to be included with the finished run program.

The "winform" is a particular directive, which tells the compiler that the next item on the line is a name of a screen form. Always put at least one space between winform and the screen form name.

Next is the screen form name of "SOEntry." Notice that there are no quote marks around the screen form name. This is what we call a "special alpha constant." They are used throughout TAS Professional in different commands. Most commands allow variables to be used and, in that case, you would've put the name surrounded by single or double quotes. However, in this case, the compiler wants the actual name, not a variable. Notice also that you don't include the path or extension. The compiler assumes both. You should always have the screen form file in the same subdirectory as the source file. And, when you run the program, you would have the screen form file in the same subdirectory as the compiled program.

Open Files Section in Source Code

Next we're going to open the appropriate files, CUSTOMER and SALES. Each screen form has four different events that can be called at different times. Two of them are executed when the screen is first displayed by the program. These are the OpenFiles and OnStart events. Events look for line labels in your program that match either what you've entered, in the case of screen forms, or a combination of the object name and event type in the case of most other objects.

The automatic source creation process added three of the four events automatically. The only one not included, OnDisplay, is generally not used and can cause strange results if you're not careful.

NOTE: For each object there is a section of the help file for that object that defines what events are available and how they are used and referred to.

In this program we are concerned with only the OpenFiles event. So, you can either ignore the OnStart and OnClose or you can delete them from the source code.

The OnOpenFiles event we want to add more code. These commands will be added between the line label (defined below) and the RET command.

SOEntry.OnOpenFiles: <- This is already in the source file.

define cust_hndl,sales_hndl type i

openv 'customer' fnum cust_hndl

openv 'sales' fnum sales_hndl

navigator 'navSO' fnum sales_hndl key sonumber

ret

The first line is the actual line label. It starts with the first non-whitespace character (whitespace characters are spaces, tabs, etc., anything that doesn't print) and continues until the colon (":"). The colon is not part of the line label but does specify that what comes before is a line label.

The define command creates two temporary fields, cust_hndl and sales_hndl, that are active while this program is run. We'll use these two fields to refer to the files elsewhere in the program. Typically these types of fields are defined as type I or integers.

The next two lines are the actual file open commands. These tell the program to access these files and get them ready to be used.

The next line is a special command that links one of the files that was just opened to the Navigator object on the screen form. By setting the fnum (or file number) and key value, in this case you want to use SONumber, when the user clicks on one of the navigator buttons the appropriate record will be found.

The most important line is the last. You must always return from an event or a subroutine with a RET, ALWAYS! The best way to remember this is to imagine that through the screen form the user controls the program (this is also known as Event Driven Programming). If you don't return (RET) from a subroutine the user will never gain back control. Sometimes you may want this to happen, however, if the user doesn't have control they can never exit the program, will get very frustrated, will start hitting CTRL-ALT-DEL, etc. Then you'll get called. So always try to keep your subroutines as short as possible and always, always return.

To complete this event you need to save the label name in the screen form. So, click on the Screen button. If you have already closed the screen form, for whatever reason, it's really easy to get it back. Click on the down arrow right next to the Open button. A list of recently opened screen form names should be displayed. Your SOEntry file should be at or near the top. Just click on that name and the screen will be loaded.

When you click back to the Screen section, or load a previously saved screen form, the form itself is active in the OI. If it isn't, just click on the form background (anywhere there isn't another object) and the form will be active.

Near the bottom of the properties for the form, in the TAS Pro section, you will find the property OpenFiles. In the entry field for that property should be SOEntry.OnOpenFiles. This was placed there automatically by the Create Source File routine. However, you can change this value at any time. Just remember to change it in the source file also.

NOTE: If you make changes to the screen form don't forget to click on the Save button. Changes made to a form are not saved until you click on the Save button. Nothing will happen to the form but the appropriate event will be called when the program is run. If the form has been modified the name of the form in the tab will be highlighted.

NOTE: If you should find that a subroutine is not called when you expect it to be make sure you have the event name correct, and, in the case of forms, that you have saved the event label name in the form, itself.

This is it for the OpenFiles section. Don't forget, if you have questions about the specific commands that we use please refer to the help file. You can search for any command using the command name as provided here.

Find Customers in Source Code

Each time the user enters a customer code (SOCustcode) you will want to find the corresponding record, if it exists, in the CUSTOMER file. This is very easy to accomplish.

Leave a couple of spaces after the last section and enter the following lines:

entSOCust.Change:

findv m fnum cust_hndl key custcode val SOCustcode

ret

The most important part of the code section above is the label at the beginning. This is a very good example of a standard event label. This one will be called each time the user makes a change to the field value. If the standard entry to this field was very long, or if there were lots of fields on the screen, you might do this a different way since each time the user enters a character this routine will be called. However, in this case there's only 3 characters that can be entered, and it will make a very large difference in the rest of the program. For example, each time the user finds a record using the Navigator the CUSTOMER record will be updated automatically.

The makeup of this label is very simple. The first part is the object name, in this case "entSOCust". The second part is the event name, in this case "Change". Between the two parts is a period ("."). At the end of the label is the standard colon (":") that defines this as a label to the compiler. This is standard event label notation and, except for changing the object name or the event name, is exactly how you will start event routines in your code.

The next line is the actual find. It tells the file manager to find a record in the file using the file number represented by the variable CUST_HNDL, this value was set in the OPENV command, and the key CUSTCODE. It needs to find the exact match using the value in SOCUSTCODE. If no record is found, no error will be displayed.

As with the previous subroutine, send control back to the screen form with the RET command.

If the record is found the CUSTOMER fields on the screen form will be automatically displayed. You do not need to do anything else.

Exiting the Program

The last section of code we're going to create is the part that tells the program to quit when the user clicks on the Exit button. You really didn't need to include this, or the button, since the user could click on the standard Windows® close button in the upper right corner. However, most "standard" programs have such a feature so we've included it here.

The code, as the others, is very simple and is listed below:

btnExit.click:

quit

ret

The event label is in standard format. In this case, the event is "click". This is the only event for the Button object.

The next line tells the program to quit or exit. And, of course, there's the RET command to return from the event.

NOTE: If you are familiar with previous versions of TAS Professional you will be used to the QUIT command. However, it was the last command in the procedure since once that command was executed everything else stopped. In TAS Professional this is a perfect example of the switch to event driven routines. In this case, the QUIT command sets certain flags, but, until you return from the event, nothing is done. If you don't return, the program won't quit.

Saving the Source File

When you get here the program should look similar to the following:

The next step is to save the program to disk. As you did with the screen form, click on the Save button. However, since you have created this program from the screen form it has already been named and will save automatically to that file name

Compiling the Source File

Before a program can be run in TAS Professional it must be compiled. The compiler checks to make sure all commands are correct, that fields not in the data dictionary have been defined, etc. It also puts the programs into a special format that allows the runtime to execute it faster and your source code is protected if you don't want to release it to the user.

To compile the program click on the Compiler button. The following screen should be displayed:

You can just press the ENTER key since the Compile button is set as the default. After the process is complete a message announcing that will appear. Press the ENTER key or click on the OK button.

A new tab will appear between Main Screen and Defaults. If you entered the code correctly it should say No Errors. If you didn't, and the compiler found an error, it will say Errors. If it does please click on that tab and you should be able to find what went wrong quickly. Fix it and recompile the program.

Once the compiler has successfully compiled the program the Run Program button will be set as the default. Again, press the ENTER key or click on the Run Program button. When you do, you should see basically the same screen you created without the dots on the screen form itself. And, the cursor should be in the first field.

NOTE: If the cursor is not in the Order Number field then you probably created the objects in a different order than we had above. No problem, just refer to the Tab Order Property Editor in the help file. It explains how to rearrange the entry order of the objects on the screen form.

Enter 101 for the Order Number and press ENTER. Click on the button to the right of the Date entry field. A calendar will be displayed with today's date highlighted. Click on the button again and the date will be set to today's date. Press the ENTER key and the cursor will move to the Customer Code field. Enter 002, press the ENTER key, and the customer information for William, Ralph V. should be displayed. Enter 500 for the G/L Acct Num and press the ENTER key. Enter 150.99 for the Amount and click on the Save button in the Navigator (looks like a check mark).

A couple of things to notice; first the SALES fields clear along with the CUSTOMER fields. If you hadn't checked the ClearRecOnSave property in the Navigator this wouldn't have happened. The other is the cursor returned to the Order Num field. Again, what you want specified by the AfterActionFocus property.

If you click on the First button in the Navigator (far left) you will redisplay the record you just saved. Even the CUSTOMER information will redisplay. This was due to the Change event we included for the Customer Code field above.

Let's say that the user wants to add a new customer. This would be a logical place to do so, but the program will save only the SALES information when they click on the Save button. Let's add the code to your program that will update the CUSTOMER file also.

Saving Changes to the CUSTOMER file

The user will save records by clicking on the check mark button in the Navigator bar. However, this will save just the record in the file that's attached to the object via the NAVIGATOR command. So, it's up to us to save the record in the CUSTOMER file via code. Fortunately, the Navigator object has an event that will let us know each time the user clicks on the save button, it's the SAVE event. The following lines will handle what's needed:

navSO.save:

custcode = socustcode

save @cust_hndl nocnf

ret true

The first line is the standard event label, in this case the Navigator name is "navSO" and the event is "save" and we've separated the object name from the event with a period ".".

The next line makes sure the customer code value in the CUSTOMER file matches what you entered for the SALES file. If you find an existing record then both values will already be the same. However, with this line here you will now be able to save new records in the CUSTOMER file.

The next line tells the program to save the record in the file represented by the file number in "cust_hndl". It also tells the command to not ask the user to confirm this save (nocnf). If this option were not included the user would get two "Save?" questions, one from the Navigator object itself, and one from this save command.

NOTE: You can even eliminate the "Save?" question from the Navigator object by going back to your screen form and clicking on the Navigator bar. Look at the properties in the OI. One of them is "ConfirmSave" and has been checked. If you un-check that property the user will never see a "Save?" question. Don't forget to save the screen form if you make a change. When you make changes like this you don't need to recompile the program! However, if you don't save the screen form the program won't know the change has been made.

The last line in this code section is a variation on the standard event return command. In this case we're actually returning a value of "true". This is what's called a Boolean value. Boolean values have only two possibilities, True or False. In the case of events that expect a Boolean value returned, generally the True value tells the event to continue, the False value tells it to stop, or not continue. If an event expects a return it is documented in the help file for that object. If you do not include the True or False value the event will act as though you returned True.

In this case always return True, since you aren't using this event to check whether or not to save the record, it's being used to save the record in the CUSTOMER file.

It doesn't matter where you put this routine in your code. You can add it to the end, or put it before the Exit routine, what ever you wish. Location is strictly dependent on what works best for you, since each routine is considered almost like a separate program

NOTE: If the user answers No to the original save question from the Navigator we'll never get to this event.

Since you've already saved the source file once you can let the compiler do that for you from now on. Just click on the Compiler button. The correct source file name should automatically appear in the program name entry box, and press the ENTER key to compile the program. Before the compiler actually does its work it checks to see of the source file is active (which it is) and if it's been modified (which is has) and saves the file back to disk before it's actually compiled. So, this saves you the work of saving the program before it's compiled. Unfortunately, this doesn't apply to screen forms. You have to save those yourself.

NOTE: Each time you run a program by clicking on the Run button or from the Compiler you create a new copy of the runtime. Don't worry, this will not occur when running directly out of the runtime as your users would, only during your development stage. However, you want to make sure you exit out of the program before your recompile, etc. or you could end up with multiple copies of the same program running. You will always be able to tell since a new button would appear on your start bar that has the TAS Professional icon and the title of TAS Pro Runtime. Should you "lose" the program by clicking on the source or screen editor you can always get it back by clicking on the button in the start bar.

You can now check your changes by running the modified program. You should be able to make changes to the existing CUSTOMER data and, when you save the SALES data, you will also save the CUSTOMER data. When you call it up the next time the changes should be there.

You can check this by clicking on the Find First button (far left) in the Navigator. It should display the Sales Order #101 and all the appropriate data, including the CUSTOMER data. Let's assume the customer moved to a new office in the same building and their address has changed. Click on the Address line (after the Company Name) and change that to 204 Maple Lane. Again, click on the Navigator Save button and answer OK to the save question. Call the record up again and you'll see the Address value has changed.

Further Modifications to the SOEntry Program

Let's make a couple of other changes to the screen form and the program. If you don't have the screen loaded then click on the Screen button. Then click on the down arrow to the right of the Open button. A list of screen forms you have edited should appear. At this time it's probably just the single screen SOEntry. Click on the appropriate file name and the screen will be loaded into the editor.

The first change to make is to have the date field default to today's date. Click on the Order Date (dateSODate) object. In the OI find the property DefaultToday. Click on the check box to the right of the property name (if it isn't checked already). Now, the next time you run the SOEntry program the date will default to today without any other entry.

Now click on the Order Number (numOrdNum) object. You're going to make three changes to this one. The first is to give the user some idea of what this entry is for. We'll put that in the Hint property. Click on the Hint property (in the Hint section). Then click on the ellipsis button (has three dots in it). The text editing dialog will be displayed. Type in the following:

This is the number that will be used when referring to this order.

When you're finished the text edit dialog should look like this:

Click on the OK button to save this back to the property.

Next click on the check box in the ShowHint property. Even though you have entered a Hint above it won't display unless you set this property to checked. It will automatically turn the ParentShowHint off, don't worry about that.

Next, scroll down until you get to the ValidExpr property. In this property entry box add the following line:

SONumber<>0

As with other code, upper or lower case don't matter. What this expression will do is check to see if the SONumber, the field attached to this object, is 0 or something else. If it's 0 the expression returns False, if it's something else (anything but 0), it returns True.

In the ValidMsg property click on the ellipsis button, just like you did with the Hint property. In the text editing dialog enter the following:

You must enter a number here. This cannot be zero.

Again, click on the OK button to save the message to the property. This will display when the VALID_CHECK() function returns False. We're going to add that function to the source file.

Now save the screen form to disk by clicking on the Save button. This is very important since the compiler will not be able to see the new ValidExpr property value unless the form is saved. You might also want to close the form since it will be updated by the compiler and you don't want to save the 'old' version over the 'new' version the compiler creates. See the ValidExpr property in the help file for more information.

Now, click on the Program button. As with the screen form, if the program is not loaded you can load it by clicking on the down arrow next to the Open button and then choose the appropriate source file.

Immediately after the navSO.Save line insert the following line:

if .not. valid_check() then ret false

This line will execute the VALID_CHECK() function, and if it returns False (one of the ValidExpr property values returns False) then it will exit the save subroutine and neither of the files will be updated (by returning False from the subroutine it tells the program to not save the record in the SALES file also). If a ValidExpr evaluates to False the ValidMsg for that object will be displayed and focus will return to that object, forcing the user to enter something other than 0, in this example. The new save subroutine should look like this:

navSO.save:

if .not. valid_check() then ret false

custcode = socustcode

save @cust_hndl nocnf

ret true

Compile the program, as you did previously, and run it. Now, if you put the mouse cursor over the Order Number entry field and stop for a moment, the hint you entered above will be displayed. This is a typical Windows® response and one your users will expect to see.

Now click on the Save button in the Navigator (check mark) while the Order Number value is 0. You will get the message you entered above as the ValidMessage and the cursor will return to the Order Number field.

What's important about this? The use of the ValidExpr property/VALID_CHECK() function gives you a quick and easy way to check all important fields at one time without having to remember each and every field. In previous versions of TAS Professional you could force your user to stay in the field until a proper value was entered. With the change to an event driven system you want to give your user as much flexibility as possible. You can use the VALID_CHECK() function anywhere. If there are multiple ValidExpr's to check the program will check each one. If multiple fail the user will be returned one at a time to fix them before continuing. This is an important feature of TAS Pofessional and one that you'll probably use very often.

The last item to notice is that the date field now has today's date in it when you load the screen form instead of 00/00/00.

We've still got one missing feature. What if the user wants to find the order in a group of orders? Let's put together a quick lookup.

Add a Lookup Grid to the Sales Program

The first step is to create a new screen form. If you aren't in the screen editor then click on the Screen button now. Then click on the New button to create a new screen form. Make the size of this form 296 pixels high (ClientHeight) and 552 pixels wide (ClientWidth).

While you're on the form we'll make a couple more changes. These are:

Caption=Sales Order Lookup OnStart=SOLookupStart

Note that a line label is included for the OnStart property for this screen form. Why not just use START, since it's the default? To keep the program from calling the same subroutine for two different screen forms, unless you want it to, the program defaults to START only for the first screen form. All subsequent forms have to specify an OnStart line label, which has been done here.

NOTE: While you're placing objects on the screen form you may exceed the edges of the form and scroll bars will automatically appear. Just make the form larger and then return to the correct size and the scroll bars will disappear, also automatically.

Place a TASNumEnter object on the form at the location Left=8 and Top=8. The Width should be 80. This is going to be our FastSearch™ field. The rest of the property entries are:

Name=numOrdLU DisplayFormat=0 FastSearchType=fsRec

We don't have to assign a field to this object since it's only going to be used as a FastSearch™ field.

Next drop a TASDataGrid object on the form. The general properties are as follows:

Name=dgSOLookup Height=216 Left=8 Top=40 Width=536 FastSearchFld=numOrdLU

Click on the + next to the Navigation property name. Now check the box next to the AdvanceOnEnter subproperty. You can click on the – next to he Navigation property name to close up the subproperty options.

By setting this subproperty you tell the program to do an automatic select if the user is entering characters in the FastSearch™ field and presses the ENTER key.

Now display the Option subproperties by again, clicking on the + next to the property name. Check the box next to the goDrawFocusSelected subproperty. You might experiment with this option. If you check this box a complete selection bar will cover all columns in the grid for a single row. If you don't check this box, the selection bar will start with the second column and the first column will appear differently. Try it and decide which one you like best. Always make sure this option is checked.

We now need to add the columns to the grid. To do this click on the Columns property and then click on the ellipsis button that is displayed. A special column editor will appear. It should look like this:

A full explanation of this property editor is in the help file.

When the property editor appears it is already on column 0 (first column in the grid). The property value entries for this column are:

Alignment=taRightJustify Name=SONum Header=Ord Num Width=78 FieldName=SONUMBER

As you modify these properties you'll see the appropriate changes to the grid, including header and width. We actually want five columns total in the grid so you need to add four more. To add a column click on the + button at the top of the column property editor box. Do that now. Column 1 should appear in the box and a new set of properties in the OI. For each column listed below don't forget to click on the + button to add the column to the grid.

NOTE: If the Alignment property is not given it should be taLeftJustify, which is the default value.

Column 1: Alignment=taCenter Name=SODate Header=Ord Date Width=76 FieldName=SODATE

Column 2: Name=SOCust Header=Cust Code Width=83 FieldName=SOCUSTCODE

Column 3: Name=SOCustName Header=Cust Name Width=111 FieldName=CUSTNAME

Column 4: Alignment=taRightJustify Name=SOAmt Header=Ord Amt Width=82 FieldName=SOSALESAMT

When you are finished creating the columns click on the close button at the upper right corner of the property editor. The properties in the OI will disappear until you click on one of the objects in the screen form (or the form itself).

When this form is loaded you will use the LOAD_MODAL_FORM() function. A modal form, in Windows® parlance, is simply one that remains active until the user does something that closes the form. To do that, you have to send a modal response to the form. This can be accomplished in two ways; you can use the SET_OBJECT command or include one or more buttons on the form that have their ModalResult value set. Then, if the user clicks that button it will send that value back to the form and the form will exit without any further action on your part. So, the last objects you're going to put on the screen form are two buttons.

Button: Caption=Select Name=btnSelect ModalResult=mrOK Height=25 Left=376 Top=264 Width=75

Button: Caption=Exit Name=btnLUExit ModalResult=mrNO Height=25 Left=464 Top=264 Width=75

When you're finished the form should look like the following:

The last step is to save the form. As with the SOEntry form click on the Save button and enter SOLookup for the file name.

Next you're going to give the user a way to call this form. You could put a button on the SOEntry screen form but this tutorial uses a different option. If the SOEntry screen is already loaded then click on the tab for that screen form. If it isn't, then load the screen form as previously described.

Click on the Order Number (numOrdNum) object. Look at the TAS Pro section in the OI. One of the properties is KeyTraps. Click on the property and then click on the ellipsis button. A Key Traps property editor will be displayed. As with all other property editors this is documented in the help file.

You're going to add a key trap to this form. Then, when the user presses the appropriate key (in this case F2), the line label you specify will be called in your program, just like a normal event.

Click on the box (also known as a cell) in the Trap Name column. A drop down box arrow should appear. You can either enter F2 directly or click on the drop down arrow and a list of available Key Trap Names will appear. Press the ENTER key and the cursor will move to the Label Name column. Enter SOLOOKUP here. The property editor should now look like the following:

Click on the Ok button and you should see F2|SOLOOKUP in the KeyTraps property box. Next, click on the KeyTrapHint immediately above. Again click on the ellipsis button and, in the text property editor enter the following line:

Press the F2 key to lookup existing orders.

Click on the OK button to save it, click on the Save button to save the form, and you're finished with the screen changes.

Click on the Program button, and, if the SOEntry source file is not loaded, do so now.

You need to put the code in your program that will be executed when the user presses the F2 key. The following will do just that:

SOLookup:

if load_modal_form('SOLookup')<>mrOk

clr @sales_hndl

clr @cust_hndl

endif

ret

The label is the same you entered in the Key Traps editor. The LOAD_MODAL_FORM() function loads the SOLookup screen form and will not return until the user either selects one of the available order records or clicks on the Exit button. The IF command compares the returned value and, if it's not mrOK (the user clicks on the Ok button or presses the ENTER key) the records of both files are cleared before the user returns to the calling screen form. As with other event routines this one also ends with a RETURN command.

The next subroutine you need to add is to "turn on" the lookup data grid. This must be done before any records will be displayed. To accomplish this add the following lines:

SOLookupStart:

wlistf 'dgSOLookup' setup fnum sales_hndl key sonumber

ret

The line label is the same one you specified in the OnStart property for the SOLookup screen form. The WLISTF command is used in connection with the data grid when you are accessing records from a data file. This is in the OnStart event so that the grid will be active when the lookup screen form is displayed.

The last subroutine you have to add will be executed if the user presses the ENTER key. All it does is set the Modal_Result property to mrOK. The GET_FORM_NAME() function is included as part of this command line since we don't know the name of the screen form like we do for the other objects. Add the following lines:

dgSOLookup.Select:

set_object get_form_name() property 'modal_result' value \ mrOK

ret

NOTE: The SET_OBJECT command line is continued on a second line due to the width of this page. However, you will probably find that the command fits on a single line. The line extension symbol ("\") is included here for accuracy only.

There's one last change that needs to be done. There's data from both SALES and CUSTOMER files in the lookup grid. The grid knows about the SALES file from the WLISTF command, but nothing about the CUSTOMER file. So, you need to tell the program to get the appropriate record in the CUSTOMER file for each record in the SALES file. If you remember, you've done this already. Look at the routine that is called when the SOCustCode field changes. This will not have any effect here, due to a number of technical reasons, however, you can use the same routine. All you have to do is put an extra line label before the routine. Change the entSOCust.Change routine so that it looks like this:

dgSOLookup.Display:

entSOCust.Change:

findv m fnum cust_hndl key custcode val SOCustcode

ret

What this tells the program is to call the same routine for both the Display event for the lookup grid (dgSOLookup) and the Change event for the SOCustCode field (entSOCust).

NOTE: Line labels are not true executable commands. They are just pointers to a specific location in the program. This means you can put as many line labels as you need at the beginning of a subroutine. Each one will start with the first executable line after the label.

Your modifications are now complete. Save and compile the program by clicking on the Compile button. When the compilation is complete, and assuming you don't have any errors, try running the program.

With the cursor in the Order Number field press the ALT-F1 key. The KeyTrapHint that you entered should be displayed. Press the ENTER key, or click on the Ok button, to clear the message. Now press the F2 key, the lookup screen should be displayed. An example is displayed below (we have entered a couple of new records in the SALES file):

The cursor should start in the FastSearch™ field. If it doesn't then edit the Tab Order and make sure the numOrdLU comes first.

As you enter an Ord Num value the selection line will move to the appropriate record. Then if you press the ENTER key the lookup screen will disappear and the chosen record will be displayed in the SOEntry screen.

This completes part 3 of the tutorial.

Next Chapter Part 4 - Creating a TAS Professional Report


Part 4 - Creating a TAS Professional report

Navigation: Tutorial >

Part 4 - Creating a TAS Professional report

 Print this Topic Return to chapter overview

In this section you will create a report showing sales and customer information. You'll be able to specify the sort field at run time and a range of customers to include on the report.

To create reports with TAS Professional you will probably always start with the Edit Report Format program. Then, after you have the format completed, return to the Source Editor, and create the code necessary to setup the data for your report. This is similar to the Screen Editor/Source Editor combination, except that you cannot change Report Format properties at runtime.

To get started click on the Reports button. A completely new window will be opened and something similar to the screen below will be displayed:

As with the Screen Editor, the higher your resolution the more you'll see on the screen.

There is just a single palette in the Report Editor. There's actually only 11 objects that can be placed on the format. There are, however, several options that will make your reports look better, and, menu options that will add or subtract bands from the format.

Every report is made up of bands. These will control what will print, where it occurs on the report, etc. When the report format is first displayed there are three bands, these are Header, Detail and Footer. Many reports will use just these three.

Report Editor Menu Options

You can easily control the bands that make up your report from the menu. Right now click on the Report menu item at the top of the screen. The following submenu should appear:

Notice that the Header and Footer items are checked. If you uncheck either of these (by clicking on the menu item) the band will disappear on the form. Click on it again and it will be back. There's no Detail option since if you don't have a Detail band you don't have a report! The Header band will print each time you start a new page and the Footer band will print at the bottom of each page.

Two other bands that are also part of that menu option are Title and Summary. The Title band prints once at the very beginning of the report. The summary band also prints once, at the very end of the report.

Groups are a very important option. They allow you to literally group records together. This allows you to force a page break when a group changes, keep group records together, and create GroupHeader and GroupFooter bands that print with the Group. If you're going to print checks, invoices, statements, or other similar reports you will end up using the Grouping feature. If you don't you will have items from one check on another!

Portrait and Landscape are mutually exclusive, you choose one or the other. Portrait prints the report in what might be called "standard format", tall and narrow. Landscape turns the paper 90 degrees so that the paper will print "sideways" or short and wide. If you need to print a very wide report try Landscape, otherwise you'll probably always use Portrait, which is the default.

Units allows you to chose the measurement system for the report. This defaults to Inches. If you click on the Units menu item the options available will be displayed. You can change to another value at any time and all properties where a position value is needed will be recalculated.

If you click on the View menu item there are two options listed there. The first, Rulers, should be checked. If you click on this option it will remove the rulers from the report form. You'll probably always want the rulers to be displayed.

The other option in View is Grid Options. If you click on this menu item the following dialog box will be displayed:

This will allow you to choose the granularity of the grid that overlays the report form. This is the same as the grid in the Screen Editor, except it doesn't display the dots in the Report Editor. In most cases you will leave these values unchanged. Click on OK or Cancel to close the window.

The Edit menu is fairly standard and should be familiar to you from other Windows® programs.

The File menu is also standard except for a few options specific to the Report Editor. These are the list of the most recent report formats at the end of the menu. If you wish to reload any of the report formats listed just click on the file name.

Another option in the File menu is Page Setup. Click on the option and the following screen should appear:

You can make this report for a specific printer by choosing the printer here. However, in most cases the printer should be Default and allow the user to choose at runtime. The Document Name should always be Report. Duplex specifies printing on both sides of the paper. Make sure your printer allows this before you choose this option.

The Paper Size tab allows you to choose a size other than the standard 8.5 x 11 inches. As explained above, you can also choose Portrait or Landscape and get a graphic representation of what it looks like.

The Paper Source tab allows you to choose where the paper will be fed. These are general options and can be safely ignored.

Layout allows you to split the page into columns:

All new report formats start as a single column. If you, however, are going to print labels you will want to change the Columns value to match the number of columns of labels on the page. You will probably also want to remove the Header and Footer bands since they won't change size. Change the Columns value to 4 and notice what happens to the report format (make sure you're starting with a new form!). You should see the Detail band getting narrower, however the Header and Footer bands stay the same size. You will also see ColumnHeader and ColumnFooter bands. These have the same effect as the standard Header and Footer except they will print at the beginning and end of each column. Don't forget to reset the number of columns to 1 before you leave this page!

The last tab is Margins:

In a default report all four margin values will be set to ¼ inch. You can adjust those as needed. However, before you make them smaller make sure your printer will be able to print closer to the edge of the paper.

Once you've made your adjustments click on the OK button to save or Cancel to undo your entries.

Next we'll cover the icons in the tool bars above the report format.

NOTE: Your tool bar may look differently when it's first displayed. You can always move the groups around by grabbing the group at the far left side and moving it where you want it.

A Simple Report

For your first report you're going to do something fairly simple, just list the records in your CUSTOMER file. If the Report Editor is not loaded do so now by clicking on the Reports button on the main TAS Professional tool bar. The default Report Editor screen should be displayed. The process for putting objects on the form is very similar to what you did in the Screen Editor with a couple of exceptions; first, you will find the number of properties for each object is less than what you had in the Screen Editor, also, the report format area is broken up into three blocks or bands, as explained above.

NOTE: If you have further questions about the different objects or bands in the Report Editor please refer to the TAS Professional Help file. You can access this in the Report Editor by clicking the Help menu option and then the TAS Pro Help item. This is the same Help file that you can access in the Screen/Source Editor.

Click somewhere in the report form above the bar that says "^ Header." The "^" denotes that the Header band is above this bar. Same with the Detail band that comes next and the Footer band that is at the end.

When you click in the Header band notice that the OI now displays information about the Header. Click in the Detail and Footer and you'll see the properties change. Now move the mouse cursor so that it's directly over the bar that says "^ Header." The mouse cursor should change from the standard arrow to a double- headed arrow that is vertical instead of canted off to the left. While the mouse is positioned over the bar press down on the left mouse button. While holding the mouse button down scroll the mouse up and down. You should see a representation of that bar (just the outline) move with the mouse. When you release the left mouse button the size of the Header band should change, depending on where you moved the mouse. This is how you resize the band.

NOTE: Sometimes you will make a change to the report that will create new bands on the page that have no space that is automatically setup for them. A good example of this is a Group band. When it's created the GroupHeader and the GroupFooter band bar will be tight against the Header and Footer band bar. This means that you will have to resize the band larger if you want to put something in those bands. Always look for the "^" and a name in the bar that specifies what type of band is above the bar. Even when the bars are tight together you can still click on the bar of the band you want to increase and scroll down the screen.

NOTE: When you resize a band all the bands below move up or down automatically. As you create large reports you may move part of the report format off the page. A standard scroll bar will appear on the right side of the editing area that will allow you to move the format up and down. The same applies if the format is too wide to fit the area available.

The first step is to put a title in the Header band. Click on the TppLabel object (the one that looks like an A by itself) and click anywhere in the Header band. It should put a small object that says "Label1" or something similar. If you look at the OI you should see TppLabel in the display box near the top and the properties appropriate to this object should be displayed.

In the Caption property enter: A Simple Report. When you press the ENTER key or otherwise move off the property that caption will take the place of the Label1 name. This works just like the TLabel object did in the Screen Editor. Now, click on the object and drag it to the top of the band so that it's tight against the ruler. Once you have it there try dragging it down one step. You'll see the snap-to-grid process working just like you did in the Screen Editor.

Make the font a little bigger by clicking on the font size drop down box in the palette. Change the font size to 14.

Click on the "Center Horizontally" button in the palette above the format. This is the button that looks like three books between bookends. The hint that appears when you hold the mouse over the button is: "Center Horizontally in Band." Your caption should now be centered in the band.

Drop a TppSystemVariable object below the label you added above. Notice that it uses the same font size that was changed above. That's ok for right now but you'll want to make sure to change the size back to 10 before you put the actual data fields on the form. In the VarType property click on the down arrow and choose the vtDateTime property. To finish with this object click on the Center button to center this object in the band.

To the right of the report title drop another TppSystemVariable. You might want to change the font size back to 10. Set the VarType property to vtPageNoDesc. Set Left to 7.25 and Top to 0.0833 (top should be the same as the report title).

NOTE: If you change the size or location of any object, including bands, by adjusting the object directly, the new sizes/locations will not be updated in the OI until you switch to a different object and then switch back. The status bar at the bottom of the report format will give you up-to-date information.

Put the following TppLabel objects on the report form in the Header band (they should be placed so that they rest right on the bottom of the band or just above the band name bar):

TppLabel: Caption=Cust Code Left=2.2187

TppLabel: Caption=Customer Information Left=3.0833

TppLabel: Caption=Phone Number Left=5.6667

Now you're going to put fields on the report. Click on the TppDBText icon on the palette and drop it in the Detail band (directly below the Header band). The Top property value should be 0. This means that it's at the top of the current band (or directly below the Header band name bar). Set the Left property to 2.3333. Double click in the DataField property. The same dictionary field lookup grid that you are familiar with from the screen and source editors is displayed

NOTE: You don't have the option to display defined fields from a source file since the report editor is disconnected from the screen/source editors. However, you can switch back and forth by clicking on the TAS Professional button in your task bar to return to the screen/source editor or the TAS Report Writer button to return to the Report Editor.

If the CUSTOMER file is not displayed as the initial choice then click on the drop down button and choose the CUSTOMER data file. Then double click on the CUSTCODE field. The value CUSTCODE{3} will be placed in the DataField property. The {3} specifies that the field is 3 characters in size when displayed.

NOTE: You can also enter your own field names. Case doesn't matter (upper or lower). As long as the names you enter here match the values in the record or elsewhere in your program. Whatever you put here will be used when running the report. You can even use arrays, so a legal DataField property value might be test[1] or fld_lname[cntr], etc.

The reason the program keeps the display size is to help you estimate the width you need when the report runs. To set the default object width double click on the Width property value. The object will change in size to approximately 0.2844. This might be a little narrow since the field will be all upper case characters so increase the Width to 0.3229.

Now add the following fields to the report. The Top property value is provided since the other fields will be placed under one another. Make sure the Detail band has enough vertical room for the objects. If you need some more space just click and hold on the Detail band name bar and pull it down a little. It should be at least 1" in height or more. You will shorten it up when you're done.

TppDBText: DataField=CUSTNAME Left=3.0833 Top=0 Width=2.375

TppDBText: DataField=CUSTCOMP Left=3.0833 Top=0.1979 Width=2.375

TppDBText: DataField=CUSTADDR Left=3.0833 Top=0.3958 Width=2.375

TppDBText: DataField=CUSTCITY Left=3.0833 Top=0.6042 Width=2.375

TppDBText: DataField=CUSTSTATE Left=3.0833 Top=0.8021 Width=0.2083

TppDBText: DataField=CUSTZIP Left=3.4167 Top=0.8021 Width=0.9479

TppDBText: DataField=CUSTAREA Left=5.6667 Top=0 Width=0.2844

TppDBText: DataField=CUSTPHONE Left=6 Top=0 Width=0.7583

Move the Detail band name bar up so that it's directly under the last text field you put on the form (State & Zip). If you click on the band directly the Height value should be about 0.9687. Notice that the PrintHeight property has been set to phStatic (the default value). If you add to the Height value there will be a space between the blocks of data when it prints. If there's no space then there will be no space between the records when they print.

There is no need for a Footer so turn it off by clicking on the Report->Footer menu item. The check mark next to the name will be removed and the Footer band will also.

When you get here the report format should look like the following:

Click on File->Save. The standard save dialog will be displayed. Enter SimpleReport for the file name and click on the SAVE button.

Next you need to add the code to your program to link in the report format. Click on the TAS Professional button in your task bar to bring the screen/source editor active. If screen (SOEntry.DFM) is not loaded do so now.

Add a TButton to the screen at Left=376, Top=200, Width=75, Caption=Print, Name=btnPrint. The button should be placed between the navigator and the exit button. Save the screen form.

Load the source file (SOEntry.SRC) if it isn't already loaded. Add the following line immediately after the second #WinForm line:

#WinReport SimpleReport

This has basically the same effect as the WinForm compiler directive. It will load the report form during compilation and will make sure that all of the fields used in the report will be part of this program, even if they aren't used anywhere else.

At the bottom of the current code (after the lookup .SELECT routine) put the following:

btnPrint.click:

setup_report_buff rb_num 1 reportname 'simplereport'

scan @cust_hndl key custcode

output_report_data rb_num 1

ends

print_report

ret

The first line is the standard event label that you should be familiar with by now. The second line tells your program to load the report form and setup the first buffer. A modification of this report later will show how to setup multiple buffers.

NOTE: You must always setup buffer 1 first and specify the report name as part of that command.

The third and fifth lines (SCAN and ENDS) scroll through the customer file in customer code order. The line in the middle (output_report_data), creates the buffer records that will be used to print the actual report. The fields you have placed on the report form will be accessed to create the buffer records. The PRINT_REPORT command will do the actual printing. The last line, of course, is the standard RET from all event routines.

You can easily change the records that appear in the report by modifying the SCAN command. Restrict the records printed or change the order the records appear by changing the KEY value.

Compile the program by clicking on the Compile button or by pressing the F9 key. After the program compiles (assuming it compiled properly), press the ENTER key twice (once to acknowledge the end of the compiling process and once to Run the program). Click on the Print button (if the button doesn't show up on the screen form make sure you've saved it). Something similar to the following should be displayed:

The picture below shows the controls at the top of the report preview screen:

To print the report to a printer click on the printer icon (far left). The next three icons and the percentage entry field control how large the preview is on your screen and how much of the page you see. The second entry field that is surrounded by navigator type buttons controls which page is displayed. You can enter the page number directly or use the first page, previous page, next page or last page buttons. The Close button exits the print preview.

Bring up the Report Editor again and make some changes to the report format; move fields around, add some space at the end of the Detail band, etc. Save the report form and run the program again, no need to recompile unless you add fields to the report.

A Slightly More Complex Report

In this version of the Simple Report you're going to add a second page, access a second file (SALES), do some totaling, and even a little print control.

NOTE: If you are running the DEMO version of TAS Professional you will not be able to make these changes since you're limited to a single page in that version of the report writer.

In the SimpleReport format make the following changes:

Increase the size of the Detail band to at least 1.75 inches. This will give you some room for the new objects. Now drop a SubReport object (looks a little like a yellow notepad) in the Detail band below the City and Zip fields.

NOTE: SubReports MUST ALWAYS be placed in Detail bands. You will not get the desired results if you place it anywhere else.

Uncheck the ParentWidth property check box and then change the Left property to 3.0833 (must be done in this order). This will allow you to start the layout of the subreport at the left side and still have the lines align properly. This isn't necessary, however, it gives you an idea of what can be done.

Since this is a SubReport you need to set the Tag property. The number you set here will be the same value you specify in the RB_NUM option in the report commands in your program. Since the main page defaults to 1 this must be from 2 to 15. You should always increment the Tag property sequentially, that is, use 2 then 3, then 4, etc. Set the Tag value to 2.

NOTE: In very complex reports where you have several SubReports and the buffers are linked to previous buffers don't worry about keeping the links in order. For example, you might have buffer 2 and 5 linked to 1, buffer 3 linked to 2 and buffer 4 linked to 3.

At the bottom of the edit window you should now see two tabs. One will say Main, this is the first or default page, and one will say SubReport1 (if you haven't changed the Caption). If you click on the SubReport1 tab you will see three empty bands, Title, Detail and Summary. You aren't going to use Summary so click on the menu item Report->Summary and that band will disappear. In the Title band (this will print each time this SubReport is printed) place the following objects (the Top property should be 0 for all):

TppLabel: Caption=SO Num Left=0.0833

TppLabel: Caption=Date Left=0.75

TppLabel: Caption=Amount Left=1.9687

TppLabel: Caption=G/L Acct Left=2.5833

Move the Title band bar up until it is directly under the TppLabel objects. The PrintHeight property for the band is automatically phStatic. If you don't reduce the space under the objects there will be a space between the titles and the data. If you want to include a space you would do that here by leaving some distance between the bottom of the labels and the Title band bar.

In the Detail band place the following objects (again the Top property should be 0 for all):

TppDBText: DataField=SONUMBER Left=0.0833 Width=0.5687

TppDBText: DataField=SODATE Left=0.75 Width=0.7583

TppDBText: Alignment=taRightJustify DataField=SOSALESAMT Left=1.5833 Width=0.8531

TppDBText: DataField=SOGLACCTNUM Left=2.5833 Width=0.5729

Again, you want to reduce the space under the objects by moving the Detail band bar up until it's directly under the line of objects.

Click on the Main tab and return to the first page. You'll probably want a total to print for each group of orders so you'll need to use the Group feature. To do so, click on the Report menu item and then the Groups option. The following dialog will be displayed:

In your Groups box, CUSTCODE may not be the first item displayed, it depends on the order you placed the objects on the report form. If CUSTCODE is not at the top click on the down arrow and choose it. Next click on the Add button. This will choose the CUSTCODE object as the controlling field for this group. Each time CUSTCODE changes the report will consider the group to change.

The group specifier (Group[0]:DBText1: CUSTCODE will be displayed in the group box directly under the drop down box. You can now make other choices for this group. The Break On value will always be Custom Field so you don't have to change this. If you want to always start on a new page (this would be the normal choice for checks, invoices, etc.) you would check the Start new page option, in this case it would just be a waste of paper so leave it unchecked. The Reset page number option applies only if you check Start new page so this will remain unavailable. The New page when less than option expects a number of lines to be entered. This is similar to Start new page, again we'll leave it at the default value. Keep group together will make sure that a group doesn't start on a page unless there's enough room to print all the lines for that group. You don't have enough data to fill a page, however, if you add some data you can see this at work, so leave this option checked. You aren't going to enter any group header objects so uncheck the Reprint group headers… option. Then click the OK button to create the new group.

After you create the group you will notice two new band bars. One is the Group Header[0]:… and the other is Group Footer[0]:… You're not going to add any new objects to the group header so just ignore it. However, you are going to put a field in the group footer. Increase the size of the group footer by clicking on the Group Footer[0] band bar and, while holding down the left mouse button, move the bar down the screen. You won't need much room, just enough for one line and a little extra. The ending Height property value for this band should be something near 0.3021.

The total values will be placed in the group footer band. This band will print once each time the group changes at the end of the group information. In the Group Footer[0] band place the following objects:

TppLabel: Caption=Total Sales Amount: Left=3.4896 Name=ppTSALbl Top=0

TppDBText: Alignment=taRightJustify DataField=TotSales Left=4.8437 Name=ppDBTSA Top=0 Width=0.6771

For both of the objects above check the OnPrint Control Flag checkbox. This will tell the program to check for a field that has the same name as the object in the source program. If one is found then during the report the field will be checked for the value "ON" or "OFF". If the field is set to "ON" then the object will print, if set to "OFF" it won't.

Notice that the Name property for both of these objects has been changed from the default value. You didn't have to, however, you're going to refer to these objects in your program. This is the same concept you followed when you created your first screen form at the beginning of this tutorial. When you're done the report form should look something like the following:

Main Page:

SubReport1 Page:

Finally, you need to save the report format. To make things simpler, just save the new format using the same name. Click on the File menu item and then the Save option. You don't have to exit out of the Report Editor at this time.

IMPORTANT NOTE: YOU MUST BE ON THE MAIN PAGE EACH AND EVERY TIME YOU SAVE A REPORT FORMAT. IF YOU DON'T THE FORMAT WILL NOT BE ABLE TO BE LOADED THE NEXT TIME.

Go back to the Source Editor and load the SOEntry.SRC file if it isn't already. Modify the source code so that it matches the following:

btnPrint.click:

define TotSales type n size 10 dec 2

define ppTSALbl, ppDBTSA type a size 3

set_object get_form_name() property 'No_Refresh' value True

setup_report_buff rb_num 1 reportname 'simplereport'

setup_report_buff rb_num 2 link_to 1

scan @cust_hndl key custcode

output_report_data rb_num 1

TotSales = 0

scan @sales_hndl key SOCUSTCODE start custcode while socustcode=custcode

TotSales = TotSales + SOSALESAMT

output_report_data rb_num 2

ends

ppTSALbl = iif(TotSales=0,'OFF','ON')

ppDBTSA = ppTSALbl

update_report_data rb_num 1 fldlst 'TotSales','ppTSALbl','ppDBTSA'

ends

print_report

set_object get_form_name() property 'No_Refresh' value False

ret

The first changes after the event label are two DEFINE commands. The first creates a field (TotSales) that will be used to total the individual sales records for each group. The second creates two fields (ppTSALbl and ppDBTSA) that match the names you assigned to the two fields that print in the Group Footer[0] band. These fields will be used to turn off the printing of the objects if the TotSales value is 0.

There are two SET_OBJECT commands at the beginning and end of the routine to turn off the screen refresh process. If you don't do this the entSOCust.Change event will be called each time a SALES record is found. The first SET_OBJECT turns the refresh off the second turns it back on, which must be done before you exit this routine.

The first SETUP_REPORT_BUFF command you have already seen. The second now sets up the SubReport1 page. The RB_NUM 2 option here connects to the Tag property value you set for the SubReport object when you placed it on the Main page. The LINK_TO 1 tells the program that the records in buffer 2 are connected to the records in buffer 1. If you don't do this the sales records will not print since they won't be found when the customer records are printed.

The SCAN command accessing the CUSTOMER file is the same as the previous version along with the OUTPUT… command. Next the TotSales field is initialized. A new SCAN command is inserted into the CUSTOMER loop to search for SALES records for the particular customer. The START option uses the current CUSTCODE value to find the first SALES record and the WHILE option will find records that only match the current customer.

The next line totals the sales amounts and then the information for the SubReport is output to buffer 2. The ENDS command is the end of the scan loop for the SALES file.

The next three lines control whether or not the sales total will print at all. The first line tests whether the TotSales field is 0. If it is then the field ppTSALbl is set to 'OFF', otherwise it's set to 'ON'. Then the second field is set to the same value as the first. The third line updates the data output by the original OUTPUT…RB_NUM 1 command. Until the next OUTPUT… command to the same buffer number the last data values remain in memory and can be changed with the UPDATE… command. That's what's happening in this case. You're updating the TotSales values and whether or not to print that object and the TppLabel object that also prints in the group footer band. As explained previously, if the fields that have the same name as the objects are set to "OFF" the objects won't print, if set to "ON" they will.

The rest of the routine is the same except for the SET_OBJECT command that turns the screen refresh back on.

Compile the program, and, assuming you don't have any errors, run it. When you print the report it should look something like this:

The sample above includes some extra SALES records that were entered separately.

If you find the TotSales prints even when it's zero make sure you've checked the OnPrint Control Flag for both objects that are in the Group Footer[0]. Click on the object and check the box at the top of the OI. Don't forget to resave the report format. You don't have to recompile the program after a change like this.

This finishes the second report. You should now have an idea of the power of the report writer. Very complex reports can be created easily and quickly with a minimum of code required.

Next Chapter Part 5 - Adding a Menu to a TAS Professional program.


Part 5 - Adding a menu to a TAS Professional Program

Navigation: Tutorial >

Part 5 - Adding a menu to a TAS Professional Program

 Print this Topic Return to chapter overview

It's very easy to add the standard Windows® type menu to a screen form. Reload the SOEntry.DFM file in the screen editor if it's not already loaded.

From the Standard palette tab drop a MainMenu object on the screen form. This is a non-visual object and will just place the icon on the form. Right click on the icon and click on the Menu Designer option. The following property editor will be displayed:

Click on the button that looks like a plus sign (hint is Add Item). A MenuItem will be placed in the tree and will appear at the top of the screen form.

NOTE: When you start adding menu items the screen may exceed the size you've allowed and horizontal/vertical scroll bars will appear. Stretch the screen out from the lower right corner and the scroll bars will disappear.

Click on the item (in the tree box) and you can change the Caption property directly. Enter &File as the new caption. The "&" (ampersand) before the F in File tells Windows® to allow the user to enter ALT-F to choose this menu item. Press the ENTER key and File should replace MenuItem at the top of the screen form. This is a standard first file menu in any Windows® program.

To add an additional top level menu item you would click on the Add Item button again. To add a sub-level item, one that won't appear until the user clicks on the top level item, click on button to the right of the Add Item (it looks like an arrow over the + symbol). Once again, click on the tree item that says MenuItem and change the caption to &Print. The property editor should now look like this:

In the OI change the Name property value to mniPrint (menu item Print). Now exit from the property editor (click on the X in the upper right corner). Save the form by clicking on the Save button.

NOTE: If you click on the File menu item, at the top of the screen form, the Print option should display just like a standard drop down menu.

Reload the source file (SOEntry.SRC) if it isn't already loaded. Add the event label mniPrint.Click: directly after or before the existing event label btnPrint.Click:. This will allow the user to either choose the item from the menu or by clicking the Print button.

NOTE: You cannot have two objects on the same screen with the same name. This means that you must have multiple event labels if they both/all call the same routine.

Compile the program and run it. When you click on File and then choose the Print option the report should print just like it does when you click on the Print button.

The only difference between this simple example and more complex menus is the number of MenuItems and the event labels you add to your program.

NOTE: The Tutorial, completed through this section, is in the subdirectory \TutComp. If you installed TAS Professional in C:\TASPro \ then you would look for C:\TASPro \TutComp\. You can set the up as a Dev Path just like you did the Tutorial itself.


Part 6 - Modifing an existing data file

Navigation: Tutorial >

Part 6 - Modifing an existing data file

 Print this Topic Return to chapter overview

Some times it is necessary to modify a data file that contains active records. In this section you will add a field, Part Number, to the Sales file. You will use Maintain Data Dictionary to add the field and the Restructure utility to actually modify the data file.

Maintaining the Data Dictionary

Select the Program->Maintain Data Dictionary menu item. Enter SALES as the FD name (directly or from the drop down list). Click on the Edit button and the screen should look like the following:

The file layout for the SALE file is shown above. Press the ^END (CTRL+END) key. This will take you to the Description column for the last line. Press the ENTER key twice (the first time will put you in edit mode, the second will add a new line). Enter the following information for the new field:

Long Field Name: SOPARTNUM

Short Field Name: Use Default Value

Type: A

Size: 15

Dec Chrs: 0

Array: 0

Upcase: Checked

Description: Leave blank

Click the Save button. Press ENTER or click on the Yes button at the question about saving the changed FD.

Restructuring a Data File

After you have modified the file layout you can restructure the data file. Use this instead of the Initialize routine when there is data in the file you want to keep. This process will make the changes to the actual data that you have made to the FD. You would use the Restructure option to add fields, remove fields, make them smaller, larger, add or remove indexes, etc. It can even add or subtract array elements. The only thing Restructure can't do is change a field from one type to another. If there are no active records in the data file, you should use the Initialize option instead.

NOTE: In normal operation it is wise to make a backup of your data before you restructure the file. What is going to take place is on a par with major surgery. If anything goes wrong you will not be able to recover your data without that backup. In this case you won't because this is only test data.

Click on the Options menu item. You should still be at the initial screen from the process above. If you are not please run the Maintain Data Dictionary program again.

Choose the Restructure File option. A message will be displayed about making a backup first. Click on the Yes button to continue. You cannot just press the ENTER key since the default is No. The following dialog will be displayed:

Enter SALES directly or choose the file from the drop down list. Then click the Restructure button. A screen is displayed showing the records being moved to a temporary file and then saved back to the original file. Since there are so few records this will happen very quickly. When it's finished click the Exit button. Finally, click on the Exit button to quit the program.

Modifying the Sales Entry Program

After the data file has been modified and restructured you can easily add the new field to the screen and report formats. By now you should feel comfortable enough to accomplish this without further assistance. Just load the screen format, drop a TTASEnter object on the form, (don't forget to set the FieldName property), save the form and you're done. In the Report Editor, load the format, place a TppDBText object on the SubReport1 page Detail band. Again, don't forget to put the field name in the DataField property, save the report format and that's done also. You do have to recompile the program since the field is not referred to anywhere else and, if you don't, it won't show up. Once the program is compiled you can enter values into the field and print those values out without writing a single line of code!

As an exercise you may want to create a part number file and do a lookup when entering a sales order so you cannot enter an erroneous part number. The part number file might contain a description for the part number, the current selling price, the last sale date and the total sales to date.

As you can see from this tutorial, TAS Professional has the flexibility to be used as a simple data manager and the power to build sophisticated applications. With the utilities available we think you will agree that TAS Professional is just the tool for today's demanding data management and GUI application development requirements.

If there is anything we can do to help you or your Company in your MIS needs. From Customizing TAS Professional for your Business to writing or converting your business applications to TAS Professional. Please feel free to contact us by Email at support@cassoftware.com or Call our office at (800) 358-4222 or (928)257-1236.

Thank you for taking this tour of our software solution Computer Accounting Solutions. We the Staff of Computer Accounting Solutions Look forward to working with you in the future.


.topic 6803
Sysops(15)

PURPOSE
This function will restart the tasruntime.exe

NO OTHER PARTS

RETURN TYPE - L
Returns True  .T.

EXAMPLE
 mnilogin.click:
  //sysop(15) is a non documented feature in TASPRO that restarts the runtime
  //used here to re logon as a new user
     dummy_l =sysops(15)
    quit 0
ret
.topic 6804
Sysops(1,2,3,4,5,6,7,8)
PURPOSE
This function is for odd and seldom used function. Depending on the first parameter function code. it unlike most of the TAS professional functions has multiple functions in this one function.
PARTS
1. f/c/e    Required Function Code (See Below)
Function Codes:
0 :  Make next program Active.
1 :  Check for application ending
2 :  Return whether or not the file manager is On or Off
3 :  Creates a Unique file name (Good for creating Temporary file names)
4 :  Path Exists ( Superseded By Dir_exist()
5 :  Force Create Directory (Superseded by Switch in Make_dir()
6 :  Change file Manager Status
7 :  Create menu Item (Menu Object must exist First)
8 :   Setup popup button
9 :   Create  Popup  Menu
10 :    Is new runtime (if program was run from a newruntime option)
11 :   Is file manager in use.
12 :   Create Icon on Desktop
13 :    Not used
14 :   Direct Port Access (Parallel or Serial)
15 :   Restart TASRuntime (Good for changing logins)

 2. f/c/e    Depends on Function

     Function Code :
    3 :  Path name (Alpha)
    4 :   Path name (alpha)
    5 :  Path name (alpha)
    6 :  ON or OFF (logical)
    7 :  Parent menu Object
       8 :  Button Object to use.
    9 :  Popup menu name
    12:  Where ‘S’ = Startup / ‘D’ = Desktop
    14:  Port String (i.e. ‘lpt1:’ or ‘com1’)

3. f/c/e     Depends on Function

     Function Code :
    3 :  Extension
    7 :  Name of New Object
    8 :  Popup menu to use
    12:  Folder the program exists in..
    14:  String to Output

4. f/c/e     Depends on Function

     Function Code :
    7 :   Menu Caption name
    12:  Name of Link
    14:  Number of Character to output (required)

5. f/c/e     Depends on Function

     Function Code :
     7 :   Short cut Key
     12:  program String

6. f/c/e     Depends on Function

     Function Code :
    12:  Parameter String

7. f/c/e     Depends on Function

     Function Code :
    12:  Working Folder Name

8. f/c/e     Depends on Function

     Function Code :
    12:  ICON file name

RETURN TYPE -  (Varies on Function called )
Default Logical unless otherwise noted.

 Function Codes:
:  Returns an Alpha file name.

Comment
This Function is not supported and could change between versions we are only documenting this to try and keep good records of the language.


 Sysops()

Sysops(1,2,3,4,5,6,7,8)

PURPOSE

This function is for odd and seldom used function. Depending on the first parameter function code. it unlike most of the TAS professional functions has multiple functions in this one function.

PARTS

1. f/c/e Required Function Code (See Below)

Function Codes:

0 : Make next program Active.

1 : Check for application ending

2 : Return whether or not the file manager is On or Off

3 : Creates a Unique file name (Good for creating Temporary file names)

4 : Path Exists ( Superseded By Dir_exist()

5 : Force Create Directory (Superseded by Switch in Make_dir()

6 : Change file Manager Status

7 : Create menu Item (Menu Object must exist First)

8 : Setup popup button

9 : Create Popup Menu

10 : Is new runtime (if program was run from a newruntime option)

11 : Is file manager in use.

12 : Create Icon on Desktop

13 : Not used

14 : Direct Port Access (Parallel or Serial)

15 : Restart TASRuntime (Good for changing logins)

2. f/c/e Depends on Function

Function Code :

3 : Path name (Alpha)

4 : Path name (alpha)

5 : Path name (alpha)

6 : ON or OFF (logical)

7 : Parent menu Object

8 : Button Object to use.

9 : Popup menu name

12: Where ‘S’ = Startup / ‘D’ = Desktop

14: Port String (i.e. ‘lpt1:’ or ‘com1’)

3. f/c/e Depends on Function

Function Code :

3 : Extension

7 : Name of New Object

8 : Popup menu to use

12: Folder the program exists in..

14: String to Output

4. f/c/e Depends on Function

Function Code :

7 : Menu Caption name

12: Name of Link

14: Number of Character to output (required)

5. f/c/e Depends on Function

Function Code :

7 : Short cut Key

12: program String

6. f/c/e Depends on Function

Function Code :

12: Parameter String

7. f/c/e Depends on Function

Function Code :

12: Working Folder Name

8. f/c/e Depends on Function

Function Code :

12: ICON file name

RETURN TYPE - (Varies on Function called )

Default Logical unless otherwise noted.

Function Codes:

3 : Returns an Alpha file name.

Comment

This Function is not supported and could change between versions we are only documenting this to try and keep good records of the language.


Sysops(15)

PURPOSE

This function will restart the tasruntime.exe

NO OTHER PARTS

RETURN TYPE - L

Returns True .T.

EXAMPLE

mnilogin.click:

//sysop(15) is a non documented feature in TASPRO that restarts the runtime

//used here to re logon as a new user

dummy_l =sysops(15)

quit 0

ret