Category : Miscellaneous Language Source Code
Archive   : TSST20.ZIP
Filename : SAMPLE.BAS

 
Output of file : SAMPLE.BAS contained in archive : TSST20.ZIP
DEFINT A-Z

' Sample program on how to set up your code for using "SSTPATCH.EXE"
' MicroSoft Quick Basic format

'******************** YOUR BASIC PROGRAM **********************
CLS
PRINT "LET'S PRETEND THIS IS THE FIRST LINE OF YOUR MAIN SOURCE CODE"
'
' The 'body' of your main program's source code
' would be placed in here.
' Many, many
' lines long.
'
PRINT "LET'S PRETEND THIS IS THE LAST LINE OF YOUR MAIN SOURCE CODE"
GOSUB ShowPatch 'REM to display the new patch.
CLOSE : END: SYSTEM
'****************** END OF YOUR PROGRAM ***********************

' Now, after the last line of code in your main program module,
' insert the following "DATA" lines. No need to leave blank lines
' between entries like we did (for clarity), but other than that
' make the entries EXACTLY as we have them. When "messing" with
' binary stuff, character counting is "everything".

' Caution! NO TRAILING "SPACESBARS" OR CHARACTERS AFTER DATA ENTRIES!

DATA "Customer_Name_And_Number"

DATA "123456789012345678901234567890"
'REM 30 Characters
DATA "1234567890"
'REM 10 Characters
DATA "12345"
'REM 5 Characters

' That's all there is to it. Now compile and link your source code
' into an "EXE" file, and then run "SSTPATCH.EXE". The entries in the
' above "DATA" statements will be replaced with your customer's data.
' You can then view the patch with any good binary editor, or simply
' add something like the commands in "ShowPatch" to your source code
' to display the patched variables on one of your program's screens.
'
' Once the above DATA lines are in place, you can patch the same EXE
' file over and over again with different information as many times
' as you wish. The System Date is always used, so set your calender.

ShowPatch:
' To display the patched data on screen, you could do something like....
READ X$, NAME$, DT$, SER$
PRINT
PRINT "'SAMPLE.EXE' - THE PATCHED ENTRIES ARE...."
PRINT
PRINT "Customer's Name: "; NAME$
PRINT "Date Of Transaction: "; DT$
PRINT "Product Serial #: "; SER$
RETURN

'The file called "SAMPLE.EXE" is a compiled version of this source code.
'Try SSTPATCH to patch SAMPLE.EXE to see how all of this works.

'**********************************************************************
'
'Note: Common reasons why an EXE file won't work after a patch:
'
' - You used a punctuation mark in your "CUSTOMER NAME" entry.
' Some of these characters will cause problems, others work
' just fine. The first time you try to patch a program, don't
' try to get fancy - Just enter Alpha/Numeric characters.
'
' - You left trailing "spacebars" at the end of the "DATA" lines.
' There must be NO other characters of any kind after the last
' quote mark on any "DATA" line entry (not even a REMark).
'
' - You didn't enter the "DATA" lines EXACTLY as we show them in
' the examples in "SAMPLE.BAS". If you are using Quick Basic,
' load "SAMPLE.BAS" along with your own program, and then
' "copy" the data lines from Sample.Bas to your program with
' Quick Basic's "Cut & Paste" feature.
'
'************************************************************************



  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : TSST20.ZIP
Filename : SAMPLE.BAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. 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/