home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Press 1997 July
/
Sezamfile97_1.iso
/
msdos
/
clipper
/
c50xp300.a01
/
XPDEMO.ARJ
/
XPMISC.PRG
< prev
next >
Wrap
Text File
|
1992-10-01
|
6KB
|
200 lines
* ------------------------------------------------------------------------
* Module......: XPMISC.PRG
* Title.......: DOS part of the Expand Library Demonstration Program
* Author......: Pepijn Smits.
* Date........: July/August 1992
* Copyright...: (c)1992 by Softwarebureau Pepijn Smits
* Notes.......: Clipper 5.01 Demo of the Expand Library
* Some general Miscellanous functions
* See XPDEMO.RMK For Compile and Link instructions.
* ------------------------------------------------------------------------
Function HexDump()
Local h := fopen(PCXname(),0)
Local buffer := space(1024)
if ferror()=0
fread(h,@buffer,1024)
XPbrowse(' ~Hex~ dump of 1st 1024 bytes of ~'+PCXname()+' ',;
' Ofs 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F Characters',;
{|i|HexLine(i,@buffer)})
else
XPalert('~Hex~ dump error','Could not find the dump file ~'+PCXname())
end
Return (NIL)
Static Function HexLine(i,buffer)
Local c
local buf := SubStr(buffer,16*(i-1),16)
if i=0
Return (1024/16)
else
c := ' '+XPhexWord(16*(i-1))+' '+XPhexStr(buf) + ' ' + ;
XPhexLstrip(buf)
end
Return (c)
Function TestDial
Local port,prefix,Number,i
Local portMenu := {}
for i := 1 to 4
aAdd(portMenu,'COM~'+Str(i,1)+':')
next
Port := XPalert('~Voice~ Dial','Select ~COM~ Port where Modem is connected to',PortMenu)
/* If Port was selected, Go On */
if Port<>0
XPpushScr()
Port--
/* Is there a Damn COM port anyway? */
if XPisPort(Port)
prefix := If(XPalert('Dial','Which dialing mode shall I use?',;
{'~T~one','~P~ulse'})=1,'ATDT','ATDP')
Number := prompt('Dial','Please Enter Number to dial:','')
if !Empty(Number)
XPdtr(.t.,port)
XPatModem( prefix+Number+';',port)
XPpop('Dialing','Currently ~dialing~;'+Number+';'+;
'Pick up ~phone~ any time and;press a key or click the Mouse;when the phone rings')
XPmouseKey()
XPdtr(.f.,port)
end
else
XPalert('Dial','You selected an Non-Existant ~COM~ Port!')
end
XPpopScr()
end
Return (NIL)
Function Test123
XPpushScr()
XPpop('~1-2-3~ Test',' Creating ~EXPAND.WK1~..')
if XPcreate123('EXPAND.WK1',5,1)
XPWidth123(0,20)
XPWidth123(1,40)
XPWrite123(0,0,'Ah! There you are!')
XPWrite123(0,1,'Yes, I was just created by the Expand Library!.')
XPWrite123(1,0,2342)
XPWrite123(1,1,'<- a number')
XPWrite123(2,0,7623.2393,2)
XPWrite123(2,1,'<- a number with 2 decimals..')
XPWrite123(3,0,date())
XPWrite123(3,1,'<- this should be today..')
XPWrite123(4,0,XPstoD('19670308'))
XPWrite123(4,1,'<- and this is my birthdate..')
XPWrite123(5,0,'That was it..')
XPWrite123(5,1,'Okidoki.. Return to the Expand Library now..')
XPwrite123(6,0,'Some Extra Functions:')
XPrepl123(7,0,'-')
XPrepl123(8,0,'/\')
XPcenter123(9,0,'Cntr')
XPright123(10,0,'Right')
XPperc123(11,0,18.5)
XPperc123(12,0,0.1,4)
XPcurr123(13,0,12.5)
XPcurr123(14,0,1129391,1)
XPClose123()
XPalert('~1-2-3~ Test',' Created EXPAND.WK1;Use ~1-2-3~ to see what is in it!')
else
XPalert('~1-2-3~ Error','Could not create ~EXPAND.WK1~!')
end
XPpopScr()
Return (NIL)
Function JoyTest()
XPalert('Sorry',;
"I couldn't find a ~Joystick~ in time for the testing of;"+;
"these routines. Please try them out yourself if you happen to own one")
/*
XPpushScr()
XPbox2(6,6,20,74,'~Joystick~ Test')
XPcenter(8,'This is your current Joystick status (if you have any)')
XPcenter(18,'Press ~any~ key or ~click~ the mouse to continue')
While (XPinkey()=0) .and. (XPmouseStat()=0)
// XPdisplay(10,10,'Joystick 1 '+if(XPjoy1(),"Pressed ","Released"))
end
XPpopScr()
*/
Return (NIL)
Function MachInfo()
XPalert('~Machine~ Information',;
PadR("CPU : ~" + XPcpuStr(),60)+";"+;
PadR("ROM date : ~" + DtoC(XPromdate()),60)+";"+;
PadR("ROM ID byte : ~" + XPhexByte(XPromID())+'h',60)+";"+;
PadR("ICA Contents : ~" + XPhexStr(XPica()),60))
Return (NIL)
Function MachID()
Local x
begin sequence
x := (Prompt('Machine ~Identification~','Give an Identification to look-Up in ROM',''))
if !empty(x)
if XPROMscan(x)
XPalert('Machine ~ID~','Well, it look like this computer is a;~'+;
x+'~;(string was found in ROM)')
else
XPalert('Machine ~ID~','Sorry, this computer is not a;~'+;
x+'~;(string not found in ROM)')
end
end
end
Return (NIL)
Function BootWarm()
if XPask('~Warm~ boot','Are you sure you want to Reboot the Computer?')
XPwarmboot()
end
Return (NIL)
Function BootCold()
if XPask('~Cold~ boot','Are you sure you want to Restart the Computer?')
XPcoldboot()
end
Return (NIL)
Function PCXtest()
Local PCX := {"XPDEMO.PCX","CLOWN.PCX","SPS.PCX"}
Local i := XPalert('~PCX~ viewer',;
"Which of the following PCX files would you like to view?",;
{'~I~ntro Screen (EGA)','~C~lown (VGA: 256 Colors)','SPS ~L~ogo (VGA: 16 Colors'})
Local x,nCode
if i>0
SET CURSOR ON
XPpushScr()
x := XPvmode()
nCode := XPfastPCX(PCX[i])
do case
case nCode == 0 // All Okay..
XPmouseKey() // Wait..
XPvmode(x) // Restore text..
inkey(.3)
SET CURSOR OFF
case nCode == 1
XPalert("~PCX~ view",;
"Error: File not Found ~"+PCX[i])
case nCode == 2
XPalert("~PCX~ view",;
"Error: File is not a PCX file ~"+PCX[i])
case nCode == 3
XPalert("~PCX~ view",;
"Error: Unsupported format, file ~"+PCX[i]+";"+;
"~XPfastPCX()~ only supports the following formats:;;"+;
"640x350x16 EGA ;"+;
"640x480x16 VGA ;"+;
"320x200x256 VGA;")
case nCode == 4
XPalert("~PCX~ view",;
"Error: File is too big ~"+PCX[i])
case nCode == 5
XPalert("~PCX~ View",;
"Error: You do not have the required hardware")
endcase
XPpopScr()
end
Return (NIL)