Category : Files from Magazines
Archive   : DBMS0591.ZIP
Filename : EHRMANN.MAY
Output of file : EHRMANN.MAY contained in archive : DBMS0591.ZIP
LISTING 1.
; ------------------------------------------------------------
; Export Customer table to a text file
;
; This module steps through the Paradox menus to export a
; table to an ASCII text file. If the file already exists,
; it will be replaced automatically.
; ------------------------------------------------------------
Proc EXPORT_CUSTOMER()
message "Exporting Customer Table to CUSTREP.TXT"
Menu
{Tools} {ExportImport} {Export} {ASCII} {Delimited}
select "CUSTOMER"
select "CUSTREP.TXT"
If MenuChoice() = "Cancel" then
{Replace}
EndIf
Return
EndProc
LISTING 2.
; ------------------------------------------------------------
; Export Customer table to a text file
; ------------------------------------------------------------
Proc EXPORT_CUSTOMER()
message "Exporting Customer Table to CUSTREP.TXT"
Menu
{Tools} {ExportImport} {Export} {ASCII} {Delimited}
select "CUSTOMER"
select "CUSTREP.TXT"
If MenuChoice() = "Cancel" then
{Replace}
EndIf
Return
EndProc
; here is where the proc is actually invoked!
EXPORT_CUSTOMER()
LISTING 3.
; ------------------------------------------------------------
; Export Customer table to a text file
; ------------------------------------------------------------
Proc EXPORT_CUSTOMER()
Private X ; holding variable for file extension
X = ".TXT" ; assign value to the variable
message "Exporting Customer Table to CUSTREP" + X
Menu
{Tools} {ExportImport} {Export} {ASCII} {Delimited}
select "CUSTOMER"
select "CUSTREP" + X
If MenuChoice() = "Cancel" then
{Replace}
EndIf
Return
EndProc
LISTING 4.
; ------------------------------------------------------------
; Export Customer table to a text file
; ------------------------------------------------------------
Proc EXPORT_TABLE ( TABLE.TO.EXPORT, ; table being exported
DESTINATION.FILE, ; file to export to
EXPORT.DESCRIPTION ; description of export
)
message "Exporting the " + EXPORT.DESCRIPTION + " Table"
Menu {Tools} {ExportImport} {Export} {ASCII}
Select TABLE.TO.EXPORT
Select DESTINATION.FILE
If MenuChoice() = "Cancel" then
{Replace}
EndIf
Return
EndProc
LISTING 5
; ------------------------------------------------------------
; Send a standard message to the user
; ------------------------------------------------------------
proc USER_MESSAGE ( MESSAGE.TEXT , ; text to display
MESSAGE.COLOR , ; "R"=Regular "E"=Error
DO.KEYPRESS ; pause for a keypress ?
)
; set color to use for writing the message
; once we test MESSAGE.COLOR as passed into the proc,
; we don't need it again. So we reuse it for the actual color
if MESSAGE.COLOR = "E" then
MESSAGE.COLOR = syscolor(3) ; use Pdox error color
else
MESSAGE.COLOR = syscolor(0) ; use Pdox regular color
endif
; paint top two lines of screen
paintcanvas fill " "
attribute MESSAGE.COLOR
0, 0, 1, 79
style attribute MESSAGE.COLOR
; do we need to pause.
if DO.KEYPRESS = True then
; on which line do we write the keypress message
if len(MESSAGE.TEXT) < 65 then
@ 0,0 ?? MESSAGE.TEXT + ". Press a key."
else
@ 0,0 ?? MESSAGE.TEXT + "."
@ 1,0 ?? "Press a key to continue."
endif
; pause for a keypress; clean up
retval = getchar()
paintcanvas fill " "
attribute syscolor(0)
0, 0, 1, 79
style
; return the key pressed - we can trap for special keys
return retval
else
; no pause; paint message and continue
@ 0,0 ?? MESSAGE.TEXT
style
return False
endif
endproc
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/