home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 9
/
CD_ASCQ_09_1193.iso
/
news
/
4430
/
basiclib
/
basic.doc
next >
Wrap
Text File
|
1993-10-02
|
5KB
|
97 lines
WELCOME TO BASIC .LIB
Any Problems Send Mail on CompuData to John Werner
REMEMBER
This is SHAREWARE NOT FREEWARE
If after 30 days you continue to use BASIC.LIB
Send the the author $15.00 to
John Werner SEMCOR INC.
208 RT.38
Moorestoen NJ 08057
Allow me a minute to explain why this library was written. I
just started programming in CLIPPER 5.2 about 4 months ago. I
didn't even know this language existed, until my new job when I was
hired as a software debugger. I was told the program I was to
debug, was written in clipper. They told me it was a very powerful
language. I had no idea what they meant (now I do).
As the months went by, I kept seeing how powerful clipper was.
So, I decided to try to learn the language. After about a month of
trying to learn programming in clipper, I started to write clipper
code. I kept asking the programmers at my company for help.
One of the key things the programmers would tell me, is
WRITE CODE YOU CAN RE-USE. This means generic functions that you
can reuse over and over again. I have included seven of the most
used functions I know of.
Listing of the FUNCTIONS
1. MessageBox()
All this function does is display a box in the center of
the screen, and lets the user display text and color.
SYNTAX = MESSAGEBOX("begin", "Please Wait", "w+/rb", "W+*/rb")
MESAAGEBOX("end")
MESSAGEBOX : Is the name of the function call
BEGIN : means display it to the screen END will
reset the screen to its setting, before this
function was called
PLEASE WAIT: This is the text to be displayed in the box
color is to be set later
W+/RB : Draw a box at row 12 to row 14 (this is assumed
as the center), center the box and color it (in
this case cyan)
W+*/rb : This is the color of the text displayed in the
box (in this case white bright blinking on a
background of cyan)
note: this is usually followed by INKEY(0)
OK Now the box is on the screen
Lets get rid of it, and restore the original screen
SYNTAX = MESSAGEBOX("end")
This gets rid of the box and restores the screen to it
original colors
2. Jheader
This function displays a line at the top of your program,
and centers the text. great for identifying what you are
about to do. eg. Jheared("Enter to select.... ESC to Quit",
"w+/r")
The first parameter is the text- the next is the color
In the case
SAY ENTER TO SELECT... ESC TO QUIT at the top of the
screen the colors would be white bright on red
3. Footer
This function works the same a Jheader but put the centered
text on the bottom line #24
EG...Footer("page up-down to view records F1 for help"
"bg+/n")
4. PleaseWait
This function draws a please wait... box in the center of the screen.
SYNTAX PleaseWait()
5. Shadow
This function draws a transparent shadow under a box.
SYNTAX Shadow(2, 3, 4, 50)
6. PercentBox
This function draws a percent meter on line 12 and lets you
specify the column. It calculates the total records checks
what record you are on, and figures out the percent left to do.
SYNTAX PercentBox("54")
7. Settings
This function saves the current SET() settings to a local array
(Aset{}) and then can be restored at the end of the function or
procedure.
SYNTAX LOCAL Aset :={}
Settings("begin", Aset) //to start function
Settings("end", Aset) //to end function
This function is great because you change the color, cursor
whatever and when the function ends it restores the settings
back to what they were before the function started.