home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
clipper
/
funcky.arc
/
VIEW.DOC
next >
Wrap
Text File
|
1988-11-13
|
48KB
|
637 lines
FUNCky Demo Program Copyright dLESKO ASSOCIATES 1988. All Rights
Reserved. No part of this program may be distributed for any
purpose other than to demonstrate the capabilities of the FUNCky
Library for Clipper
View is a sample program written using functions from the FUNCky
library for Clipper that demonstrates usage of the mouse
functions, programming for multiple video modes, font loading and
in general the basic principles when creating dropdown tear off
menus similar to the Macintosh interface. With view you can view
text files in moveable and resizeable windows. View supports
almost every video mode you can throw at it (except graphics
modes) with no special programming. If you have an EGA or VGA and
your adaptor supports 43, 50 or 60 line mode, View will love it.
If you can go up to 132 columns, you can also see how Clipper can
now work in those modes as well.
To start View, simply type View and optionally the drive letter
of the drive you wish to view text files on. As in the sequence:
View C: <return>
Once View has started, a status line on the bottom of the screen
displays the currently selected drive, path and filename. To view
a file, select the directory you want to view, then select the
file, then select view from the menu and a window will open
displaying the contents of the text file. You can bring up
multiple views of the same text file by pressing F1 after you
display the first view window. The maximum
number of windows you can open is 4. Use the mouse to move the
windows to make room for the new window before you open a new
window since only the top window is active.
The various aspects of the mouse functions can be demonstrated as
well. If you have a mouse, you can click on any option to pull
down the sub menu. To select a sub menu item, just click on that
item and it is selected. The idea of tear off drop menus is
accomplished by placing the mouse cursor in the middle of the sub
menu and pressing the right mouse button. While holding it down
you can drag the sub menu anywhere on the screen you like. You
can also re-size the drop down menu by placing the mouse cursor
on the right border of the box and while holding down the right
mouse button, drag the box's border to the right or left. To
display more lines of the drop down menu, place the mouse cursor
on the bottom edge of the box border and while holding down the
right mouse button, pull the box border up and down. Another
type of moveable window is available. In the mode window you
can specify Macintosh like or normal. Macintosh windows move around
a little faster since only the frame of the window is drawn as
you move it. The entire window is repainted only when you release
a key or mouse button.
You can also use the mouse to emulate all the keyboard like
control keys. To scroll up the menu, click the left mouse button
while the mouse cursor is on the up arrow in the control panel.
To scroll down, click the left button while the mouse cursor is
on the down arrow. To page up and page down, click the right
mouse button on the up or down arrow. You can also pan the inner
contents of the menu if the contents exceed the width of the
menu. Just click the left or right button on the left and right
arrows in the control panel of the menu. The file view window
also emulates these same procedures, except that the panning
arrows move the contents of the text file in 8 column increments.
If you don't have a mouse you can still emulate all the above
outlined options using the keyboard. Press the scroll lock key
and then use the arrow keys on the numeric keypad to move the
drop down menu, or the file view window to the position you like
on the screen. When it is in place, release the scroll lock key.
To expand the drop down menus, use the left shift key and the
arrow keys on the numeric keypad to expand or grow the dropdown.
the left and right arrow keys expand the box right and left while
the up and down arrow keys pull up or down the bottom of the
dropdown. To select menu items, you can scroll the highlight to
any item you want and press return to select it.
That's about all there is to view. If you have an EGA or VGA
monitor, you can check out the various screen modes and fonts in
the MODE option on the main menu. Study the VIEW.PRG file to see
how it was done. Note that you cannot compile the source code if
you do not have the FUNCky Library for Clipper. The following
text outlines some of the capabilites of the library. A listing
of the table of contents list the major functions in the library.
Give it a looksee, if you like it I guess I'll be speaking to you
soon.....
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
What is FUNCky you ask? - well, I think it's the neatest library
to ever come out for Clipper.....
With FUNCky you have the largest array of functions ever
assembled in one place. You get top quality documentation on over
400 functions for Clipper. There are also around 30 or so re-
written Clipper functions. They have been written in tighter
faster code. With greater speed so you get increased options.
Like with FILE IO. The low level file funcitons in Clipper have
been completely re-written so that you can now do things like
store your menu options in text files that you can edit inside
the appplication using memoedit(). You can create help systems
that display text files in windows, use the fantastic flocate()
function to locate text strings in files, then use the speedy
freadline() to read the lines of text into a string. You could
use afileread() to load lines of text from a file into arrays.
All the low level file functions of course interact directly to
with Clipper's own ferror() function.
You also get mouse support, not little dweeby functions to read a
mouse button or display a mouse cursor, but real mouse support.
use mx_choice() to emulate achoice() with scroll bars, a control
panel, resizing, dynamically expanding windows, grab the window
and move it. Display DBF files like dbedit() in the same type of
dynamic windows. Use the mouse to select records or scroll the
database. Grab the window and move it so you can pop up several
DBF scroll windows at once!, use mx_view() to view text files in
the same type of moveable-resizeable windows. Create popup,
dropdown, tear off, moveable, resizeable menus, etc. etc. etc.
All in all around 70 mouse functions to do almost anything you
want,
You also get extensive video support. You can use as many video
pages as your adaptor supports, create virtual screens and
windows in memory, display menus on the monochrome screen and
color screen at the same time (if you have two monitors), write
programs in 43 and 50 line mode on your EGA or VGA adaptor with
full support of gets / menu to / savescreen() etc... Get 64
colors on EGA and VGA monitors, use the print() function to write
strings to the screen 50% faster than @ ... say. Use all the
regular Clipper functions like @ ... box, @ ... say etc. inside
virtual screen buffers that are not displayed until you want
them. This negates the need for complex windowing functions.
You can also execute functions during wait states like menu to or
READS using the great timeout() function!. Intercept and remap
keystrokes with the cool onkey() function!. Create neato sound
effects with sound()!. Load different FONTS into your EGA and VGA
adaptor!, display 2 fonts at the same time!, get 16 background
colors where you used to have only 8!, get access to the F11 and
F12 keys with built in extended keyboard support!, Whew!... Have
to catch my breath...Plus you get all the usual functions you
expect from a library by dLESKO ASSOCIATES.
Now, the price. It's three tiered. First, list is $195 direct
from dLESKO ASSOCIATES at 201.435.8401. Next is the user group
discount. If you are a member of a Clipper user group, you can
get FUNCky for $149. Last is the upgrade policy. If you have IDL,
Tom Rettig's library or Boatswains Mate, upgrade to FUNCky before
Jan 31, 1989 for only $49!!!. If you are not a member of a Clipper
user group, now is the time to join! save money on your membership
dues, and spread the word. Have you user group leader call us
for more information on the user group FUNCky promotion.
You can call during the day if you want more information. By the
way, I am no longer affiliated with IDL. Integrated Development
Corp. now owns all rights to that product. If you own IDL CALL ME
AND UPGRADE...
Dirk Lesko - dLESKO ASSOCIATES.
The following is the table of contents for the FUNCky Library for
Clipper:
aaverage() - get the average of all numbers in an array
addzip() - set new zip code ranges for iszip(), state()
afileread() - load a text file into an array
afilewrite() - write an array of strings to a text file
alen() - get length of array without undefined elements
alltrimlen() - get length of string as if alltrimmed()
althandle() - get/set the SET ALTERNATE TO file handle
amacprint() - macro expand and print array contents
amax() - find maximum value in an array
amaxn() - get element number of maximum value in array
amaxstr() - get the longest string in a character array
amaxstrlen() - get longest string length in array
amaxstrn() - get element number of longest string in array
amin() - find minimum value in an array
aminn() - get element number of minimum value in array
aminstr() - get the shortest string in a character array
aminstrlen() - get shortest string length in array
aminstrn() - get element # of shortest string in array
and() - bitwise and of two numbers
areplicate() - replicate a string to the screen, fast
argc() - get number of command line arguments
argv() - get a command line argument as a string
arrayprint() - print the elements of an array to printer
asciitoebc() - convert an ascii string to EBCDIC
atest() - check if a character matches any array elements
atestn() - check if a number is in a numeric array
atlast() - get position of last occurrence of a character
atnext() - get <nth> occurrence of a character in a string
atotal() - get the total of all the numbers in an array
beep() - cause the speaker to beep
bin2num() - convert 16/8 bit binary string to integer
bitstrip() - strip high bits from string
blinkbit() - turn blink on/off, get 16 background color
border() - set the border color on CGA/EGA/VGA
box() - draw a box with optional shadow
byte2bin() - convert byte value to 8 bit binary string
capfirst() - capitalize first character, lowercase rest
capitalize() - capitalize first letter of each word
capslock() - get or set the caps lock state
capstext() - set string to display if caps lock is on
ccast() - cast any variable type to a character type
center() - add leading spaces to center in <nn> width
chdir() - change directory
checkdate() - check if date string is valid
checktime() - check if time string is valid
chrcount() - find number of times a char occurs in string
chrfound() - test if all chars in str1 are in str2
chrswap() - swap characters in a string
clock12() - display a 12 hour ampm format clock
clock24() - display a 24 hour military format clock
cls() - clear the entire screen to specified attribute
clusters() - get the number of clusters on a drive
clustsize() - get disks cluster size in bytes
coldboot() - perform a cold boot of the computer
color attributes - attribute table for video functions
color() - set video output to the color adaptor
comcheck() - test if character available from comm port
comin() - input a character from the serial port
cominit() - initialize the serial port
comma() - insert commas in a string of numbers
command() - get the command line as a string
comoff() - turn off DTR signal to stop receiving data
comon() - turn on handshaking signals DTR and RTS
comout() - output a string to the serial port
comreset() - reset comm ports to normal after comset()
comset() - set comm ports to different port values
comswap() - swap comm ports com1 and com2
cputype() - get the type of CPU the machine has
crash() - lock up the entire system, forcing reboot
csrbot() - get bottom scan line cursor value
csrput() - place cursor at specified row/column
csron() - turn the cursor on
csrset() - set bottom and top scan line values
csrtop() - get top scan line cursor value
curdir() - get the current directory name
curdrive() - get the logged drive letter
datetype() - get current SET DATE TO setting
dec2hex() - convert decimal value to hexadecimal string
decimals() - get SET DECIMALS value, # decimals in var
decrypt() - unencrypt an encrypted string
default() - get SET DEFAULT to setting
delimiters() - get the current delimiters in use
delvolume() - delete a disks volume label
disksize() - get a disks size in bytes
diskspace() - get the amount of disk space left
disk() - restrict access to floppy disks
disktoscr() - restore a screen from a disk file
dosmem() - get amount of DOS memory installed
dosvers() - get DOS version number as an integer
drives() - get number of valid drives
drivestr() - get a a string of the available drives
dtow() - convert dates to words, format month day, year
ebctoascii() - convert an EBCDIC string to ascii
egamem() - get amount of much EGA/VGA memory in system
encrypt() - encrypt a string so it cannot be read
enhanced() - get/set enhanced color as integer from Clipper
execute() - execute a function <nn> times
exitkeys() - define exit keys allowed to exit reads()
expmem() - get amount of expanded memory available
extmem() - get amount of extended memory available
fadvance() - advance to the next line of text in a file
fbof() - see if file pointer is at beginning of file
fbol() - rewind file pointer to start of current line
fbot() - go to end of file
fchanged() - see if archive bit has been set
fcopy() - copy a file
fcopybyte() - copy <nn> bytes from <file 1> to <file 2>
fcreatef() - DOS 3.00 create file function
feof() - see if the file pointer is at the end of file
ferase() - erase a file
ferror() - test for a DOS error after a file function
fgetdate() - get a files date stamp
fgettime() - get a files time stamp
fgetattr() - get a files attribute
fhide() - change files attribute to hidden
filesize() - get the size of a file
filecount() - count number of matching files
findattr() - get file's attribute from findfirst/next()
findfirst() - find first matching file
findnext() - find next matching file
finddate() - get file's date from last findfirst/next()
findsize() - get file's size from last findfirst/next()
findtime() - get file's time from last findfirst/next()
fkey() - get string assigned to a function key
FLdefine() - define which EGA/VGA font table to use
flen() - length of a file associated with a handle
flinecount() - count how many lines of text are in a file
FLoad() - load a font from disk into EGA/VGA memory
flocate() - locate text in a text file
FLreset() - reset the EGA/VGA to it's default font+mode
FONTS - load new fonts into EGA/VGA adaptor memory
fprotect() - change files attributes to read only
fre() - get amount of free DOS memory available
freadbyte() - read in 1 byte from a file
freadint() - read in an integer from a file
freadlong() - read in a long integer from a file
freadline() - read in one line from a file
frename() - rename a file
freplicate() - replicate a string to a file
frewind() - rewind file pointer to previous line of text
fsetattr() - set a files attribute
fsetdate() - change a files date stamp
fsettime() - set a files time stamp
fstrcount() - how many times a string appears in a file
ftell() - get current file pointer position
ftop() - go to the beginning of file
funhide() - change files attribute from hidden to norma
funprotect() - change files attribute to normal
fwritebyte() - write 1 byte to a file
fwriteint() - write an integer to a file
fwritelong() - write a long integer to a file
fwriteline() - write one line to a file
f_header() - get the header size in a DBF file
f_isdbf() - check if a file is a dBASE III DBF file
f_lupdate() - get date of the last update in a DBF file
f_ndxkey() - get the index expression of an index file
f_recsize() - get the record size in a DBF file
getattr() - get attribute from specified screen location
getpage() - get video page currently being displayed
getvolume() - get the volume label of specified disk
handles() - get number of available file handles
hex2dec() - convert a hexadecimal string to an integer
initscreen() - initialize a virtual screen in memory
inp() - input from a port
insert() - get/set the insert key status
instext() - set string to display if insert is on
interrupt() - execute any software/hardware interrupt
isalpha() - check if characters are alpha characters
isascii() - check if characters in string are ascii
isbutton() - check if a mouse button has been pressed
iscntrl() - check if characters are control characters
iscom() - check if comm port is attached to the system
isdir() - check if directory is valid
isdisk() - check if a disk drive is a valid drive
isdigit() - check if characters are numeric
isdrive() - check if a drive is ready for access
isems() - check if expanded memory manager is installed
isextended() - see if BIOS supports enhanced keyboard
isfixed() - check if drive is a fixed disk
isfile() - check if a file exists
isfloppy() - check if disk is a floppy disk
ishandle() - see if a handle is available for opening
isindex() - check if an index is open in the current area
iskeyset() - check if a key is assigned to SET KEY TO
islastday() - check if date is the last day of month
isleap() - check if a year or date is a leap year
islower() - check if characters are lowercase
islpt() - verify that an lpt port is in the system
ismouse() - check if mouse is installed
isnum() - check if characters in string are numbers
isprint() - check if characters are printable
isprinter() - check if printer is online and ready
isqueue() - see if the DOS print queue is installed
isspace() - check if characters are white space
isstate() - validate two digit state abbreviations
isupper() - check if characters are uppercase
isxdigit() - check if characters are hex characters
iszip() - check that a zip code is in specified state
kbdstat() - get status of shift/num/caps/scroll/alt key
key() - turn keyboard on and off
keystat() - display status of numlock, caps lock etc.
lastday() - get the last day in a month
lastdrive() - get lastdrive setting in config.sys
leadchar() - replace leading spaces with a character
ljust() - left justify a string
lprint() - print text to the printer
lprintline() - print text to the printer append cr+lf
lptreset() - reset lpt ports to normal after lptset()
lptset() - set lpt ports to different port values
lptswap() - swap printer ports lpt1 and lpt2
ltrimlen() - get length of string as if ltrimmed()
margin() - get current SET MARGIN TO setting
maxcol() - get the maximum allowable column number
maxhandles() - number of handles allocated to program
maxrow() - get the maximum allowable row number
mediatype() - get disk media descriptor byte
mkdir() - create a subdirectory
mono() - set video output to the mono adaptor
montype() - get type of monitor in use (for VGA/MCGA)
mouse() - turn mouse support on and off
mousetrap() - use mouse to stuff keys into keyboard buffer
mx_choice() - emulate achoice() with mouse support
mx_dbfview() - display DBF fields in resizeable window
mx_popdir() - popup a resizeable subdirectory pick list
mx_popfile() - popup a resizeable file pick list
mx_view() - view a text file in a resizeable window
m_aregion() - check if mouse cursor is in specified regions
m_buttons() - get number of buttons on the mouse
m_choice() - emulate achoice() with mouse support
m_clicks() - set how many button presses needed
m_col() - get current mouse cursor column position
m_csroff() - turn mouse cursor off
m_csron() - turn mouse cursor on
m_csrput() - place mouse cursor at coordinates X,Y
m_data() - send mouse messages to the mouse functions
m_datarest() - restore Mouse Message Area from a memvar
m_datasave() - save Mouse Message Area to a memvar
m_dbfview() - display DBF fields in a pick window
m_display() - display a centered message on the screen
m_getpage() - get video page mouse cursor is displayed
m_hmickeys() - get horizontal mickey count
m_inbutton() - wait for a mouse button to be pressed
m_incol() - mouse cursor column at last button press
m_inrow() - mouse cursor row at last button press
m_iscursor() - check if mouse cursor is on or off
m_maxcol() - set max/min columns that mouse can access
m_maxrow() - set max/min rows that mouse can access
m_menu() - create drop down menus
m_message() - display a message on the screen
m_mickeys() - set the maximum and minimum mickey count
m_movement() - find out the direction mouse is moving
m_pen() - turn light pen emulation on or off
m_position() - get mouse row and column coordinates
m_popdir() - popup a subdirectory pick list
m_popfile() - popup a file pick list
m_prompt() - emulate @ .. prompt with mouse support
m_query() - place a Yes/No query on the screen
m_region() - check if mouse cursor is in specified region
m_release() - wait for a mouse button to be released
m_reset() - reset mouse settings to default states
m_restore() - restore mouse settings that were m_saved()
m_row() - get current mouse cursor row position
m_save() - save the current mouse settings to a memvar
m_setpage() - set page that mouse cursor is displayed on
m_speed() - set threshold to double mouse cursor speed
m_squeak() - create tones that the mouse functions use
m_trapget() - get key value assigned by mousetrap()
m_trapfree() - release mousetrap() without resetting it
m_trapnew() - resets all mousetrap events
m_traprest() - restore your mousetrap settings
m_trapsave() - save your mousetrap settings
m_trapset() - activate the mousetrap()
m_view() - view a text file in a window
m_vmickeys() - get vertical mickey count
nap() - pause program execution for <nn> clock ticks
ndptype() - get type of numeric coprocessor installed
nexthandle() - find out the next available handle numbe
nlen() - get the length of any variable type
nstuff() - stuff integer key value into Clipper's buffer
num2day() - convert number to it's corresponding day
num2month() - convert number to corresponding month
num2bin() - convert an integer to 16 bit binary string
numlock() - get or set the num lock state
numtext() - set string to display if num lock is on
nupper() - convert inkey() value to uppercase integer
off() - get the offset address of a string variable
ondo() - execute function/expression <nn> in list
onkey() - execute a function on every keypress
or() - bitwise or of two numbers
outp() - output a value to a port
palette() - access 64 colors on EGA and VGA adaptors
park() - position the hard disk heads on the last sector
path() - get the current SET PATH TO setting
peek() - get a value from a memory location
peekstr() - read string from specified memory location
poke() - poke a value into a memory location
print() - print a character string with attribute
prnhandle() - get/set the PRINTER handle
prnreset() - initialize printer to default settings
prnstatus() - get printer status, out of paper, etc.
program() - get the name of the program that is running
prtscr() - print the screen to the printer
q_cancel() - cancel all printing by the print queue
q_delete() - delete a file from the print queue
q_file() - get file currently being printed in queue
q_hold() - temporarily pauses queued printing
q_restart() - restart queued printing after a q_hold()
q_status() - check printer queue for errors
q_submit() - load file into print queue for printing
rand() - generate consistent random numbers
random() - generate a random number
reads() - get user input similar to a get
readh() - get user input right to left for Hebrew data
readscreen() - read character strings off the screen
removeable() - see if a disk contains removeable media
restscreen() - restore a screen from a memory variable
reverse() - reverse a string
rjust() - right justify a string in <nn> spaces
rmdir() - remove a subdirectory
rol() - bitwise rotate left of a number
roloc() - reverse the attributes of a color variable
romdate() - get the rom date of your computer's BIOS
ror() - bitwise rotate right of a number
savescreen() - save a screen to a memory variable
scrltext() - set string to display if scroll lock is on
scrlock() - get or set the scroll lock state
scroll() - scroll a portion of the screen up or down
scrtodisk() - save a screen to a disk file
sectors() - get the number of sectors per cluster
sectorsize() - get the size of a disk sector
seed() - specify seed value for random()
seg() - get the segment address of a string variable
setattr() - set screen attributes
setdrive() - set the current logged drive
setdate() - set the computers internal date
sethandles() - open up to 255 file handles
setkey() - get procedure assigned to a key via SET KEY
setlogical() - set the next logical drive you will use
setmode() - set a new video mode
setpage() - set screen page to use to display output
setscreen() - set screen output to virtual pages
setsnow() - set snow control checking on or off
settime() - set the computers internal clock
setvolume() - set volume label
shift() - shift a portion of the screen left or right
shl() - bitwise shift left of a number
shr() - bitwise shift right of a number
soundex() - convert a string to it's phonetic complement
sound() - create arcade and space sound effects
srand() - specify seed value for rand()
standard() - get/set foreground color as an integer
status() - get status of Clipper's various set commands
state() - get the 2 digit state abbr. based on zipcode
statecode() - get state name from 2 digit code
stdin() - get string from stdin()
stdout() - output a string to the standard output
stratnext() - get position of a substring in a string
strcenter() - center a string within <nn> spaces
strcount() - count # of times str1 appears in str2
strexpand() - insert <nn> spaces between each char
strextract() - extract a string between two delimiters
strstuff() - stuff characters into Clipper's buffer
swap() - swap the contents of two variables
systype() - get system id byte, identifies computer
tabexpand() - expand tabs to correct tab stops
test() - test bits in a number
timeout() - specify function to execute during wait states
timeh() - get time string including hundredths/secs
trailchar() - replace trailing spaces with a character
trimlen() - get length of string as if trimmed()
trimpunct() - trim non-alpha characters from a string
turbo() - get an extra 4-5% speed from your computer
typeahead() - get size of the typeahead buffer
unclock12() - turn off the 12 hour format clock
unclock24() - turn off the 24 hour format clock
unselected() - get/set unselected color as an integer
untrim() - pad a string with spaces
vidtype() - get video adaptor type
vreplicate() - replicate strings vertically to screen
waitkey() - get a keystroke like inkey(), supports SET KEY TO
warmboot() - perform a warm boot of the computer
xor() - bitwise xor of two numbers
_isbutton() - check if a mouse button has been pressed
_lower() - convert a string to lowercase
_newline() - specify character that terminates lines
_upper() - convert a string to uppercase
_xkey() - specify no abort in flocate()
_xkeyval() - specify key that aborts flocate()
_xval() - get current execute() loop number
__vinit - initialize the video buffers after interrupt(
VIEW - TEXT FILE VIEWER
Overview
Linking View
Using View
XTRACT - PROCEDURE EXTRACTER
Overview
Usage
Linking
dMENU INTRODUCTION
Overview
Purpose
Memory required
SETTING UP dMENU
Setup
COMMAND SUMMARY
Keystrokes
ADDING NEW MENU SELECTIONS
Add an item
Editing keys
Fields
Description
Password
Dos commands
Batch files
BRANCHING TO OTHER MENUS
Menu branching
@menu command
GETTING INPUT FROM THE USER
Input commands
@ask command
Using the input
{Length} command
Example
Cautions
EDITING MENU SELECTIONS
Editing menus
DELETING MENU SELECTIONS
Deleting items
ADDING A NEW TITLE
Add a title
CHANGING COLORS
Changing colors
SETTING THE DATE AND TIME
Set date/time
RUNNING DOS
Running DOS
LOCKING A MENU
Lock a menu
Prevent ESCaping
ENVIRONMENT COMMANDS
LOGO setting
COMMANDS setting
MISCELLANEOUS
New menus
TSR programs
Batch commands
Sample menu