home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software of the Month Club 1995 December
/
SOFM_Dec1995.bin
/
pc
/
os2
/
adeptbbs
/
adprexx.doc
< prev
next >
Wrap
Text File
|
1995-10-31
|
67KB
|
1,874 lines
----------------------------------------------------------------------
AdeptXBBS REXX INTERFACE
Copyright (c) 1993 - 1995 by AdeptSoft
portions Copyright (c) 1991-1994 M. Kimes
All Rights Reserved
---------------------------------------------------------------------- 2
ADEPT REXX INTERFACE ................................................4
Standard and Extended REXX Programs: ...............................5
Proper REXX Programming Syntax: ....................................6
Adept REXX Interface Calls: ........................................7
AdeptCall ........................................................7
AdeptChainRexx ...................................................9
AdeptChainRexxNc .................................................9
AdeptChangeGroup .................................................9
AdeptCheckBit ...................................................10
AdeptCls ........................................................10
AdeptComFlush ...................................................11
AdeptComWrite ...................................................11
AdeptConvert ....................................................12
AdeptDial .......................................................12
AdeptDoDTR ......................................................13
AdeptDropGlobalVar ..............................................13
AdeptFile .......................................................13
AdeptGetGlobalVar ...............................................14
AdeptGetVar and AdeptPutVar .....................................14
AdeptHitReturn ..................................................19
AdeptInKey ......................................................20
AdeptInput ......................................................20
AdeptLibrary ....................................................21
AdeptLocation ...................................................22
AdeptLog ........................................................22
AdeptMenu .......................................................23
AdeptMenuType ...................................................23
AdeptMessage ....................................................24
AdeptMore .......................................................25
AdeptPause ......................................................25
AdeptPeekByte ...................................................25
AdeptPrint ......................................................26
AdeptPrintL .....................................................26
AdeptPutC .......................................................26
AdeptPutKey .....................................................27
AdeptRead .......................................................27
AdeptRecv .......................................................28
AdeptRexxKillThread .............................................29
AdeptRexxStartThread ............................................29
AdeptSend .......................................................30
AdeptSetBit .....................................................31
AdeptSetGlobalVar ...............................................31 3
AdeptSetTimer ...................................................31
AdeptShow .......................................................32
AdeptSleep ......................................................32
AdeptTimedInKey .................................................33
AdeptTimeLeft ...................................................33
AdeptTimerUp ....................................................34
AdeptUnsetBit ...................................................34
AdeptWaitConnect ................................................35
AdeptWaitKey ....................................................35
AdeptWrite ......................................................36
AfSysAddIndexEntries ............................................36
AfSysClose ......................................................37
AfSysDeleteIndexEntries .........................................38
AfSysOpen .......................................................39
AfSysSetIndexAreaNumber .........................................41
AfSysSetIndexEntryDate ..........................................41
AfSysSetIndexFileName ...........................................41
AfSysSetIndexRecordOffset .......................................41
CTRL AND OTHER KEYS AND THEIR RETURN CODES: ........................45 4
ADEPT REXX INTERFACE
AdeptXBBS comes with two 'menu' systems, the standard text, ASCII
based menu system and a REXX sub-system. The REXX sub-system
included with the BBS software allows all basic menu functions with
some additional flexibility.
We also offer, still in development, a complete REXX API sub-system
that gives even the novice programmer total control over the BBS
software.
With the AdeptXBBS REXX API Programming module you get access to all
available memory variables, all internal functions, and complete
unrestricted access to all running nodes at one time.
This is an extremely powerful module, giving total control over the
entire BBS. For programmers wishing to write their own programs in
a simple language, yet maintain the speed and flexibility of AdeptXBBS
this is for you. We also have utilities that allow you to ship your
programs without making the source code available to the end user.
For more information about the REXX Programming module contact
AdeptSoft.
Adept contains a REXX interface to the BBS functions. This allows you
to create your own scripts to execute from Adept. By using REXX
functions alone you can completely customize Adept.
Two types of REXX commands can be automatically executed by Adept. To
be executed they need only exist in the .\Menus directory.
Main.Cmd or Main?.Cmd -- This REXX script is executed INSTEAD OF
the default menu system.
AtEnd.Cmd or AtEnd?.Cmd -- This REXX script is executed after the
user logs off (or the default script has
ended) The BPS rate will be zero and the
time left will be five minutes. This
script is executed before the user info is
saved to the user data base.
AtStart.Cmd or
AtStart?.Cmd -- This REXX script is executed at logon.
The filename with the line number is 5
executed in place of 'AtStart.Cmd' if it
exists.
Exception.Cmd -- This REXX script is executed if a
exception violation occurs. You can use
this script to notify the user of what
just happened. And to help assist us by
asking the user what they where doing when
the exception happened.
Standard and Extended REXX Programs:
Several things will change in reference to the REXX system
in this next beta. We will no longer run .CMD file. We have
decided to call .CMD files .SRX (Standard REXX) files. This
will pave the way for .ERX (Extended REXX) files. .ERX files
are preprocessed REXX files for use with Adept. Sysops who own
the REXX module will be able to execute .ERX files. Sysops who
do not will ONLY be able to execute .SRX files.
Why ERX files?
ERX files are REXX files that have been preprocessed with the
AdeptREXX Processor (SrToErx). ERX files are typically 50% smaller
and always faster then standard REXX files (When run Cached).
We are asking that people who write rexx scripts for Adept that
are not pre-processed please use the extension .SRX. The
preprocessor will ONLY process files with the .SRX extension.
SrxToErx.Exe FileNameWithoutExtention will yield a file with the
same name, but the .ERX extension. If you are a commercial
developer is recommended that you preprocess your rexx .SRX
files before distributing them. Also it recommended that you
DO NOT preprocess the following!
Atstart.Cmd - This MUST remain a .CMD file. So that others may
modify it and chain needed rexx scripts (preprocessed or not) from
it.
The BBS software will look for .ERX versions of files that we
feel are ok to pre-process. In fact if you are running a .SRX 6
file (i.e. .cmd) file in cached mode (as we default to) it is
treated as a .ERX file after we preprocess it internally. So
it is honestly recommended that you do not preprocess anything
that you are NOT going to be distributing.
Proper REXX Programming Syntax:
ALL REXX functions in the software unless you are looking for a value
should be called with the CALL function NOT with the () method.
i.e.
call AdeptChainRexx "RexxCmdFile.Cmd", line
NOT - AdeptChainRexx("RexxCmdFile.Cmd", line)
The second one will usually not work correctly. The first works.
Also you should try to use the call functioname ANY time you are
not get a value back i.e.
call AdeptPrint line, "This is a line to print"
key = AdeptWaitKey(line) 7
Adept REXX Interface Calls:
Adept registers functions which can be called from the REXX
interpreter.
These calls are used to interface a REXX script to Adept.
When Adept starts a REXX script, it passes along the line number
as the first argument to the function. The REXX script should store
that line number because it must be passed back to the AdeptREXX
functions as the first parameter.
Remember to Start every REXX script with /* <text if any> */ then on
the next line (or the one after) Do the following ..
ARG Line
*OR*
ARG LineNumber
Remember, if you use "Line", then all your REXX Function must have the
first parameter as "Line". If you use "LineNumber" then all your REXX
functions must have the first parameter as "LineNumber".
If you have used ARG Line and in a function you have put "LineNumber"
(where it's supposed to be) then nothing will happen :), so you must
remember to always use the same argument that you started with.
** Example **
You used ARG Line so all your Functions (AdeptPrint, AdeptCall,
AdeptInput, etc..) will have to be passed like so ..
call AdeptPrint Line,"String"
and NOT
call AdeptPrint LineNumber, "String"
It is the same if you have the two reversed. So really, where ever you
see "LineNumber" in this file, you replace it With the Argument you
Stated at the beginning of the REXX Script.
AdeptCall
call AdeptCall LineNumber, Type, Flags, String1, ..., StringN 8
or
value = AdeptCall(LineNumber, Type, Flags, String1, ..., StringN)
Runs an external program.
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
Type:
1 Same as menu item 801. Spawn a separate session. Strings
are concatenated to form one string which is used as the
spawn string. Can be used for a door program that accesses
the com port in a more traditional (and complicated) fashion.
You can run DOS doors here also.
Flags:
1 Start session in background.
2 Same as menu item 802. Run OS/2 type door.
(same as menu item 800 but assumes a program which is more
friendly to having its I/O redirected thru pipes to the com
port.) Program must allow itself to be killed.
Flags:
Not Used.
3 Same as menu item 800. Run OS/2 type door. Program must allow
itself to be killed.
Flags:
Not Used.
Flags:
Only used for Type 1 call. If flag is 1, then the program is
started in the background.
String1..N:
Strings are added together to form one string which is used to
spawn the session.
Returns:
Return code from the spawning function. 0 usually indicates
success.
All sessions inherit Adepts environment.
** Example **
call AdeptCall Linenumber,1,,'cmd.exe /c twar.bat' 9
This would call the batch file twar.bat and run TradeWars in the
Foreground.
AdeptChainRexx
call AdeptChainRexx "RexxScriptName", LineNumber
or
Value = AdeptChainRexx("RexxScriptName", LineNumber)
Chains REXX files within REXX files. Runs the rexx script in
cached mode.
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
RexxScriptName:
Name and path of file you want to run.
AdeptChainRexxNc
call AdeptChainRexxNc "RexxScriptName", LineNumber
or
Value = AdeptChainRexxNc("RexxScriptName", LineNumber)
Chains REXX files within REXX files. Runs the rexx script in
Non-cached mode. Once the script is cached, it is cached (in
memory until you shut down your copy of Adept.
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
RexxScriptName:
Name and path of file you want to run.
AdeptChangeGroup
call AdeptChangeGroup LineNumber, group_num
or
Value = AdeptChangeGroup(LineNumber, group_num) 10
The AdeptChangeGroup function will return '0' if the users
group was not upgraded or not found. It will return '1'
if the users group was upgraded. This works just like
upgrading a users group in the local user editor. The user
will take on the changes specified for the specific group
that they have joined/are in.
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
group_num:
Number of group you want to change the user to.
AdeptCheckBit
call AdeptCheckBit Linenumber, BIT NUMBER, Numeric Long
or
Value = AdeptCheckBit(Linenumber, BIT NUMBER, Numeric Long)
This can be used to test if a users bit is turned on for any of the
LONG bitmap'd flags.
Returns '1' if the BIT is set, '0' if it is not.
** Example **
UserFlag = AdeptGetVar(LineNumber, 42) /* 42 - User Flags */
IsOn = AdeptCheckBit(LineNumber, 10, UserFlag)
if IsOn = '1' then
call AdeptPrint LineNumber, "Flag 10 is on!\r\n"
AdeptCls
call AdeptCls LineNumber
or
Value = AdeptCls(LineNumber)
Clears local and remote screen.
LineNumber:
Line number. Passed to REXX routine from Adept as first 11
parameter.
** Example **
call AdeptCls LineNumber
AdeptComFlush
call AdeptComFlush LineNumber
or
Value = AdeptComFlush(LineNumber)
AdeptComFlush will flush the output stream of the current com port.
** BE CAREFUL **
This is a RAW com function. This is only to be used by
professionals or people experienced with programming serial based
products.
** Example **
call AdeptComFlush LineNumber
AdeptComWrite
call AdeptComWrite LineNumber, string
or
Value = AdeptComWrite(LineNumber, string)
AdeptComWrite will place a string into the com ports output stream.
This is a raw com function. It will return -1 for carrier drop.
** BE CAREFUL **
This is a RAW com function. This is only to be used by
professionals or people experienced with programming serial based
products.
** Example **
rc=AdeptComWrite(LineNumber,"Hello!")
if rc='-1' then signal NoCarrier
NoCarrier: 12
End
Would be used to Display "Hello" to the output stream, if the
carrier is dropped, it would signal NoCarrier and the Script
would be terminated.
AdeptConvert
call AdeptConvert LineNumber, String
or
Value = AdeptConvert(LineNumber, String)
Converts META variables passed in String.
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
String:
String which contains META variables which need to be converted.
Returns:
Converted string.
** Example **
dred=AdeptConvert(LineNumber,'{F5')
The variable dred would now equal Dark Red. So where ever you use
dred it will put it in Dark Red since there are some Functions that
do not support Meta Codes (NOT just color, ALL Meta Codes)
AdeptDial
call AdeptDial LineNumber, "STRING TO DIAL"
or
Value = AdeptDial(LineNumber, "STRING TO DIAL")
AdeptDial will parse a string to the modem through the dialing
translation. I.E. "v~^ATDT555-1212|" will be translated to
LOWER DTR, PAUSE FOR A SECOND, RAISE DTR, SEND 'ATDT555-1212' then
a CR (Carriage Return to the modem'. 13
AdeptDoDTR
call AdeptDoDTR LineNumber, `0' or `1'
or
Value = AdeptDoDTR(LineNumber, '0' or '1')
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
Type:
0 - Drop DTR (Will leave it dropped)
1 - Raise DTR (Will Leave it raised)
** Example **
call AdeptDoDTR LineNumber,'1'
This will Drop the DTR.
AdeptDropGlobalVar
RetCode = AdeptDropGlobalVar('VarName')
AdeptFile
call AdeptFile LineNumber, Type, StartAt, KeyName
or
Value = AdeptFile(LineNumber, Type, StartAt, KeyName)
File area manipulation.
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
Type:
1 Returns name of current file area.
2 Returns number of current file area.
3 Find file area (number of area to find in StartAt)
Returns file area number 14
4 Find file area (name of area to find in KeyName)
Returns name of current file area.
5 Go to next file area
Returns name of current file area.
6 Go to previous file area
Returns name of current file area.
7 Returns download path of current file area.
8 Returns upload path of current file area.
StartAt:
Number of area to look for. (see type 3)
Keyname:
Name of area to look for. (see type 4)
** Example **
call AdeptFile LineNumber,4,,'AdeptSoft'
This would find the File area "AdeptSoft" as listed in File_Areas
AdeptGetGlobalVar
RetCode = AdeptGetGlobalVar('VarName')
AdeptGetVar and AdeptPutVar
call AdeptGetVar LineNumber, varnumber
or
call AdeptPutVar LineNumber, varnumber, Data
or
Value = AdeptGetVar(LineNumber, varnumber)
or
Value = AdeptPutVar(LineNumber, varnumber, Data)
This function duplicates some of the functions already in the
AdeptREXX language. This returns almost every single variable adept
uses in the BBS software. This will give a REXX programmer total
control over all of the BBS's users and mailers memory variables.
There will also be some new variables added that will be blank.
These variables will be usable in real time across nodes by multiple
REXX programs running at the same time. The possibilities of such a
setup are limitless.
The following are the variable numbers: 15
User Info:
1 - Users Name
2 - Users Handle
3 - Users Address
4 - Users Address1
5 - Users Address2
6 - Users City
7 - Users State
8 - Users Zipcode
9 - Users Home Phone
10 - Users Data Phone
11 - Users Fax Phone
12 - Users Business Phone
13 - Users Interests
14 - Sysop Comment about User
15 - Users Bank Time
16 - Users Computer Type (Number)
17 - Users User ID
18 - Users Point ID
19 - Users BirthYear
20 - Users BirthMonth
21 - Users BirthDay
22 - Users Gender (Represented by 1 letter)
23 - Users NetMail Credit
25 - The Group the User belongs to
27 - Time Used Today
28 - Time Per Day
29 - Time Per Call
30 - Number of calls the user has made
31 - Upload Number
32 - Download Number
33 - Uploads in K
34 - Downloads in K
35 - Upload K today
36 - Download K today
37 - Upload K per day (Max Allowed)
38 - Download K per day (Max Allowed)
39 - Number of posts (Total)
40 - Security Level #1
41 - Security Level #2
42 - Flags represented as a 32-bit long
43 - Flags2 Represented as a 32-bit long
44 - User Attributes represented as a 32-bit long 16
45 - User Attributes #2 represented as a 32-bit long
46 - Users Screen Length
47 - Users Screen width
48 - Last Message Area number user was in
49 - Last File Area Number user was in
50 - Last Protocol Chosen (Returns the letter for the protocol)
51 - Last Archiver Chosen Returns Archive Letter
53 - Percentage of Upload/Download ratio to consider the user a
leech
54 - Maximum Bank time allowed for this user
55 - Password Represented as a 32-bit long (32-bit CRC)
56 - Password reversed represented as a 32-bit long (32-bit CRC)
57 - Max Messages to pack into a mail packet.
58 - Users Age
59 - User Bad Password Attempts
60 - MailStatus (I forget how we use this at the moment)
61 - Number of lines shown to the remote user since last reset
(clear screen or new screen shown, etc). This is calculated
by the display sub-system and should always be correct.
This variable takes everything from ANSI and Avatar cursor
movement into account, to number of actual lines displayed.
62 - Did the user pick non-stop display after the last more
prompt or non-stop display choice.
BBS Info:
100 - Number of Calls to the BBS
101 - Last User ID Assigned by the BBS
102 - Last Point ID Assigned by the BBS
103 - Minimum Age Required to Log on
104 - Maximum Age Allows on the BBS
105 - Amount of NetMail Credit the user has
106 - Expire Users after x amount of days
107 - Expire Users after x amount of minutes
108 - Default User Time Per Day
109 - Default User Security Level #1
110 - Default User Security Level #2
111 - BBS User Default Flags #1 returned as a 32-bit long
112 - BBS User Default Flags #2 returned as a 32-bit long
113 - Default Upload K per day max
114 - Maximum download k per day
115 - BBS User Default Attribs returned as a 32-bit long
116 - BBS User Default Attribs #2 returned as 32-bit long
117 - The default group the user belongs to. The user will 17
inherit the default settings for this group. 0 for none.
118 - Maximum Users to allow in the user file
119 - Default Origin Line for EchoMail Areas
120 - Maximum Password Attempts Allowed
125 - Default Cost to send a NetMail message
126 - Line number the BBS is on in the quote file
127 - Default Maximum Time Per Call
128 - I don't remember I will have to check this one
129 - Odds of getting a quote when called
130 - Mailer Incoming Password Protected Mail Path
131 - Mailer OkFile for Password Protected Nodes
132 - Mailer Incoming Public Mail Path
133 - Mailer OkFile for Public Mail
134 - Mailer Unlisted Node Mail Path
135 - Mailer OkFile for Unlisted Nodes
136 - Number of times a user can page the sysop
137 - The BBS's Name
138 - BBS UAttribs 32-bit long
139 - BBS UAttribs #2 32-bit long
140 - Sysops Name
141 - Is The Sysop In (0 or 1)
142 - Default Max Messages in Packet
143 - City/State info for BBS & .QWK Packet
144 - .QWK BBS ID
145 - BBS .QWK Phone Number
146 - Default Max Bank Time
Modem/Mailer Info:
200 - Modem Handle
201 - Node Number
202 - Port Name (COM1, \PIPE\ADEPT1, etc)
203 - Modem Init String
204 - Default Dialing Prefix
205 - Default Dialing Suffix
206 - Optional Dialing Prefix #1
207 - Optional Dialing Suffix #1
208 - Optional Dialing Prefix #2
209 - Optional Dialing Suffix #2
210 - Optional Dialing Prefix #3
211 - Optional Dialing Suffix #3
212 - Optional Dialing Prefix #4
213 - Optional Dialing Suffix #4
214 - Optional Dialing Prefix #5 18
215 - Optional Dialing Suffix #5
216 - Optional Dialing Prefix #6
217 - Optional Dialing Suffix #6
218 - Optional Dialing Prefix #7
219 - Optional Dialing Suffix #7
220 - Optional Dialing Prefix #8
221 - Optional Dialing Suffix #8
222 - Modem Answer String
223 - Obsolete
224 - Obsolete
225 - Mail Only Event Text
226 - Text if User is too slow
228 - Baud Rate to Init Modem at
229 - Minimum Baud rate Allowed on BBS
230 - Minimum Incoming Baud Rate for Mail
231 - Minimum Baud Rate to Call Out for Mail
232 - Maximum Baud Rate for Outbound Mail
233 - Current Baud Rate of Modem
234 - Minimum Cost of Mail for This Event (Dialout)
235 - Maximum Cost of Mail for This Event (Dialout)
236 - Maximum Mail in K to send in a mail session
237 - Maximum Time Limit for a mail session
239 - Maximum Bad Mail Calls before no more are made
240 - Maximum Times to call a node to send mail
241 - If Port Locked (0 / 1)
242 - Allow Human Callers or Users on the BBS? (0/1)
243 - Allow File Requests (0/1)
244 - Accept File Request (0/1)
245 - Dialing Out OK?
246 - OK To Answer the Phone?
248 - Force FTS-0001 Mail Sessions (0/1)
249 - Receive Mail From Unlisted Nodes? (0/1)
250 - Send Mail to Unlisted Nodes? (0/1)
251 - Was the last incoming call to the BBS or Mail (1 for BBS, 0
for mailer)
252 - Sealink Overdrive Off (0/1) 1 = off
253 - Sealink Mail On/Off (1 = on)
254 - 1k Sealink On/Off (1 = off)
255 - Allow DietINFA (1 = on (TBBS & XBBS use dietINFA))
256 - In Chat with Sysop (0/1)
257 - Debug Transfers (0/1) Extra Log Info
258 - Allow Hydra Mail Transfers (0/1) (Currently Disabled)
259 - Allow ZedZip for Mail Transfers (0/1) 19
260 - Allow ZedZap for Mail Transfer (0/1)
261 - Turn the mailer off? (0/1) 1 = off
262 - Key to represent Yes (Y) for USA
263 - Key to represent No (N) for USA
264 - Key to represent Stop (S) for USA
264 - Key to represent Pause (P) for USA
264 - Key to represent Quit (Q) for USA
268 - Maximum # of resyncs to abort transfers
269 - Maximum # of transfer errors to abort on
270 - Last Users on this lines name
271 - Last Mailer to call this node
272 - Last Long Entry Written
276 - Check Carrier Detect (0/1) 1 = on
277 - Video Display Handle
278 - Number of ring to wait for answer on this node
** Examples **
bbsname=AdeptGetVar(LineNumber,137)
AdeptPrint(line,"\r\nWelcome to"bbsname"! You are welcomed by the
Sysop")
This would come out like "Welcome to DeathStar/2! You are welcomed
by The Sysop". (Except DeathStar/2 would be your BBS name :)
AdeptHitReturn
call AdeptHitReturn LineNumber
or
Value = AdeptHitReturn(LineNumber)
AdeptHitReturn will wait for the user to press enter. This will
use the Press Enter to continue in the English.Text or other
language file.
** Example **
call AdeptHitReturn LineNumber
This would prompt the user to press Enter (return) to continue. 20
AdeptInKey
call AdeptInKey LineNumber
or
Value = AdeptInKey(LineNumber)
AdeptInKey will return the ASCII code for a incoming key sequence.
AdeptInKey will not wait for a key, it will return 0 if there are no
keys waiting. If you use this in a loop, please offset the amount
of CPU time a loop uses with a AdeptSleep command.
** Example **
ReturnCode = AdeptInKey(LineNumber)
AdeptInput
call AdeptInput LineNumber, MinLen, MaxLen, Type, Flags, Prompt, Help,
HelpFile, Default
or
Value = AdeptInput(LineNumber, MinLen, MaxLen, Type, Flags, Prompt,
Help, HelpFile, Default)
Get a string from the user.
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
MinLen:
Minimum length of input string.
MaxLen:
Maximum length of input string.
Type:
Type of input (will define later)
Flags:
<undefined>
Prompt:
Prompt to display when asking for input.
Help: 21
Name of subject to look for in HelpFile when user asks for help.
HelpFile:
Contains help on subjects pertaining to this input prompt.
Default:
Default keystroke.
** Example **
answer=AdeptInput(LineNumber,1,50,,,'What Is your Name : ',,,)
call AdeptPrint LineNumber,'\r\n Your name is' answer
This would ask the User for his or her name with a MinLen of 1
Character and a MaxLen of 50 Characters, with a prompt of "What
is your Name". When this is printed, it will print to the local
and remote screen "Your Name is Jean-Ray" (Jean-Ray being the
name entered).
AdeptLibrary
call AdeptLibraryLineNumber, Type, StartAt, KeyName
or
Value = AdeptLibrary(LineNumber, Type, StartAt, KeyName)
Library area manipulation.
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
Type:
1 Returns name of current library area.
2 Returns number of current library area.
3 Find library area (number of area to find in StartAt)
Returns library area number
4 Find library area (name of area to find in KeyName)
Returns name of current library area.
5 Go to next library area
Returns name of current library area.
6 Go to previous library area
Returns name of current library area.
7 Returns path of current library area.
StartAt:
Number of area to look for. (see type 3)
Keyname: 22
Name of area to look for. (see type 4)
** NOTE: The Adept Library Functions are not yet finished.
AdeptLocation
call AdeptLocation LineNumber, "User Location on the BBS"
or
Value = AdeptLocation(LineNumber, "User Location on the BBS")
Will display where the User is on the BBS (Sysop defined)
** Example **
call AdeptLocation LineNumber,"In Door - Barren Realms Elite"
This would display the user on that particular line in a Door of
Barren Realms Elite.
** NOTE: Remember, Once the script ends, the location will go back
to what it was before the function was executed. This
function however is great for Doors and Chat Mode with the
Sysop if you Use a Main.Cmd or a .Cmd file for your Door
Menu. It can let other users know what Door the other
node(s) are in if any.
AdeptLog
call AdeptLog LineNumber, Flags, String1, ..., StringN
or
Value = AdeptLog(LineNumber, Flags, String1, ..., StringN)
Log an action.
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
Flags:
1 Output to log and listbox
2 Output to log only
3 Output to listbox only
String1..N: 23
Strings are added together to form one string which is used to
spawn the session.
** Examples **
call AdeptLog LineNumber,2,'Mylog'
AdeptMenu
call AdeptMenu LineNumber, Flags, MenuName
or
Value = AdeptMenu(LineNumber, Flags, MenuName)
Executes a menu contain in the file MenuName.
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
Flags:
1 Return after user chooses a command from the menu.
2 Return after executing all commands contained in menu.
MenuName:
File name of the menu to use.
** Example **
call AdeptMenu LineNumber,2,'Test.Menu'
AdeptMenuType
call AdeptMenuType LineNumber, menutype, menudata
or
Value = AdeptMenuType(LineNumber, menutype, menudata)
This command allows you to execute a menu options 10 - 998. Just
pass the standard menudata.
** Example **
call AdeptMenuTypeLineNumber,42,,,0 24
This would display The Users online at the current time.
AdeptMessage
call AdeptMessage LineNumber, Type, StartAt, KeyName
or
Value = AdeptMessage(LineNumber, Type, StartAt, KeyName)
Message area manipulation.
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
Type:
1 Returns name of current message area.
2 Returns number of current message area.
3 Find message area (number of area to find in StartAt)
Returns message area number
4 Find message area (name of area to find in KeyName)
Returns name of current message area.
5 Go to next message area
Returns name of current message area.
6 Go to previous message area
Returns name of current message area.
7 Returns number of messages in current message area.
StartAt:
Number of area to look for. (see type 3)
Keyname:
Name of area to look for. (see type 4)
** Example **
call AdeptMessage LineNumber,3,'1',
Would find message area Number 1 as listed in the
Adept\System\Message_Areas file. 25
AdeptMore
call AdeptMore LineNumber
or
Value = AdeptMore(LineNumber)
AdeptMore will execute a standard more prompt. This will use the
More prompt in the English.Text or other language file. This will
also use the International Y/N/Q/A info.
AdeptPause
call AdeptPause LineNumber
or
Value = AdeptPause(LineNumber)
AdeptPause will wait for any key. This does not display any text.
** Example **
call AdeptPause LineNumber
Will wait for any key to be pressed on current node.
AdeptPeekByte
call AdeptPeekByteLineNumber, length
or
Value = AdeptPeekByte(LineNumber, length)
Will place the next char in the incoming stream that is waiting.
It will NOT remove it from the incoming data steam.
Length is the amount of time to wait for the next char to
enter the data stream. (This is a RAW comm function).
The software will return TIMEOUT or LOSTCARRIER.
** Example **
call AdeptPeekByte LineNumber,6000 26
Will Wait 6 seconds for the next char to enter the data stream.
AdeptPrint
call AdeptPrint LineNumber, String1, ..., StringN
or
Value = AdeptPrint(LineNumber, String1, ..., StringN)
Prints a string to the local and remote screen. The string may
contain Adept META variables. You may pass more than one or more
strings to this function.
String1..N:
Strings are printed in the order that they were passed.
** Example **
call AdeptPrint LineNumber,"Hello! Welcome to The BBS"
This Would print "Hello! Welcome to The BBS" to the User online.
AdeptPrintL
call AdeptPrintL LineNumber, "Text to print locally ONLY"
or
Value = AdeptPrintL(LineNumber, "Text to print locally ONLY")
AdeptPrintL works exactly like AdeptPrint except it prints to the
LOCAL screen only.
AdeptPutC
call AdeptPutC LineNumber, char
or
Value = AdeptPutC(LineNumber, char)
AdeptPutC will put a char into the Com port output stream. This is
a raw com function. It will return -1 for carrier drop.
** BE CAREFUL** 27
This is a RAW com function. This is only to be used by
professionals or people experienced with programming serial based
products.
** Example **
call AdeptPutC LineNumber,'A'
This would put the letter 'A' in the Com Port's output stream.
AdeptPutKey
call AdeptPutKey LineNumber, char
or
Value = AdeptPutKey(LineNumber, char)
AdeptPutKey will place a character into keyboard input stream. Char
can be a character i.e. 'A' or a ASCII character code.
** Example **
call AdeptPutKey LineNumber,'A'
Will put the Character 'A' in the Keyboard's input stream.
AdeptRead
call AdeptRead LineNumber, Type, Flags, StartAt
or
Value = AdeptRead(LineNumber, Type, Flags, StartAt)
Read messages.
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
Type:
1 Read messages in current area.
2 Globally read messages.
Flags: 28
<undefined so far>
StartAt:
Number of message at which Adept should start reading.
** Examples **
call AdeptRead LineNumber,2,,4
This would start the user currently online reading the messages
globally starting from Message Area #4 (as defined in
Adept\System\Message_Areas file).
AdeptRecv
call AdeptRecv LineNumber, Flags, Path, Area, File1, ..., FileN
or
Value = AdeptRecv(LineNumber, Flags, Path, Area, File1, ..., FileN)
Upload files
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
Flags:
1 No time verification
4 Silence
8 Never be silent
16 Don't ask for description
64 Don't credit upload (does not return files size)
128 Accept as private file.
Path:
Path to put files in.
Area:
Name of area to put files in.
File1..N:
Names of files to be received.
Returns:
String containing number of bytes downloaded, a space and the
number of files downloaded.
NOTE: This function will change in the future. 29
** Example **
call AdeptRecv line,128,'D:\ADEPT','AdeptSoft','Adept97b.Zip'
This will send the File Adept97b.Zip from the AdeptSoft area and
the directory of D:\ADEPT
AdeptRexxKillThread
AdeptRexxStartThread
RetCode = AdeptRexxStartThread(FileName, [var1 var2 var3 var4])
PARAMETERS
FileName - Name of AdeptREXX program to execute as a background
thread.
Var1 - Variable to pass to the rexx program, you can pass as
many variables you want. They are not shared once they
are passed. See - AdeptSetGlobalVar and
AdeptGetGlobalVar
RETURNS
REXX Error Codes
EXAMPLE
rc = AdeptRexxStart('Thread.Cmd', line)
DESCRIPTION
This will cause the program Thread.Cmd to be run in the
background with the rexx programming calling it as the parent.
When the parent ends, all children and grandchildren are killed
with it. 30
RELATED FUNCTIONS
AdeptKillRexxThread, AdeptSetGlobalVar, AdeptGetGlobalVar,
AdeptDropGlobalVar
AdeptSend
call AdeptSend LineNumber, Flags, Path, File1, ..., FileN
call AdeptSent LineNumber,,,''@file''
or
Value = AdeptSend(LineNumber, Flags, Path, File1, ..., FileN)
Value = AdeptSent(LineNumber,,,''@file'')
Download Files.
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
Flags:
1 No time verification
2 No leech checking
4 Silence
8 Never be silent
16 Don't check all download paths
64 Don't return files length (free file/bytes)
Path:
Path to files. If blank, use current file area path.
File1..N:
Names of files to be sent.
NOTE: Currently the files are sent one at a time.
@File:
Text file with the filenames and paths (one per line) of
the files to send.
Returns:
String containing number of bytes downloaded, a space and the
number of files downloaded.
** Example ** 31
call AdeptSend LineNumber,,,'@c:\list')
Will send the File that is in the file called list.
AdeptSetBit
call AdeptSetBit LineNumber, BIT NUMBER, Numeric Long
or
Value = AdeptSetBit(LineNumber, BIT NUMBER, Numeric Long)
Will set BIT Number 1 - 32 to ON.
The changes are not saved until you put the changes back into
active memory with the AdeptPutVar option.
** Example **
SetBit= AdeptGetVar(LineNumber,42)
call AdeptSetBit LineNumber,30,SetBit
AdeptSetGlobalVar
RetCode = AdeptSetGlobalVar('VarName', Value)
AdeptSetTimer
call AdeptSetTimer LineNumber, Timer
or
Value = AdeptSetTimer(LineNumber, Timer)
LineNumber:
Passed to REXX routine from Adept as First Parameter.
Timer: Time In Milliseconds
** Example **
call AdeptSetTimer LineNumber,10000 /* 10 seconds */ 32
AdeptShow
call AdeptShow LineNumber, Type, Flags, StartAt, KeyName
or
Value = AdeptShow(LineNumber, Type, Flags, StartAt, KeyName)
Display text files.
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
Type:
1 Show a text file (StartAt=filename, KeyName=keys to abort
on)
2 Page-read text file (Keyname=filename)
3 Show new text files (Keyname=directory to look in)
4 Show any text file (Keyname=directory to look in)
Flags:
<undefined> (for now)
StartAt:
(see type 1)
KeyName:
Keys on which to abort showing of the text file. (see type 1)
-or-
Name of file or directory to look for. (see types 2-4)
** Examples **
call AdeptShow LineNumber,1,,'C:\Adept\Text\Bullet.Ans,Q
This would display the Bullet.Ans file in the Adept\Text directory
and if the User presses the letter 'Q' it will abort viewing of the
file.
AdeptSleep
call AdeptSleep LineNumber, time_to_sleep_in_milliseconds
or
Value = AdeptSleep(LineNumber, time_to_sleep_in_milliseconds) 33
AdeptSleep will cause the current node to sleep for x amount of
milli-seconds. This is very helpful in making your REXX scripts CPU
friendly. When you use this command it will release the current time
slice to the next node or program waiting in line. A decent sleep
amount is AdeptSleep(65), 65 milliseconds, 1000 milliseconds = 1
second.
The smallest timeslice OS/2 can sleep is 32ms.
** Examples **
call AdeptSleep LineNumber,1000 /* 1 Second */
call AdeptSleep LineNumber,10000 /* 10 Seconds */
call AdeptSleep LineNumber,60000 /* 1 Minute */
call AdeptSleep LineNumber,600000 /* 10 Minutes */
AdeptTimedInKey
call AdeptTimedInKey LineNumber,timeout
or
Value = AdeptTimedInKey(LineNumber,timeout)
Returns the value for the key imputed, watched the port for a
period of time in milliseconds.
** Example **
KeyIn=AdeptTimedInKey(LineNumber,5000) /* 5 seconds */
** NOTE: KeyIn contains the key pressed or -1 or 0 for timeout or -2
for carrier loss.
AdeptTimeLeft
call AdeptTimeLeft LineNumber[, SecsLeftInSession]
or
Value = AdeptTimeLeft(LineNumber[, SecsLeftInSession])
Optionally sets time left in current session. Always returns time
left in current session. 34
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
SecsLeftInSession:
Optional. Set seconds left in current session.
Returns:
Time left in session in seconds.
** Example **
call AdeptTimeLeft LineNumber, 60000
This will give the user online 1 minute left in his/her session.
AdeptTimerUp
call AdeptTimerUp LineNumber, Timer
or
Value = AdeptTimerUp(LineNumber, Timer)
AdeptTimerUp will return 0 if timer is Up or 1 if it is Not
** Example with the TWO PREVIOUS rexx Functions **
Timer=AdeptSetTimer(LineNumber,10000) /* 10 Seconds */
MyRet=AdeptTimerUp(LineNumber,timer)
MyRet = 0 if timer is up or 1 if it is not.
AdeptUnsetBit
call AdeptUnsetBit LineNumber, BIT NUMBER, Numeric Long
or
Value = AdeptUnsetBit(LineNumber, BIT NUMBER, Numeric Long)
Will set BIT Number 1 - 32 to OFF.
The changes are not saved until you put the changes back into active
memory with the AdeptPutVar option. 35
** Example **
call AdeptUnsetBit LineNumber, 30, SetBit
Will turn bit number 30 OFF.
***NOTE : The changes are not saved until you put the changes back
into active memory with the AdeptPutVar option.
AdeptWaitConnect
call AdeptWaitConnect LineNumber, Time
or
Value = AdeptWaitConnect(LineNumber, Time)
AdeptWaitConnect will wait for a modem connect or error code. It
will return 0 if it time outs if it doesn't timeout it will
then return the return code from the modem i.e. 'CONNECT 28800'
'ERROR', 'OK', 'NO CARRIER'.
The time is in the format of milliseconds.
AdeptWaitKey
call AdeptWaitKey LineNumber
or
Value = AdeptWaitKey(LineNumber)
AdeptWaitKey will return the ASCII code for a incoming key sequence.
Unlike AdeptInKey, AdeptWaitKey will actually wait for a key
sequence. If the user times out, it will log the user off.
** Example **
ReturnCode = AdeptInKey(LineNumber) 36
AdeptWrite
call AdeptWrite LineNumber, Type, Flags, Filename
or
Value = AdeptWrite(LineNumber, Type, Flags, Filename)
Write a message.
LineNumber:
Line number. Passed to REXX routine from Adept as first
parameter.
Type:
1 Write a message (Filename is unused)
2 edit file using editor (Flags are unused)
Flags:
1 Force message to force-to-name of current message area.
2 Force private
4 Force public
8 Use MSGTMP.LineNumber file
Filename:
Name of text file to edit.
** Example **
call AdeptWrite LineNumber, 1, 4,
This would write a public message in the current area.
AfSysAddIndexEntries
RetCode = AfSysAddIndexEntries(fSysHandle)
AfSysAddIndexEntries adds entries in the indexes for a file.
PARAMETERS
fSysHandle- input
Handle to the currently open file system.
RETURNS
Return Code. 37
AfSysAddIndexEntries may return the following values:
0 No errors.
92 FSYS_ERROR_SEM_TIMEOUT
200 FSYS_ERROR_ADDING_DATED
201 FSYS_ERROR_ADDING_ANAME
202 FSYS_ERROR_ADDING_NAME
REMARKS
Index data should be set using the AfSysSetIndexXXXX series of
functions before adding a file to the indexes.
EXAMPLE CODE
This example deletes the old index entries for a file, set the new
index data, then adds in the new index entries.
FSysDeleteIndexEntries(hFSys)
/* set new index data */
AfSysGetFileName(fSysHandle, 'Buffer')
AfSysSetIndexFilename(fSysHandle, Buffer)
AfSysGetFileDate(fSysHandle, 'Date')
AfSysSetIndexEntryDate(fSysHandle, Date.1, Date.2, Date.3)
AreaNum = FSysGetFileArea(fSysHandle)
AfSysSetIndexAreaNumber(fSysHandle, AreaNum)
/* add in new index entries */
FSysAddIndexEntries(fSysHandle);
AfSysClose
RetCode = AfSysClose(fSysHandle)
AfSysClose close the file system.
PARAMETERS
fSysHandle - input 38
Handle to the currently open file system.
RETURNS
Return Code.
AfSysClose may return the following values:
0 No errors.
EXAMPLE CODE
This example calls AfSysOpen and creates new file system files,
then closes the file system.
RetCode = AfSysOpen('.\Files', 'fSysHandle', 'FALSE')
.
.
// use the file system.
.
.
RetCode = fSysClose(fSysHandle)
AfSysDeleteIndexEntries
RetCode = AfSysDeleteIndexEntries(fSysHandle)
AfSysDeleteIndexEntries deletes a file from all of the indexes.
PARAMETERS
fSysHandle - input Handle to the currently open file system.
RETURNS
Return Code.
AfSysDeleteIndexEntries may return the following values:
0 No errors.
92 FSYS_ERROR_SEM_TIMEOUT
190 FSYS_ERROR_DELETING_DATED
191 FSYS_ERROR_DELETING_ANAME
192 FSYS_ERROR_DELETING_NAME
REMARKS 39
AfSysDeleteIndexEntries deletes all refrences to a certain file in
the indexes. It does NOT remove that files record from the data
file.
To set which file you wish to delete, you must either search for,
and find the file using the searching functions or you must use the
AfSysSetIndexXXXXX series of functions to set the correct filename,
date, area name and file record offset. Obviously it is best to
search for the file, find it and confirm it is the file you wish to
delete before you delete it.
EXAMPLE CODE
Assuming you have already set the file index information this
example calls AfSysDeleteIndexEntries to delete the file from the
indexes.
RetCode = AfSysDeleteIndexEntries(fSysHandle)
AfSysOpen
RetCode = AfSysOpen(Directory, fSysHandle, Create)
FSysOpen should be called by each program in the process which wants
to use the file system.
PARAMETERS
Directory -
This is the directory that the files system is located in.
Normally a program which uses the Adept file system is started
in the '\Adept' directory and the files system would then be in
'.\Files' or more simply, 'Files'. The directory name should
NOT end with a backslash or forward slash.
FSysHandle - output
This contains the handle to the file system.
Create - input
Tells the file system whether to open the current file system
files or to create new ones.
FALSE - Open current files. 40
TRUE - Create/Open new files.
RETURNS
Return Code.
AFSysOpen may return the following values:
0 No errors.
90 FSYS_ERROR_ALLOC_MEM
91 FSYS_ERROR_INIT_BIDX
100 FSYS_ERROR_OPEN_DATA
101 FSYS_ERROR_OPEN_DESC
102 FSYS_ERROR_OPEN_PATH
103 FSYS_ERROR_OPEN_NIDX
104 FSYS_ERROR_OPEN_DIDX
105 FSYS_ERROR_OPEN_AIDX
180 FSYS_ERROR_CREATING_KEY
REMARKS
A successful AfSysOpen request returns a handle to the file
system. All other calls to the file system functions require this
handle.
Note: When you choose to create a new file system, the indexes are
destroyed if they exist. All other files are opened and NOT
destroyed.
If you wish to create all files from scratch, make sure there are
no files in the directory.
You could call AfSysOpen twice with a different directory to open
two different files system to copy entries from one file system
to another.
EXAMPLE CODE
This example calls AfSysOpen and uses the current file system
files.
RetCode = FSysOpen('.\Files', 'FSysHandle', 'FALSE') 41
AfSysSetIndexAreaNumber
AfSysSetIndexEntryDate
AfSysSetIndexFileName
AfSysSetIndexRecordOffset
AfSysSetFileName
AfSysGetFileName
AfSysSetUploader
AfSysGetUploader
AfSysSetFileSize
AfSysGetFileSize
AfSysSetFileArea
AfSysGetFileArea
AfSysSetFileDate
AfSysGetFileDate
AfSysGetFileDescription
AfSysSetFileDescription
AfSysSetListable
AfSysGetListable
AfSysGetFreeFile
AfSysGetFreeTime
AfSysGetFreeBytes
AfSysgetSecLevel
AfSysGetCopyFile
AfSysGetAge
AfSysGetDlAble
AfSysGetPathName
AfSysGetTimesDl
AfSysSetPathIndex
AfSysSetAge
AfSysSetDlAble
AfSysSetSecLevel
AfSysSetReadDescFlag
AfSysSetCopyFile
AfSysSetFileRecord 42
AfSysSetDescOffset
AfSysReadFilePath
AfSysWriteFilePath
AfSysFindFirstName
AfSysFindNextName
AfSysFindExact
AfSysListFirst
AfSysListNext
AfSysZeroFileRecord
AfSysFirstName
AfSysAddIndexEntries
AfSysResetFilePtr
AfSysResetDescFilePtr
AfSysReadDescriptionLine
AfSysRawReadFileRecord
AdeptComPutC
AdeptComWrite
AdeptComPeekByte
AdeptComGetByte
AdeptComDoDTR
AdeptComFlush
AdeptComGetString
AdeptComGetBlock
AdeptComWaitConnect
AdeptComDial
AdeptRawOpenSocket
AdeptRawComOpen
AdeptRawComClose
AdeptRawComGetBlock
AdeptRawComGetString
AdeptRawComWrite
AdeptRawSetBPS
AdeptRawComLink
ReturnComPort
AdeptTimeLeft
AdeptCurPos
AdeptSayGen
AdeptPlayMM
Adept16BitCRC 43
Adept32BitCRC
AdeptCheckForMail
AdeptChangeGroup
AdeptSetBit
AdeptUnsetBit
AdeptCheckBit
AdeptGetVar
AdeptPutVar
AdeptPrint
Print
AdeptPrintL
Printf
AdeptCall
AdeptInput
AdeptSend
AdeptRecv
AdeptMenu
AdeptConvert
AdeptCls
AdeptWrite
AdeptRead
AdeptFile
AdeptMessage
AdeptShow
AdeptSleep
AdeptInKey
AdeptWaitKey
AdeptPutKey
AdeptCheckCard
AdeptSetTimer
AdeptTimedInkey
AdeptTimerUp
AdeptLocation
AdeptHitReturn
AdeptMore
AdeptPause
AChatSendMsg - Multi-node chat
AChatGetMsg - Multi-node chat
AChatDeleteAll - Multi-node chat
AChatUnavailable - Multi-node chat
AdeptCheckCard - Validate credit card 44
-- Userbase minipulation functions --
AdeptGetUser - Get a user and pull their record into a temp var
AdeptNextUser - Get next user in the file and pull into a temp
var
AdeptPrevUser - Get prev user in the file and pull into a temp
var
AdeptGetUserVar - Get functions for temp user in memory
AdeptPutUserVar - Put functions for temp user in memory
AdeptSaveUser - Saved the temp memory vars to users record 45
CTRL AND OTHER KEYS AND THEIR RETURN CODES:
CTRL_A = 1 CTRL_B = 2 CTRL_C = 3 CTRL_D = 4
CTRL_E = 5 CTRL_F = 6 CTRL_G = 7 CTRL_H = 8
CTRL_I = 9 CTRL_J = 10 CTRL_K = 11 CTRL_L = 12
CTRL_N = 14 CTRL_O = 15 CTRL_P = 16 CTRL_Q = 17
CTRL_R = 18 CTRL_S = 19 CTRL_T = 20 CTRL_U = 21
CTRL_V = 22 CTRL_W = 23 CTRL_X = 24 CTRL_Y = 25
CTRL_Z = 26
HOME = 71+1024 UP = 72+1024 PGUP = 73+1024 BS = 75+1024
FWD = 77+1024 END = 79+1024 DN = 80+1024 PGDN = 81+1024
INS = 82+1024 DEL = 83+1024 LEFT = 75+1024 RIGHT = 77+1024