| SATGUI Examples |
|
| Home | SATGUI | SATSHELL | SATFORM | SATFILTER | SATREPORT | SATMYSQL | License | Download | Examples | Contact |
"Telephone Directory Application". This is sample code for a basic "Telephone Directory" application.
This example uses a single screen, a single process script and a datafile.
| User Guide |
When logged in to the application the following screen is displayed:
To search the directory: Enter a search string into the "Find" field, then press Enter. All records containing the search string will be listed. The search is not case sensitive.
NOTE: The search string is validated as alphanum. Therefore it must contain letters/numbers and not be null -or- contain spaces.
| Example SAT/DL |
Assume a file called main in the $SATHOME/screen directory with the following contents:
newScreen {{"Telephone Directory" replace} 80x18}
addEntry {Find 1,1 6,40 alphanum focus validate {main find}}
addMultiList {result 1,4 11 {Last_Name,25 First_Name,25 Number,20} outline yscroll}
setMessage {"Type search string, then press Enter"}
The addEntry command sets the validation pattern for the field to "alphanum".
When the Enter key is pressed when the cursor is in the find field, the content of
the field is validated against the "alphanum" pattern. If the validation is successful
then the "main" process is run with the value of the "find" field as a parameter. If
the validation fails an Invalid Find message
is displayed on the message line.
| Example SATGUI Process |
Assume a file called main in the $SATHOME/process directory with the following contents:
grep -i ${4} /home/demo/config/numbers |
nawk '
BEGIN {Result = "setItem {result"}
{Result = Result " {" $0 "}"}
END {print Result "}"}'
NOTE: The first parameter associated with a SAT/DL action is passed as parameter
four to the SAT/DL process (See Process).
| Example Data |
Assume a file called /home/demo/config/numbers with the following contents:
Barker\tJackie\t678-8765 Brooks\tCarole\t678-9876 Brown\tSusan\t890-5678 Flynn\tPatrick\t654-0987 Jones\tMary\t987-6543 Jones\tPaul\t321-9876 Mills\tJohn\t321-0987 Patterson\tSimon\t456-7654 Smith\tDerek\t876-2345 Smith\tJohn\t123-4567 Smith\tPaul\t543-7890Where \t represents a TAB character.