home *** CD-ROM | disk | FTP | other *** search
- *
- * dBase.PRG
- *
- * Visual dBase 7.0 Test Program
- *
- *
- * PROGRAMMER: Edit the following include with the location
- * of the WSC32.CC file.
- *
- #INCLUDE C:\TEMP\WSC32.CC
-
- Port = COM1
-
- CR = CHR(13)
- LF = CHR(10)
- Buffer = SPACE(128)
-
- ?? "Transmitting AT to modem connected to COM" + LTRIM(Str(1+Port)) + CR + LF
- ?? "Expecting OK back" + CR + LF
-
- * reset port
- Code = SioReset(Port,512,256)
- if Code < 0
- ? "Error: SioReset returns ", Code
- Code = SioWinError(Buffer, 128)
- ? Buffer
- Return
- endif
- Code = SioBaud(Port,19200)
- * set DTR and RTS
- Code = SioDTR(Port,Asc("S"))
- Code = SioRTS(Port,Asc("S"))
- * transmit "AT" to modem
- Code = SioPutc(Port,13)
- Code = Delay(0.25)
- Code = SioPutc(Port,13)
- Code = Delay(0.25)
- Code = SioPutc(Port,Asc("A"))
- Code = Delay(0.25)
- Code = SioPutc(Port,Asc("T"))
- Code = Delay(0.25)
- Code = SioPutc(Port,13)
- * wait 1 second for response
- MarkTime = Seconds() + 1.0
- Do while Seconds() < MarkTime
- Code = SioGetc(Port)
- if Code = 13
- ?? CR
- endif
- if Code = 10
- ?? LF
- endif
- if Code >= 32
- ?? Chr(Code)
- endif
- EndDo
- ?? CR + LF
- Code = SioDone(Port)
- return
-
- * Delay Function ( waits <WaitSecs> )
-
- Function Delay
- Parameter WaitSecs
- Private Counter
- Private MarkTime
- Counter = 0
- MarkTime = Seconds() + WaitSecs
- do while Seconds() < MarkTime
- Counter = Counter + 1
- enddo
- return Counter
-
-
-