22
External Executable Tools The Master's Touch David L. Blankenship

External Executable Tools The Master's Touch David L. Blankenship

Embed Size (px)

Citation preview

Page 1: External Executable Tools The Master's Touch David L. Blankenship

External Executable Tools

The Master's TouchDavid L. Blankenship

Page 2: External Executable Tools The Master's Touch David L. Blankenship

What features do I want?

• Ability to establish columns programmatically• Ability to format the column (right justified, left

justified, centered, numeric, integer, and a variety of date formats

• Ability to sort ascending and descending• Ability to specify column width and grid

properties number of rows, colors, buttons, and provide the results in a usable format for continued processing

Page 3: External Executable Tools The Master's Touch David L. Blankenship

How are values passed in?

• The application is command line driven where the switches control the behavior

• Each switch is a dash followed by a character and in some cases a value. Switches appear in any order on a space delimited command line

• At a minimum, -B and -F must be specified, optional switches allow positioning of the grid on the display, set the constraints of size, appearance, features, etc.

Page 4: External Executable Tools The Master's Touch David L. Blankenship

What do the switches do?

• The file named in the -B parameter defines the location where the results will be returned

• The file named in the -F parameter is formatted to contain the information required to set the column appearance, the data appearance in the column and finally the data.

• An optional file defined by -W allows the data to come from a BR internal file. In this case part of the -F file defines the fields to display.

Page 5: External Executable Tools The Master's Touch David L. Blankenship

What is in the file?

The first line of the source file (referred to as the -F parameter) is the name of each column followed by a colon and the desired width of the column (pixels). Columns are separated by a pipe character.

The second line describes the format used to display the data.

The third and following lines are the data fields in pipe delimited format.(Use of a BR internal file to provide the data will be discussed separately)

code:60|Description:130I5|l1|State Govmt2|County Govmt3|Restaurant4|Fast Food5|Construction6|Piddle15|Playing

Page 6: External Executable Tools The Master's Touch David L. Blankenship

Our First Grid!

The simplest form of the command line is shown below:

C:\brag\...\BRGrid.exe -B999 -Fpiddle.txt

The grid is the product of the data previously shown and the command line above:

Page 7: External Executable Tools The Master's Touch David L. Blankenship

How has the appearance changed?

Expanding the command line with additional switches will alter the grid's appearance and capabilities. Adding the -Z removes the “find feature” allowing a smaller minimum width. The dimensions of the grid are dynamically determined subject to constraints of display resolution (maximum) and optional buttons/features (minimum).

C:\brag\...\BRGrid.exe -B999 -Fpiddle.txt -Z

Page 8: External Executable Tools The Master's Touch David L. Blankenship

Readability changes with color.

The command line switch -A adds alternating background color which defaults to a pale green. C:\brag\...\BRGrid.exe -B999 -Fpiddle.txt -A

Page 9: External Executable Tools The Master's Touch David L. Blankenship

Customized background color.

The command line switch -A followed immediately by a RGB color in hexadecimal format allows a user defined alternating background color.

C:\brag\...\BRGrid.exe -B999 -Fpiddle.txt -AFFCCCC

Page 10: External Executable Tools The Master's Touch David L. Blankenship

What's in a name?

Further addition of the -C parameter adds a caption that appears on the grid caption and on the taskbar.

C:\brag\...\BRGrid.exe -B999 -Fpiddle.txt -AFFCCCC -C”Select the Area of Service”

Page 11: External Executable Tools The Master's Touch David L. Blankenship

The Grid slims down.

Adding the -E switch will remove the upper panel. This is useful when you are wanting to provide a “pick list” for values to populate a BR field (limited to values in the list).

C:\brag\...\BRGrid.exe -B999 -Fpiddle.txt -Z -E

Page 12: External Executable Tools The Master's Touch David L. Blankenship

It continues to shrink!

Continuing to add switches, -J will remove the bottom panel but it requires -M (which turns multi-select OFF) and -Z ( turns OFF the “Find feature”).

C:\brag\...\BRGrid.exe -B999 -Fpiddle.txt -Z -E -J -M

When this style is used a single row may be selected by double-clicking on the row itself, highlighting the row and pressingEnter, or exiting without selecting anything by pressing Escape, which is always an option.

Page 13: External Executable Tools The Master's Touch David L. Blankenship

Controlling the height.

Continuing to add switches -N# specifies the number of rows to display. If the actual number of rows of data is less than the number specified, the number will be reduced to the actual number of rows.

C:\brag\...\BRGrid.exe -B999 -Fpiddle.txt -Z -E -J -M -ACCCCFF -N5

Page 14: External Executable Tools The Master's Touch David L. Blankenship

Changing the border style.

Additional changes to appearance may be made with either -S1 (left) or -S2 (right)

C:\brag\...\BRGrid.exe -B999 -Fpiddle.txt -Z -E -J -M -S1

Page 15: External Executable Tools The Master's Touch David L. Blankenship

Changing the font.

The -O# switch changes the default font size (points). The grid on the left is the default 10 point size. The one on the right uses -O12.

C:\brag\...\BRGrid.exe -B999 -ACCCCFF -Fpiddle.txt -Z -E -J -M -O12

Page 16: External Executable Tools The Master's Touch David L. Blankenship

Working with BR Internal Files.

The -W switch names a BR internal file (typically requires a drive letter and path) as the data source. Lines 3 and higher in the -F file now describe the fields to be included as columns in the grid .

C:\brag\...\brgrid.exe -B001 –Fclient_desc.txt -N10 -Wbrclient –ACCCCFF The contents of the source file (-F) is shown below. Notice lines 3+ are different.

Cust#:70|Name:175|Address 1:150|Address 2:150|City:120|ST:40|MailCode:80R|L|L|L|L|L|LC|1|6|SC|7|40|SC|47|30|SC|77|30|SC|107|20|SC|127|2|SC|129|10|S

Page 17: External Executable Tools The Master's Touch David L. Blankenship

Working with BR Internal Files.

The -W switch causes the data to be read from the BR internal file.

C:\brag\...\brgrid.exe -B001 –Fclient_desc.txt -N10 -Wbrclient –ACCCCFF

Page 18: External Executable Tools The Master's Touch David L. Blankenship

Pre-Sorting a Grid

The -@ switch allows you to specify the direction and column number to be used to pre-sort the data for display. C:\brag\...\brgrid.exe -B001 –Fclient_desc.txt -N10 -Wbrclient –ACCCCFF -@A2

Page 19: External Executable Tools The Master's Touch David L. Blankenship

What is a filter?

Finally, we discuss “filters”. By right clicking on the column heading of the column to be filtered, a filter screen is displayed. Enter a value and select the action to keep or remove the matching records. I will keep “chicago” in this example.

Page 20: External Executable Tools The Master's Touch David L. Blankenship

How is the appearance changed?

The filtered results are shown below. Notice “North Chicago” remains. To select all records at this point, I have used Ctrl-A to select all and click “OK” to write the date to the result file. Notice the caption is altered to include “filtered”, the button text is in “red” and the record count is displayed in “red”.

Page 21: External Executable Tools The Master's Touch David L. Blankenship

Additional switches

Left-clicking on a column heading will cause the grid to be sorted in ascending order, left-clicking again on the same column will cause the column to be sorted in descending order.

Many other switches are provided for specific functions and are described in the documentation.

In addition, you should refer to the common switch documentation manual which fully describes the switches that are common to all of the utilities Dixon and I have written.

Page 22: External Executable Tools The Master's Touch David L. Blankenship

Practical Workshop Exercise

You previously created a BR program to select column headings from the census.csv file. Today we will build on that program. Using the column heading selection routine, create a source file (-F) that contains the selected column headings with the necessary formats.

Additionally, read the data rows from the census.csv file and populate the file with the selected columns from the 5900 records. (For simplicity use left justified text for all columns in the grid)

Display the file you have constructed to present the data in a grid with alternating background colors. The displayed data should be sorted by the last_name column which must be included in the selection process.

Finally, for extra credit, add a button that would offer the ability to “Print” the selected rows by displaying a custom button.

As a grand finale, use BRRegister to determine the location of your spreadsheet program (on your computer, you must know the name of the exe file that runs the software), and load the selected records from the result file in a spreadsheet.