ComponentOne Sizer 8.0
The C1Awk Control

Before you can use a C1Awk control in your application, you must add the C1AWK.OCX file to your project. If you use the control in most of your VB projects, you may want to add it to VB's Autoload file.

To distribute applications you create with the C1Awk control, you must install and register it on the user's computer. The Setup Wizard provided with Visual Basic provides tools to help you do that. Please refer to the Visual Basic manual for details.

The C1Awk is the most unusual of the controls in the SizerOne package, because it is the least visual of the three. However, once you have become accustomed to its text parsing capabilities, you will probably find it very useful.

The C1Awk control allows you to quickly scan and parse text files. It is the ideal tool for doing simple data manipulation -- changing its format, checking its validity, retrieving items, generating reports, and the like -- without having to write a lot of code to scan and parse files.

The C1Awk control is similar to the original AWK language in concept and purpose; however, as the Awk control is embedded in Visual Basic, it is substantially different in syntax. The most apparent omission is a pattern matching mechanism, which in Visual Basic is provided by its Like operator.

The simplest way to use the C1Awk control is to set its FileName property to the name of a file you want to work with, set the Action property to 0 - acScan and supply a Scan event handler to collect the information you want. The Awk control will read the file, one line at a time, parse the line into fields according to the FS property, and fire the Scan event for each line.

The following topics show three examples of tasks you can accomplish with the C1Awk control:

See Also

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback