home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
spoc88
/
scrhnd
/
testprog.pro
< prev
next >
Wrap
Text File
|
1988-04-18
|
3KB
|
86 lines
/* Listing 4: TESTPROG.PRO */
/*******************************************************************
Turbo Prolog Toolbox
(C) Copyright 1987 Borland International.
HNDBASIS
This sample shows the minimum structure of a program using the
screen handlers.
*******************************************************************/
/*******************************************************************/
/* Domains */
/*******************************************************************/
include "xtdoms.pro"
DOMAINS
FNAME=SYMBOL
TYPE = int(); str(); real()
/*******************************************************************/
/* Database predicates */
/*******************************************************************/
DATABASE
/* Database declarations used in scrhnd */
insmode /* Global insertmode */
actfield(FNAME) /* Actual field */
screen(SYMBOL,DBASEDOM) /* Saving different screens */
value(FNAME,STRING) /* value of a field */
field(FNAME,TYPE,ROW,COL,LEN) /* Screen definition */
txtfield(ROW,COL,LEN,STRING)
windowsize(ROW,COL).
notopline
/* DATABASE PREDICATES USED BY VSCRHND */
windowstart(ROW,COL)
mycursord(ROW,COL)
/* Database declarations used in lineinp */
lineinpstate(STRING,COL)
lineinpflag
/*******************************************************************/
/* Include tools */
/*******************************************************************/
include "xtpreds.pro"
include "menu.pro"
include "status.pro"
include "lineinp.pro"
include "xscrhnd.pro" /* Or vscrhnd.pro */
CLAUSES
/*******************************************************************
Field action
*******************************************************************/
field_action(_):-fail.
/*******************************************************************
Field_value
*******************************************************************/
field_value(FNAME,VAL):-value(FNAME,VAL),!.
/*******************************************************************
noinput
*******************************************************************/
noinput(_):-fail.
GOAL
clearwindow,
consult("test.scr"),
createwindow(off),
scrhnd(off,EndKey),
removewindow,
write(EndKey).