home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
teachapl.zip
/
teach44.zip
/
TEACH44.ATF
Wrap
Text File
|
1996-06-16
|
70KB
|
856 lines
XNÉIO 0 1 °
XNÉCT 0 1.000000000000011E²13 °
XCÉFC 1 6 .,*0_² °
XNÉRL 0 1060806853 °
XCÉPR 0 °
XCÉLX 1 5 TEACH °
*(1992 1 21 11 4 42 364) °
FATT ÉFX 'U╜ATT W;T' °
'Σ Convert numeric vector to display attribute integer' °
'W╜2 8 2 8|4╞W' 'T╜(=/W[2 4])doif ''W[4]╜8|W[4]+7''' °
X 'U╜2¥W[1],(2 2 2ÿW[2]),W[3],2 2 2ÿW[4]' °
*(1992 1 24 10 57 19 492) °
FATTS ÉFX 'U╜ATTS W;LC;HC;IN;BL;ÉIO;C;T' °
'Σ List display attributes associated with integers' 'ÉIO╜0' °
'LC╜(Γ''Light ''),■HC╜''Blue'' ''Green'' ''Cyan'' ''Red'' ''Magenta''' °
'LC╜(Γ''Gray''),LC,''Yellow'' ''White''' °
'LC╜ΘπLC HC╜(Γ''Black''),HC,''Brown'' ''White''' °
'IN╜''Low'' ''High''' 'BL╜''No'' ''Yes''' °
'U╜Γ''CODE'' ''BLINK'' ''BACKGROUND'' ''INTENSITY'' ''FOREGROUND''' °
'L0:C╜(8µ2)ÿT╜╞W' 'W╜1╟W' °
'U╜U,ΓT,BL[C[0]],LC[C[4];2¥C[1 2 3]],IN[C[4]],LC[C[4];2¥C[5 6 7]]' °
X '╕(0<µW)/L0' 'U╜πU' °
*(1996 6 13 13 7 41 384) °
FCOLORS ÉFX 'U╜COLORS;C;T;F;B;N;R' °
'Σ Select background and foreground colors' °
'C╜''Black'' ''Blue'' ''Green'' ''Cyan'' ''Red'' ''Magenta'' ''Yellow' °
' ''Gray''' °
'C╜C,''Light Gray'' ''Light Blue'' ''Light Green'' ''Light Cyan''' °
'C╜C,''Light red'' ''Light Magenta'' ''Brown'' ''White''' '1 tab C' °
'L0:T╜1 get ''Enter the color of text (foreground): ''' °
'(R N F)╜ÉEC T ╪ ╕(R=1)/L1 ╪ F╜(ucf C)∞Γucf T ╪ ╕(F≤µC)/L1' °
'''NO SUCH COLOR'' ╪ ╕L0' °
'L1:T╜1 get ''Enter the color of the background (field): ''' °
'(R N B)╜ÉEC T ╪ ╕(R=1)/L2 ╪ B╜(ucf C)∞Γucf T ╪ ╕(B≤µC)/L2' °
'''NO SUCH COLOR'' ╪ ╕L1' °
'L2:╕(F⌠B)/L3 ╪ ''Text and background are the same color'' ╪ ╕L0' °
X 'L3:U╜0⌐255╛╛(F-1)+16⌡B-1' °
*(1992 1 14 9 44 41 484) °
FDISPLAY ÉFX 'D╜S DISPLAY A;ÉIO;R;C;HL;HC;HT;HB;VL;VB;V;W;N;B' °
'Σ DISPLAY A GENERAL ARRAY IN PICTORIAL FORM' °
'Σ NORMAL CALL IS MONADIC. DYADIC CALL USED ONLY IN' °
'Σ RECURSION TO SPECIFY DISPLAY RANK, SHAPE, AND DEPTH.' 'ÉIO╜0' °
'»(0=ÉNC ''S'')/''S╜µA''' 'R╜╞µ,S Σ PSEUDO RANK.' °
'C╜''┐┌└┘'' Σ UR, UL, LL, AND LR CORNERS.' °
'HL╜''─'' Σ HORIZONTAL LINE.' °
'HC╜HL,''Θ╕'',HL,''~+ε'' Σ HORIZONTAL BORDERS.' °
'HT╜HC[(0<R)⌡1+0<╞²1╞,S]' 'ΣW╜,0╧■╞0µΓ(1⌐µA)╞A' °
'HB╜HC[3+3╛(''2⌡~A╧«A'' ÉEA ''1+╞ε0⌡(1⌐⌡/µA)╞,A'')+3⌡1<µµS]' °
'VL╜''│'' Σ VERTICAL LINE.' °
'VB╜VL,''Φ╟'' Σ VERTICAL BORDER.' °
'V╜VB[(1<R)⌡1+0<²1╞²1╟,S]' °
'»(0εµA)/''A╜(1⌐µA)µΓ╞A'' Σ SHOW PROTOTYPE OF EMPTIES.' °
'╕(1<╧A)/GEN' '╕(2<µµA)/D3' °
'D╜«A Σ SIMPLE ARRAYS.' 'W╜1╞µD╜(²2╞1 1,µD)µD' °
'N╜²1+1╟µD' '╕(0=µµA)/SS' °
'D╜(C[1],V,((W-1)µVL),C[2]),((HT,NµHL),[0]D,[0]HB,NµHL),C[0],(WµVL),C[ °
3]' '╕0' 'SS:HB╜((0 '' '')=╞0µΓA)/'' -''' °
'D╜'' '',('' '',[0]D,[0]HB,Nµ'' ''),'' ''' '╕0' °
'GEN:D╜«DISPLAY■A Σ ENCLOSED ...' 'N╜Dδ.⌠'' ''' °
'D╜(Nδ~1ΦN)≡D' 'D╜(δ≡~'' ''╤D)/D' 'D╜((1,µS)µS)DISPLAY D' °
'╕(2≥µ,S)╟D3E,0' 'D3:D╜0 ²1╟0 1╟«ΓA Σ MULT-DIMENSIONAL ...' °
'W╜1╞µD' 'N╜²1+1╟µD' °
'D╜(C[1],V,((W-1)µVL),C[2]),((HT,NµHL),[0]D,[0]HB,NµHL),C[0],(WµVL),C[ °
3]' 'D3E:N╜²2+µ,S' °
X 'V╜C[Nµ1],[0]VB[1+0<²2╟,S],[0](((²3+╞µD),N)µVL),[0]C[Nµ2]' 'D╜V,D' °
*(1992 8 14 10 7 40 364) °
FDOS ÉFX 'DOS W;T;D100;D2' 'Σ Simulation of DOS prompt' °
'T╜100 ÉSVO ''D100''' °
'T╜(2⌠ÉSVO ''D100'')doif ''''''AP100.COM'''' opentwo 1'' ''T╜100 ÉSVO °
''''D100''''''' '╕((0<µ(W⌠'' '')/W)doif ''D100╜W'')/0' 'L0:æ╜''C:>''' °
X '╕(^/'' ''=T╜3╟æ)/0' 'D100╜T' '╕L0' °
XNFLDS 2 3 6 1 1 5 10 0 2 1 1 1 7 0 64 2 1 2 7 0 174 °
*(1991 7 26 11 0 0 220) °
FFSCLOSE ÉFX 'R╜FSCLOSE;E' 'Σ Retract and expunge shared variables' °
X 'E╜(ÉEX 5 3µ''CfsDfsfsnfsffss''),ÉSVR 2 3µ''CfsDfs''' '╕R╜0' °
*(1991 7 26 11 0 0 220) °
FFSOPEN ÉFX 'R╜FSOPEN;E;F;ÉIO' 'Σ Open (Share with AP124)' 'R╜ÉIO╜1' °
'E╜(ÉEX 2 3µ''CfsDfs''),ÉSVR 2 3µ''CfsDfs''' °
'╕(0^.=E╜124 ÉSVO■''Cfs'' ''Dfs'')/LD' 'ÉSVE╜15' 'pVs:' °
'(E F)╜ÉSVO■''Cfs'' ''Dfs'' Σ Check degree of coupling' °
'╕((E=2)^(F>0))/mVd Σ Out of loop if shared' °
'╕(0⌠ÉSVE)/pVs Σ Retry if time left' °
'╕LD Σ Out of time, quit' °
'mVd:E╜1 0 1 0 ÉSVC ''Cfs''' 'Cfs╜9 Σ Determine screen size' °
'╕(0⌠╞E╜Cfs)/LC' '╕((1⌠╞µDfs)^2=ÉNC ''fss'')/LB' 'fss╜2╞2╟,Dfs' °
'LB:╕R╜0' 'LC:╕0,µÉ╜''FSOPEN - AP124 error: '',«E' °
X 'LD:╕0,µÉ╜''FSOPEN - AP124 share offer failed''' °
*(1992 1 14 9 44 42 488) °
FGO ÉFX 'GO;b;e;t' 'Σ Expression driver' 'L0:b╜e╜''''' 'æ╜'' ''' °
't╜æ' '╕(^/'' ''=t)/L0' '╕((^/'')OFF ''=5╞6╟t)doif ''exit'')/0' °
'╕(('':''εt)doif ''b╜evaldd (+/^\'''' ''''=t)╟t'')/L0' °
'''e╜ÉEM'' ÉEA t' '╕(0=µ,e)/L0' '╕b/L0' °
'''This is not a valid APL2 expression''' 'æ╜''*''' °
X '╕(''?''⌠╞1╟æ)/L0' 'e' '╕L0' °
*(1995 4 23 14 14 6 304) °
FSVOFFER ÉFX 'DC╜PID SVOFFER SV' 'SV╜(²2╞1 1,µSV)µSV╜πSV' °
'╕(2=ÉNC ''PID'')/DYADIC' 'DC╜ÉSVO SV ╪ ╕0' °
'DYADIC:╕(1^.⌠DC╜PID ÉSVO SV)/END' 'ÉSVE╜15' °
'CHECK:╕(1^.⌠DC╜ÉSVO SV)/END' '╕(0⌠ÉSVE)/CHECK' °
X 'END:SV╜1 0 1 0 ÉSVC SV' °
*(1996 6 11 13 4 44 376) °
FTEACH ÉFX 'TEACH' 'Σ Copyright Z V Jizba 1991; all rights reserved' °
'copyright' 'initialize' 'warning' '''One moment please!''' 'panela' °
'TEACH1 Σ Full screen auxilliary processor' °
'TEACH2 Σ Control and Data variables, screen mode' °
'TEACH3 Σ Manipulating the screen' 'TEACH4 Σ Fields' °
'TEACH5 Σ Entering data into a field' °
'TEACH6 Σ Changing attributes of fields' °
'TEACH7 Σ Interacting with the physical screen' °
'TEACH8 Σ Practice using fields' 'TEACH9 Σ Entering data' °
X 'TEACH10 Σ Miscellaneous commands' °
*(1996 6 13 13 22 47 468) °
FTEACH1 ÉFX 'TEACH1;T;C124;D124' 'Σ A P 124' '5 1µ'' ''' °
'''THE FULL SCREEN AUXILLIARY PROCESSOR 124'',r' °
'''The opening panel of this lesson illustrates the nature of the Full °
''' °
'''screen Auxilliary Processor 124. It provides the capability to''' °
'''generate fields on the screen, and to control the behavior of those °
''' °
'''fields. (You can re-create the starting panel by entering: panela,' °
'' '''BUT KEEP IN MIND THAT THIS FUNCTION WILL RETRACT AP 124.)''' °
'do' '''We begin by activating the Auxilliary Processor'',r' °
'show ''124 SVOFFER ''''C124'''' ''''D124''''''' °
'''This AP requires two shared variables. D124 to contain data, and C1 °
24''' °
'''to control the activity of the display. We can begin by investigati °
ng''' '''the initial format of the "LOGICAL SCREEN".'',r' °
'show ''C124╜9 ╪ D124 ╪ test''' °
'''Note the sequence: First we specified the desired action by assigni °
ng''' °
'''an integer (9) to C124. Then we interrogated the response which is' °
'' °
'''stored in D124. We find from the six element vector that the initia °
l''' '''logical screen has the following characteristics:'',r' °
''' 1 The field begins in row 1 of the screen''' °
''' 1 The field begins in column 1 of the screen''' °
''' 37 The field contains 37 rows''' °
''' 80 The field contains 80 columns''' °
''' 2 The field is for output only''' °
''' 1 The foreground color is 1 (blue)'',r' °
'''NOTE! The initial value of this vector (in D124) cannot be used, an °
d''' ''' MUST be re-defined for a new window.'',r' 'do' °
'''The above example illustrated the process of dealing with AP 124:'' °
,r' ''' 1. A numeric command was given to the CONTROL variable''' °
''' 2. The DATA variable was next used (or it may be assigned)'',r' °
'''While these two variables were being invoked, no visible action was °
''' '''taking place on the screen.'',r' °
'''The contents of the screen is manipulated by these two variables''' °
'''(CONTROL and DATA) in a separate block of memory called the LOGICAL °
''' °
'''SCREEN. Only when the process of building this LOGICAL SCREEN is''' °
'''completed, the block can be transferred to the "visible" or PHYSICA °
XL''' '''SCREEN.''' 'do' 'T╜ÉSVR■''C124'' ''D124''' 'TEACH1A' 'end' °
*(1996 6 16 12 31 11 368) °
FTEACH10 ÉFX 'TEACH10;T;C124;D124' 'Σ Miscellaneous Commands' °
'''RETRIEVING POSTED DATA'',r' 'T╜124 SVOFFER ''C124'' ''D124''' °
'FLDS╜π(1 1 5 10 0 2)(1 1 1 7 0 64)(2 1 2 7 0 174) ╪ D124╜FLDS' °
'C124╜14 0 70 4 8 ╪ test' °
'C124╜1 ╪ test ╪ D124╜π''FIELD 2'' ''FIELD 3'' ╪ C124╜4 2 3 ╪ test' °
'''RETRIEVING DATA FROM THE PHYSICAL SCREEN'',r' °
'''In this example the two fields are labelled "FIELD 1" and "FIELD 2" °
.''' '''Press ENTER, before clicking on the Session Monitor'',r' °
'C124╜3 ╪ test ╪ T╜D124' 'do' °
'''We have seen how windows and data can be placed on the physical''' °
'''screen. We also need a way to retrieve data that may have been''' °
'''entered by the user. There are three commands to do that:''' °
'''"C124╜10 1" will return in D124 the logical screen as a character'' °
' '''array'',r' 'show ''C124╜10 1 ╪ test ╪ µD124''' °
'''Commands 5 and 15 allow the retrieval of data from selected fields. °
''' °
'''The first command (5) will return the data as a simple array, one'' °
' °
'''row for each field. The second command (15) will return the data as °
''' '''a nested vector. The field elements retain their shape.'',r' °
'show ''C124╜5 2 3 ╪ test ╪ DISPLAY D124''' °
'show ''C124╜15 2 3 ╪ test ╪ DISPLAY D124''' °
'''MISCELLANEOUS COMMANDS'',r' °
'''There are several additional commands that can be used with AP 124. °
''' '''We will list these, but give only brief examples on some.''' °
'do' °
'''"C124╜8,n" allows switching between APL2 and National Keyboard'',r' °
'''SET ACTION''' '''8 Set to APL2 keyboard''' °
'''8 0 Same as 8''' '''8 1 Set to National Keyboard''' °
'''8 2 Return Status (we have seen this in action already)'',r' °
'''The results of the operation are returned in D124''' °
'show ''C124╜8 2 ╪ test ╪ D124''' °
'''Only the first, fourth and last values have meaning:'',r' °
''' D124[1]= Keyboard status (1=APL2)''' °
''' D124[4]= Beep request on or off''' °
''' D124[6]= Cursor mode (0=normal, 1=field)''' 'do' °
'''"C124╜11" controls the beep. There are three options: 0=delayed bee °
p,''' °
''' 1=immediate beep, 2=cancel previous delayed beep.'',r' °
'show ''C124╜11 1 ╪ test''' °
'''Finally, "C124╜17,n" returns a character matrix containing the''' °
'''attribute characters of each position in the field'',r' °
'show ''FLDS[;6] ╪ C124╜17 1 2 3 ╪ test ╪ DISPLAY D124''' °
'''There is more to this Auxilliary processor. We have not covered''' °
'''various options under commands 1 and 3. You may wish to examine''' °
'''the APL2 functions in workspaces 2 AP124 and 2 DEMO124.'',r' °
'''Nothing was said about the graphics modes. Quite frankly, it is''' °
'''not clear precisely how that is to be used. You are certainly''' °
X '''encouraged to experiment with these and other modes.''' 'end' °
*(1996 6 7 12 39 2 328) °
FTEACH1A ÉFX 'TEACH1A;Cfs;Dfs' 'Σ Functions from the AP124 workspace' °
'''THE AP124 WORKSPACE'',r' °
'''We have used function SVOFFER to illustrate how to activate this''' °
'''auxilliary processor. There is a workspace named AP124 in library 2 °
''' °
'''that contains a number of useful functions. (Their name is of the'' °
' °
'''form "FS..."). We will illustrate these utilities at the same time' °
'' '''as we discuss various features of AP 124.'',r' °
'''For example, instead of using SVOFFER, there is FSOPEN which does'' °
' °
'''the same thing as the expression: 124 SVOFFER ''''Cfs'''' ''''Dfs'' °
''''' °
'''(Note the different labels for the "control" and "data" variables.) °
'',r' °
'''Function FSOPEN does one additional thing. It invokes the control'' °
' °
'''variable Cfs with command 9 (as above) and stores the screen column °
''' '''and row integers in the global variable "fss".'',r' °
'show ''FSOPEN'' ''fss''' °
'''Note that FSOPEN is a niladic function that returns the RETURN CODE °
.''' °
'''There is also function FSCLOSE to retract AP 124 and delete all''' °
'''variables created by utility functions "FS..." (exception: "fsf").' °
X',r' 'show ''FSCLOSE'' ''ÉNC ''''fss''''''' °
*(1996 6 13 13 34 1 332) °
FTEACH2 ÉFX 'TEACH2;C124;D124' 'Σ A P 124' °
'''To understand how AP 124 works, we must describe the COMMANDS that °
can be''' °
'''given to the CONTROL variable, and the data (if any) that can be as °
signed''' °
'''to (or extracted from) the DATA variable. The commands to the contr °
ol''' '''are numeric integers (or integer vectors).''' 'do' °
'''THE AP 124 COMMANDS'',r' '''SCREEN MODE'',r' °
'T╜124 SVOFFER ''C124'' ''D124''' °
'''Before we begin building the logical screen, we must be able to''' °
'''erase its contents and to define its nature. The commands to do the °
se''' °
'''things are issued when the first digit assigned to C124 is a zero'' °
' '''(We will continue to use "C124" and "D124" in the examples.)'',r' °
'show ''C124╜0''' °
'''This first expression erases the contents of both the logical and'' °
' '''the physical screen.'',r' 'show ''C124''' °
'''The reference to C124 gives the RETURN CODE of the action just take °
n.''' '''A zero return code means success.''' 'do' °
'''TESTING THE RETURN CODE'',r' °
'''We will invoke function "test". This function will be used''' °
'''to test the return code by issuing the control variable C124.'',r' °
'showfn ''test''' °
'r,''If the return code is a 0, "test" exits; else "test" prints out'' °
X' '''the return code and aborts the lesson''' 'end' °
*(1996 6 13 13 38 45 524) °
FTEACH3 ÉFX 'TEACH3;D;T;C124;D124' 'Σ Manipulating a physical screen' °
'''MANIPULATING THE SCREEN'',r' °
'''Before we begin studying the commands that generate windows''' °
'''using AP124, it is useful to practice manipulating a graphic''' °
'''window. The techniques are essentially those you use in OS2.'',r' °
'''FIRST EXERCISE'',r' °
'''The initial window of this lesson will appear when you press Enter. °
''' °
'''As the window appears, note that the prompt is changed into a QUAD' °
'' °
'''PLACE THE MOUSE POINTER ON THIS QUAD and click the left button.''' °
'''(actually anywhere on the APL2 session window will do)''' 'do' °
'T╜124 SVOFFER ''D124'' ''C124''' °
'D╜4 6µ1 1 1 2000 2 7 10 5 10 25 2 31 2 45 20 4 2 79 17 20 4 50 2 127' °
'D124╜D' 'C124╜1' 'D124╜10µ''x'' ╪ C124╜2 1' °
'D124╜1 51µ''THE FULL SCREEN MANAGEMENT AUXILLIARY PROCESSOR 124''' °
'C124╜21 1' °
'D124╜''Click on the QUAD in the Session Manager screen''' 'C124╜2 1' °
'D124╜(4 1µ'' '') ╪ C124╜2 1 2 3 4 ╪ test' 'do' °
'''SECOND EXERCISE'',r' °
'''The window has now been defined in the LOGICAL screen. Press Ctrl'' °
' '''and at the same time Esc. This will cause the display of the''' °
'''WINDOW LIST. When you double click on the line labelled AP124,''' °
'''the contents of the LOGICAL screen will be displayed on your''' °
'''PHYSICAL screen. Again click on the QUAD.''' 'do' °
'''THIRD EXERCISE '',r' °
'''Select the AP124 window again (Ctrl-Esc and AP124). This time''' °
'''place the mouse cursor at the edges of the AP124 window and change' °
'' °
'''its size. Then place the mouse cursor on the header and move the''' °
'''window around while pressing the left button''' 'do' °
'''You should be able now to display the logical window when asked''' °
'''to do so. Also you should be able to move the window out of the''' °
X '''way so you can read the instructions.''' 'end' °
*(1996 6 13 13 50 42 560) °
FTEACH4 ÉFX 'TEACH4;A;T;FL;C124;D124' 'Σ Format screen into fields' °
'T╜124 SVOFFER ''C124'' ''D124''' '''FIELDS'',r' °
'''The rectangular blocks seen on the starting panel are called "FIELD °
S".''' °
'''The location, size, color and other properties of these fields are' °
'' '''defined with the following sequence:'',r' °
'show ''FL╜2 6µ10 12 1 15 2 64 15 12 1 15 2 96 ╪ D124╜FL ╪ C124╜1 ╪ te °
st''' °
'''The first expression defines FL, a numeric array containing six col °
umns''' °
'''of integers. The second expression assigns this array to the shared °
''' °
'''variable D124. (We could have assigned the data directly to D124,'' °
' '''but the array is often manipulated separately.)'',r' °
'''The third expression is a command to initiate formatting of the''' °
'''logical screen. We then ask for the return code to verify the succe °
ss.''' 'do' 'show ''A╜π''''FIELDS'''' («FL[1;]) ╪ DISPLAY A''' °
'''Character array A contains data we want to store in the two fields' °
',r' 'show ''D124╜A ╪ C124╜4 1 2 ╪ test''' °
'''Before we display the two fields, we write the word "FIELDS" into'' °
' °
'''the first one. Into the second field we write the format of the''' °
'''first field. Note the sequence. D124 is assigned a character array' °
'' °
'''containing the data to be displayed. C124 is then assigned the code °
''' °
'''(4) to write data to the logical screen -- first row to field 1 and °
''' '''the second row to field 2.'',r' °
'''When you press Enter after this paragraph you will see another set' °
'' °
'''of commands that cause the window to appear. Code (3 2) signals''' °
'''the physical screen to be displayed. Next the return code is tested °
.''' '''Finally the contents of D124 is stored and displayed in T''' °
'do' 'show ''C124╜3 2 ╪ test ╪ T╜D124 ╪ T''' °
'''Note that the character string FIELDS has been transferred to the'' °
' '''first field defined in variable A. The second field contains''' °
'''the numeric values that define the first field.'',r' °
'''Since you did not close the physical screen, it is still minimized. °
''' °
'''Click on the Window list and double click on the AP124 line. Then'' °
' '''close the physical screen by double clicking on its upper left''' °
'''hand corner.''' 'do' °
'''Although the physical screen has disappeared (try Ctrl-Esc), the''' °
'''shared variables are still active, and so is the logical screen.'', °
r' 'show ''ÉSVO■ ''''C124'''' ''''D124''''''' °
'''Let us now see what the six integers of the numeric array mean'',r' °
'''COLUMN CONTENTS''' ''' 1 Start row of the field''' °
''' 2 Start column of the field''' °
''' 3 Number of rows in the field (field height)''' °
''' 4 Number of columns in the field (field length)''' °
''' 5 Type of field (input/output/numeric/character)''' °
''' 6 Field attributes (colors,intensity,blinking)'',r' 'do' °
'''You might have recognized these data. They have the same meaning''' °
'''as the initial format of the logical screen. Before we go into''' °
'''specifics of columns 5 and 6, let us first study how fields can be' °
'' '''changed.'',r' °
'show ''É╜FL╜2 6µ10 12 1 15 2 64 15 12 1 15 2 64 ╪ D124╜FL ╪ C124╜1 ╪ °
test''' °
'''We have now defined two rows in array FL, and assigned this new''' °
'''array to D124. The two rows of FL are identical, except for the''' °
'''first column. Field 1 starts at screen row 10. Field 2 at row 15.'' °
' 'do' 'show ''D124╜«FL ╪ C124╜2 1 2 ╪ test''' °
'''This time we used command (2) instead of (4). The assignment to''' °
'''C124 (2 1 2) causes the contents of FL to be written immediately''' °
'''to both the logical and physical screen.''' 'do' °
'''Now let us see what happens if we change the contents of one of''' °
'''the fields'',r' °
'show ''FL[2;3 6]╜2 32 ╪ D124╜FL[2;] ╪ C124╜1 2 ╪ test''' °
'''This time when we issued command 1, we added field number 2 so''' °
'''that the pre-existing definition of this field should be changed.' °
'' °
'''UNFORTUNATELY ON MY VERSION OF APL2OS2 THIS HAS NO EFFECT !???'',r' °
'show ''D124╜«FL ╪ C124╜2 1 2 ╪ test''' °
'''Command (2) however seems to have produced the desired effect.''' °
'''You can display the physical screen now to see the result.''' 'do' °
'''In summary, we studied four commands: 1 4 and 3''' °
'''Command 1 (with no arguments) defines fields as defined in D124.''' °
'''Command 4 (with field numbers) stores data in the specified fields. °
''' °
'''Command 2 is the same as command 4, but the effect is immediate.'' °
' °
'''Command 3 (with code giving mode of return to APL2) displays fields °
X.''' 'end' °
*(1996 6 13 13 56 30 536) °
FTEACH5 ÉFX 'TEACH5;FLDS;C124;D124;T' °
'Σ Formatting screen into fields (continued)' °
'T╜124 SVOFFER ''C124'' ''D124''' °
'show ''FLDS╜2 6µ10 12 1 7 2 64 15 15 2 7 2 32 ╪ D124╜FLDS ╪ C124╜1''' °
'''Since command 2 appears to be crucial to the usage of AP124, we wil °
l''' '''review its syntax once more:'',r' °
'''ENTERING DATA INTO A FIELD'',r' °
'''In the previous examples we have seen how one can define rectangula °
r''' °
'''blocks called fields. For most applications one not only wants to'' °
' °
'''highlight these areas, but also enter alpha numeric information. Th °
is''' °
'''can be accomplished with command "C124╜2,n". Let us place in the fi °
rst''' '''field the label "Field 1" .'',r' °
'show ''FLDS'' ''D124╜1 7µ''''Field 1'''''' ''C124╜2 1 ╪ test''' °
'''Since the first field is a block of dimension 1⌡7, we assigned a''' °
'''character array of that dimension to D124. Then we issued a command °
''' °
'''to C124. The first digit (2) tells to place data in D124 in the fie °
ld''' °
'''specified by the second digit (1). The return code verifies that al °
l''' '''went as expected.'',r' °
'''We can see that the first field contains the assigned text. Next, t °
o''' °
'''place data in the second field, we must again assign text to D124'' °
,r' °
'show ''DISPLAY D124╜2 7µ''''Color GREEN'''''' ''C124╜2 2 ╪ test''' °
'''And again by selecting AP124 on the Window list, we verify that the °
''' '''second field does indeed now contains that information.''' °
X 'end' °
*(1996 6 13 13 7 20 300) °
FTEACH6 ÉFX 'TEACH6;T;C124;D124' 'T╜124 SVOFFER ''C124'' ''D124''' °
'FLDS╜2 6µ10 12 1 7 2 64 15 15 2 7 2 32' 'D124╜FLDS' 'C124╜1' °
'''CHANGING THE DISPLAY ATTRIBUTES OF FIELDS'',r' °
'''Column five of the display attribute table defines the FIELD TYPE.' °
'' °
'''We will return to this later, since it''''s usage requires addition °
al''' '''control commands.'',r' °
'''Column six of the display attribute table defines the color of text °
''' '''(foreground) and of the field (background). The number is a''' °
'''composition of 8 bits representing (from left to right) the''' °
'''following features'',r' '''BIT # MEANING''' °
''' 1-4 Background color (field) (0 to 15)''' °
''' 5-8 Foreground color (text) (0 to 15)'',r' 'do' °
'''Background color is the color of the field. In our example red for' °
'' °
'''field 1 and green for field 2. The foreground color is that of text °
.''' '''(In our example the text color was black.)'',r' °
'show ''FLDS''' °
'''The bit pattern, is stored in column 6 as an integer.''' °
'''Since setting up of these display attributes requires bit conversio °
ns,''' °
'''it is useful to have some utility functions. Function COLORS lists °
the''' °
'''available colors, then prompts for the desired ones. It returns the °
''' °
'''numeric "color field attribute" (an integer 0-255). In the followin °
g''' '''example, try for a black text and a red background:'',r' °
'show ''COLORS''' °
'''If you entered a 1 for color of text and a 5 for the color of the'' °
X' '''field, COLORS should have returned a 64.''' 'end' °
*(1996 6 13 14 17 53 476) °
FTEACH7 ÉFX 'TEACH7;T;C124;D124;FLDS' 'Σ Entering and retrieving data' °
'T╜124 SVOFFER ''C124'' ''D124''' °
'FLDS╜3 6µ1 1 20 70 2 150 10 12 1 17 2 64 15 15 2 25 2 32' °
'''INTERACTING WITH THE PHYSICAL SCREEN'',r' °
'''In this section we will describe some of the AP 124 commands.''' °
'''The process of creating a logical screen is fairly simple, but''' °
'''it does require a certain sequence of steps that may not be''' °
'''obvious from a mere reading of the User Manual.'',r' °
'''We begin by clearing the screen and by formatting it'',r' °
'show ''C124╜0'' ''FLDS'' ''D124╜FLDS ╪ C124╜1 ╪ test''' °
'''We have defined three fields. Field 1 represents the window.''' °
'''Fields 2 and 3 are boxes within the window.'',r' °
'''So far we have repeated the sequence that we already discussed''' °
'''earlier. At this point we could verify the format of the "logical'' °
' '''screen" by issuing command 9'',r' °
'show ''C124╜9 ╪ T╜D124 ╪ test ╪ T''' 'TEACH7A' °
'''We are now ready to display the window. This is done with the''' °
'''"Read and Wait" (or "Read and Test") command 3. We will issue''' °
'''3 2 which stands for the return to APL2 whenever ANY key is''' °
'''pressed. You will notice that having pressed a key, the window''' °
'''remains open, but the cursor (a quad) will blink on the APL2''' °
'''screen (you may have to move the physical screen out of the way).'' °
' 'show ''C124╜3 2 ╪ T╜D124 ╪ test ╪ T''' °
'''To actually return to APL2, and make the physical screen to''' °
X '''disappear you had to click on the QUAD.''' 'end' °
*(1996 6 13 14 2 46 388) °
FTEACH7A ÉFX 'TEACH7A;TEXT' 'Σ Entering and retrieving data' °
'''We can now specify some window parameters. For example, the''' °
'''command C124╜14,[arg] sets the window background color or its''' °
'''size and placement. The following options are available:'',r' °
'''Argument Meaning''' '''²²²²²²²²²²²²²²²²²''' °
''' empty D124 returns background color,row,column,height,width''' °
'''[16⌡1-16] Sets the color of the screen background''' °
''' 4µn Sets the window size (row,column,height,width)'',r' °
'''For illustration, we will set background color to 16⌡9 (light''' °
'''blue) and place the upper left hand corner of the window at row 12' °
'' °
'''column 6. We also size the window to have 16 rows and 60 columns.'' °
,r' 'show ''C124╜14 144 ╪ test ╪ C124╜14 4 6 16 60 ╪ test''' °
'''We can verify this using command 14 with no argument'',r' °
'show ''C124╜14 ╪ D124 ╪ test''' °
'''This definition of window place and size takes precedence over''' °
'''row 1 of of array FLDS.'',r' °
'''Next we we want to place some text in the windows. To do that, we'' °
' '''will invoke command 4. This "Delayed Write of Data to Screen"''' °
'''affects only the logical screen. This command takes the array''' °
'''of character data in D124 and places it in as many numbered fields' °
'' '''as there are rows in the array.'',r' °
'show ''D124╜''''Explanations can be placed here'''' ╪ C124╜4 1 ╪ test °
''' '''The Delayed Write places the text into field 1.'',r' °
'TEXT╜π''WINDOW 2'' ''WINDOW 3''' °
'''We can also enter some text into windows 2 and 3:''' °
'show ''DISPLAY TEXT'' ''D124╜TEXT ╪ C124╜4 2 3 ╪ test''' °
'''The text in array TEXT is placed in fields 2 and 3.'',r' °
'''Note that had we entered text in field 1 last, the text in fields'' °
' '''2 and 3 would have been erased'',r' °
'''We should also place the cursor at a specific location of a field,' °
'' '''say field 1 row 2 column 3. this is done with command 12'',r' °
'show ''D124╜1 2 3 ╪ C124╜12 ╪ test''' °
'''Finally we might also place a title on the window title bar.''' °
'''The command for doing that is 21 1'',r' °
'show ''D124╜''''THIS IS THE SAMPLE TITLE'''' ╪ C124╜21 1 ╪ test''' °
X '' '' °
*(1996 6 15 19 26 35 468) °
FTEACH8 ÉFX 'TEACH8;T;FLDS;C124;D124' 'Σ Additional commands to C124' °
'T╜124 SVOFFER ''C124'' ''D124''' °
'FLDS╜2 6µ10 12 1 7 2 64 15 15 2 7 2 32' 'D124╜FLDS' 'C124╜1 ╪ test' °
'FLDS ╪ D124╜FLDS ╪ C124╜1 ╪ test' °
'D124╜''SAMPLE'' ╪ C124╜21 1 ╪ test' °
'''SETTING WINDOW SIZE AND PLACEMENT'',r' °
'''Command 14 gives you the control of the location of the physical''' °
'''window. In the following example, the upper left corner of the wind °
ow''' °
'''will be placed in row 1 and in column 79 of the Session Manager''' °
'''its shape will be 16 rows and 30 columns. (Actually the top of the' °
'' °
'''physical screen will be on row 3 of the Session Manager screen.)''' °
'''Why? Ask IBM!''' °
'show ''C124╜14 1 79 16 30 ╪ test ╪ C124╜3 2 ╪ test ╪ D124''' °
'''D124 returned an integer vector. The ²1 ²1 means that by using a''' °
'''3 2 command, you did not have to press any key to return to APL2.'' °
' '''The following zero (0) means that the cursor was found in an''' °
'''undefined field, and the 1 1 tells that cursor to be in row 1,''' °
'''column 1.''' 'do' '''MOVING THE CURSOR ON THE PHYSICAL SCREEN'',r' °
'''At the next pause try to move the cursor using the ARROW keys. You °
can''' °
'''do that now, because the assignment to C124╜3 0 allows interactive' °
'' °
'''input. If, however, you try to enter data, you will hear a beep.'', °
r' °
'''BEFORE YOU CLICK ON THE QUAD IN THE SESSION MANAGER, DO THE FOLLOWI °
NG:''' °
'''Using the arrow keys, move the cursor inside the window to the''' °
'''second (green) field (COL 1 ROW 3), and then press the HOME key.''' °
'''THEN you may click on the quad in the Session Manager window'',r' °
'show ''D124╜1 7µ''''FIELD 1'''' ╪ C124╜2 1 ╪ C124╜3 ╪ test ╪ D124''' °
'''If you have followed these instructions, the contents of D124 is''' °
'''the vector 6 1 2 1 3. The home key corresponds to 6 1, the field''' °
'''number is 2, and the row and column numbers (1 3) show the last''' °
'''position of the cursor.'',r' °
'''WARNING! THE BEHAVIOR MAY NOT BE AS EXPECTED IF YOU DO NOT FOLLOW'' °
X' ''' INSTRUCTIONS EXACTLY''' 'end' °
*(1996 6 15 19 49 12 468) °
FTEACH9 ÉFX 'TEACH9;T;FLDS;C124;D124' 'Σ Additional commands to C124' °
'T╜124 SVOFFER ''C124'' ''D124''' °
'FLDS╜2 6µ10 12 1 7 2 64 15 15 2 7 2 32' 'D124╜FLDS' 'C124╜1' °
'''We will now define two small fields in a new window. (You should''' °
'''be able to recognize the meaning of the following commands.)''' °
'''Note, however, that command 3 0 requires you to press first one''' °
'''of the special "gray" keys such as Enter, Home or End. Until you''' °
'''do so, the screen wil remain locked up.'',r' °
'D124╜FLDS ╪ C124╜1 ╪ test' °
'D124╜''SAMPLE'' ╪ C124╜21 1 ╪ test ╪ C124╜14 0 79 16 30 ╪ test' °
'show ''D124╜1 7µ''''FIELD 1'''' ╪ C124╜2 1 ╪ test ╪ C124╜3 0 ╪ test ╪ °
D124''' '''MOVING THE CURSOR TO A FIELD'',r' °
'''Notice that the cursor is in the upper left corner of the window.'' °
' °
'''If we want to move this cursor to field one we have to specify the' °
'' '''command 12 as follows'',r' °
'show ''D124╜2 1 3 ╪ C124╜12 ╪ test''' °
'''We have placed the cursor in field 2, row 1, column 3''' 'do' °
'''CHANGING CHARACTERISTICS OF A FIELD'',r' °
'''Commands "C124╜6,n" and "C124╜7,n" allow changing the nature of''' °
'''existing fields.'',r' °
'''C124╜6,n can be used to change the field type. For example, the two °
''' °
'''field types are now defined as output only (col. 5 of array FLDS is °
2)''' °
'''To verify this, double click on the SAMPLE line of the Window list' °
'' °
'''and try to move the cursor. It should not respond. Now press Enter! °
''' 'do' '''We can re-define the field types with'',r' °
'show ''D124╜0 1 ╪ C124╜6 1 2 ╪ test''' °
'''D124 re defines the first named field as input/output (0), and the' °
'' °
'''second field as numeric input and selectable (i.e. reverse video)'' °
' '''as output (1). The C124 6 1 2 specifies the first field to be''' °
'''associated with the 0 of D124, and the second field with the (1).'' °
,r' °
'''Now double click again on SAMPLE from the window list, and move the °
''' °
'''cursor to the first field. Enter there some characters. Then move t °
he''' °
'''cursor to row 1 column 1 of the green field and enter a two digit'' °
' '''number. Then press Enter'',r' 'show ''C124╜3 ╪ test ╪ D124''' °
'''If you have done as asked, D124 should have returned 0 0 2 1 3 1 2' °
'' '''Look up on pages 184-185 for the meaning of this vector.''' 'do' °
'''C124╜7,n can be used to change the field attributes'',r' °
'show ''D124╜146 ╪ C124╜7 1 2 ╪ test''' °
'''We have changed the color of both fields.''' °
'show ''C124╜3 ╪ test ╪ D124''' °
'''We can also change the color of individual elements of a single''' °
'''field'',r' 'show ''D124╜44 65 37 123 59 210 233╪ C124╜7 1''' °
'''Now take a final look at this SAMPLE window''' °
X 'show ''C124╜3 ╪ test ╪ D124''' 'end' °
XCa 0 % °
*(1992 1 14 9 44 42 488) °
Faddquote ÉFX 'u╜addquote w' °
'Σ Put quotes around a string, and double existing quotes' °
X 'u╜ÉAV[40],((1+w=ÉAV[40])/w),ÉAV[40]' °
*(1992 1 14 9 44 42 488) °
XFaq ÉFX 'u╜aq w' 'Σ Enclose quoted string' 'u╜Γaddquote w' °
*(1992 1 14 9 44 42 488) °
Fav ÉFX 'av;a;n;i;ÉIO' 'Σ Display characters in the Atomic vector' °
'ÉIO╜0' 'a╜22 78µ'' ''' 'n╜3 0«φ12 22µ1+∞256' °
'a[;,(6⌡∞12)°.+2 3 4]╜n' 'a[;6+6⌡∞12]╜φ12 22µÉAV' °
X 'a[7 8 10 13;6]╜'' ''' 'a[14+∞8;68 69 70 72]╜'' ''' 'a' °
Acolors╜('BLACK')('DBLUE')('DGREEN')('DCYAN')('DRED')('DMAGENTA')('BROW °
N')('GRAY')('DGRAY')('BLUE')('GREEN')('CYAN')('RED')('MAGENTA')('YELLOW °
X')('WHITE') °
*(1996 4 7 14 15 40 384) °
Fcopyright ÉFX 'copyright' 'Σ Copyright statement' °
'(10µ'' ''),''Copyright, Z. V. Jizba, 1995'',r' °
'''To see disclaimers, enter ÉCR ''''copyright''''''' 'do' '╕0' °
'''This and subsequent workspaces labelled TEACHxx are made available' °
'' °
'''at no cost to anyone who desires to learn how to use effectively''' °
'''the IBM/OS2 version of APL2.'',r' °
'''This software is provided "AS IS" with no WARRANTY of any kind, eit °
her''' °
'''express or implied. Any risk in its use resides with you, the user °
Xof''' '''these tutorials.''' '''(PRESS ENTER to continue)''' °
XCd 0 " °
*(1992 1 14 9 44 44 496) °
Fdate ÉFX 'u╜date w' 'Σ Format date and time of day' 'u╜«6╞w' °
X 'u╜('' ''⌠u)Γu' 'u╜εu,■''-- .. ''' °
XCdig 1 10 1234567890 °
*(1992 1 14 9 44 41 484) °
Fdo ÉFX 'do;t;e;b' 'Σ Expression driver' 'e╜''''' 'æ╜'' ''' 't╜æ' °
'╕(^/'' ''=t)/0' °
'╕(('':''εt)doif ''b╜evaldd (+/^\'''' ''''=t)╟t'')/2' °
'''e╜ÉEM'' ÉEA t' '╕(0=µ,e)/2' °
'''This is not a valid APL2 expression''' 'æ╜''*''' '╕(''?''⌠╞1╟æ)/2' °
X 'e' '╕2' °
*(1991 11 11 8 26 34 404) °
Fdoif ÉFX 'U╢╜V╢ doif W╢;t╢' 'Σ Rule' '╕(^/~U╢╜V╢)/0' °
X '''U╢╜V╢ doif■ W╢'' ÉEA ''»V╢/W╢''' °
XNdos 0 ²26 °
XCe 1 0 °
*(1996 3 31 14 34 39 548) °
Fend ÉFX 'end' '''²²''' 'e╜''''' 'æ╜'' ''' 't╜æ' '╕(^/'' ''=t)/0' °
'╕(('':''εt)doif ''b╜evaldd (+/^\'''' ''''=t)╟t'')/3' °
'''e╜ÉEM'' ÉEA t' '╕(0=µ,e)/0' °
'''This is not a valid APL2 expression''' 'æ╜''*''' '╕(''?''⌠╞1╟æ)/0' °
X 'e' °
*(1992 1 14 9 44 42 488) °
XFendd ÉFX 'endd' 'Σ End of document' '20µ''²''' 'do' °
*(1995 12 10 14 37 48 544) °
Ferase ÉFX 'erase;t;DISPLAY;DOS;GO;COLORS;ATT;ATTS;SVOFFER' 't╜ÉNL 3' °
't╜(~t^.εlc,'' '')≡t' 't╜(~t[;∞2]^.=''FS'')≡t' °
't╜ÉEX(~t[;∞5]^.=''TEACH'')≡t' 't╜ÉNL 2' 't╜ÉEX(~t^.εlc,'' '')≡t' °
X 't╜ÉNL 4' 't╜ÉEX(~t^.εlc,'' '')≡t' °
*(1992 1 14 9 44 43 492) °
Fevaldd ÉFX 'u╜evaldd w;c;n' °
'Σ Evaluate a direct definition expression' 'u╜0' 'n╜(w∞''Σ'')-1' °
'c╜(((n╞w)⌠'':'')Γn╞w),Γ''ΣDD '',(n+1)╟w' '╕(label╞c)/0' °
'╕((2=µc)doif ''u╜showdd 1╙c'')/0' °
'╕((3=ÉNC╞c)doif ''u╜⌡µÉ╜(╞c),'''' is already defined.'''''')/0' °
'╕((3=µc)doif ''u╜simdd c'')/0' 'c╜(Γ''α∙ aw'')replace■c' °
'u╜ε''u╜'',((''a''εεc[2 3 4])/''a ''),(╞c),'' w;t;b''' °
'u╜u(5πc)(''b╜(t╜'',(3πc),'')/'',addquote ''u╜'',4πc)' °
X 'u╜u,''╕(t doif b)/0''(''u╜'',2πc)' 'u╜╧ÉFX u' °
*(1992 1 14 9 44 43 492) °
Fexit ÉFX 'exit w' 'Σ Exit if there are too many suspended functions' °
X '╕((10>µÉLC)doif ''w'')/0' '''Please re-enter '',w' '╕' °
XCf 1 2 { °
Afonts╜('GOTENG')('GOTGER')('GOTITA')('GRESER')('GRESIM')('MARKERS')('M °
ODSIM')('ROMDUP')('ROMDUPF')('ROMITA')('ROMITAB')('ROMSER')('ROMSERB')( °
'ROMSIM')('ROMSIMM')('SANSER')('SANSERF')('SCRIPT')('THKRNDF')('THKRNDO °
X')('THKSQUF')('THKSQUO') °
XCfpath 1 12 C:\APL2\AVF\ °
XCg 1 2 } °
*(1995 12 18 15 37 48 580) °
Fget ÉFX 'u╜v get w;t;ÉPR' 'Σ Prompt for response from keyboard' °
't╜(0=ÉNC ''V'')doif ''V╜1'' ╪ ÉPR╜''''' 'w╜w,(~²1╞v)/'': ''' °
'L0:æ╜w' 't╜æ' '╕((''╕''=(µw)╟t)doif ''╕'')/0' '╕(^/'' ''=w)/L1' °
'╕((~w╧(µw)╞t)doif ''''''PLEASE DO NOT BACKSPACE'''''')/L0' °
't╜(µw)╟t' 'L1:u╜(²1+(,'' ''⌠t)∞1)╟t' '╕(1╞v)/0' 't╜(u⌠'' '')Γu' °
X 'u╜(µt),(Γu),t' °
*(1991 11 11 8 25 11 308) °
Fglobals ÉFX 'globals' 'Σ Initialize useful global variables' 'r╜2╙ÉTC' °
'q╜40╙ÉAV' 's╜Φp╜'' '',d╜35╙ÉAV' 'uc╜''ABCDEFGHIJKLMNOPQRSTUVWXYZ''' °
'lc╜''abcdefghijklmnopqrstuvwxyz''' 'dig╜''1234567890''' °
X 'g╜'' '',h╜126╙ÉAV' 'f╜ÉAV[33 124]' 'a╜38╙ÉAV' °
XCh 0 } °
*(1992 8 10 10 44 11 380) °
Findex ÉFX 'U╜V index W;A;C;H;I;T' 'Σ List contents of an AP 211 file' °
'T╜~(1<╧W)doif ''H╜2πW'' ''W╜1πW''' 'T╜T doif ''H╜''''FUNCTION''''''' °
'T╜(ΓW)ε''DOCS'' ''UTILITY'' ''HELP'' ''TUTOR''' °
'T╜T doif ''W╜path,W,''''.211''''''' '1 OPEN 211' 'D211╜''USE'' W' °
'''File '',W,'' has record length='',1╟D211' °
'D211╜''LIST'' ''NAMES''' 'U╜D211' °
'╕((0=╧U)doif ''U╜''''Unknown file'''''')/0' 'C╜1╟µU╜U[I╜ÉAV√U;]' °
'╕((0=ÉNC ''V'')doif ''CLOSE 211'')/0' 'U╜(C╞H),[1]ul,[1]U' °
'╕((0=1╞V)doif ''U╜0 0 2 tab U'' ''CLOSE 211'')/0' °
'D211╜''LIST'' ''ATTS''' 'A╜D211' °
'A╜(''SZ'' ''ID'' ''DATE'' ''mo'' ''d'' ''TIME'' ''m'' ''s'' ''ms''),[ °
1]ul,[1]A[I;]' 'V╜(Vε0,(∞9),-∞9)/V' 'U╜U,«A[;(0⌠V)/|V]' °
'╕((0εV)doif ''CLOSE 211'')/0' °
'T╜~(0<╛/V)doif ''U╜U[∞2;],[1](2 0╟U)[√(2 0╟A)[;|V];]''' °
'T╜T doif ''U╜U[∞2;],[1](2 0╟U)[ⁿ(2 0╟A)[;|V];]''' 'T╜ÉDL 1' °
X 'CLOSE 211' °
*(1991 11 11 8 25 12 312) °
Finitialize ÉFX 'initialize;t' 'Σ Initialize workspace' 'erase' °
X 'globals' °
*(1992 1 14 9 44 41 484) °
Fkeys ÉFX 'keys' 'Σ Display keyboard' °
''' 1 2 3 4 5 6 7 8 9 0 + ⌡''' °
'''SHFT ╒ ■ ² < ≤ = ≥ > ⌠ δ ^ - ÷''' °
'''ALT ╘ ƒ · ⁿ √ Φ φ Θ ╡ τ σ ! Æ''' '''''' °
''' Q W E R T Y U I O P ╜ ╙ ╧''' °
'''SHFT ? ∙ ε µ ~ ╞ ╟ ∞ Ω * ╕ ╨ ╤''' °
'''ALT q w e r t y u i o p æ ≈ ╥''' °
'''CTRL ┌ ┬ ┐ ╔ ╦ ╗''' '''''' °
''' A S D F G H J K L [ ]''' °
'''SHFT α ⌐ ╛ _ ╖ ╢ ° '''' É ( )''' °
'''ALT a s d f g h j k l » «''' °
'''CTRL ├ ┼ ┤ ─ ═ ╠ ╬ ╣''' '''''' °
''' Z X C V B N M , . /''' °
'''SHFT Γ π ∩ ¼ ¥ ÿ | ; : \''' °
'''ALT z x c v b n m Σ ± ≡''' °
'''CTRL └ ┴ ┘ │ ║ ╚ ╩ ╝''' '''''' °
X '''Toggle switch to ASCII is CTL-BACKSPACE''' '''CTRL+G gives beep''' °
*(1992 1 14 9 44 43 492) °
Flabel ÉFX 'u╜label w' °
'Σ Return 1 if w is not a valid character string label (also excludes °
Xl.c.)' '╕(u╜(1<µµw)δ1<╧w)/0' '╕(u╜~^/wεlc,uc,dig)/0' 'u╜w[1]εlc,dig' °
XClc 1 26 abcdefghijklmnopqrstuvwxyz °
Nmodes 2 9 10 4 320 200 4 8 1 70 19 200 222 5 320 200 4 8 1 70 19 200 °
222 6 640 200 2 8 1 70 19 100 222 13 320 200 16 8 1 70 19 200 222 14 °
640 200 16 8 1 70 19 100 222 15 640 350 4 8 1 70 19 100 127 16 640 350 °
16 8 1 70 19 100 127 17 640 480 2 8 1 70 19 100 98 18 640 480 16 8 1 °
X 70 19 100 98 °
*(1992 1 14 9 44 44 496) °
Fnon ÉFX 'non;t;rc;et;r' °
'Σ Ignore invalid keyboard entries, but evaluate valid APL2 expression °
s' 'æ╜'' ''' 't╜æ' '╕(0=µ(t⌠'' '')/t)/0' '(rc et r)╜ÉEC t' °
X '╕(0=rc)/2' '╕((1=rc)doif ''r'')/2' '╕2' °
*(1992 1 14 9 44 43 492) °
Fnotb ÉFX 'u╜notb w' 'Σ Remove trailing blanks' °
'╕((1<╧w)doif ''u╜notb■ w'')/0' '╕((1<µµw)doif ''u╜πnotb Γ[2]w'')/0' °
X 'u╜(1-(,'' ''⌠Φw)∞1)╟w' °
XCp 1 2 " °
*(1996 6 6 14 2 7 204) °
Fpanela ÉFX 'panela;D;T;C124;D124' °
'Σ Full screen Auxilliary processor 124' °
'T╜124 SVOFFER ''D124'' ''C124''' °
'D╜4 6µ1 1 1 2000 2 7 10 5 10 25 2 31 2 45 20 4 2 79 17 20 4 50 2 127' °
'D124╜D' 'C124╜1' 'D124╜''Press Enter twice''' 'C124╜2 1' 'C124╜3 1' °
'D124╜1 51µ''THE FULL SCREEN MANAGEMENT AUXILLIARY PROCESSOR 124''' °
X 'C124╜4 1' 'C124╜3 1' °
*(1996 6 6 14 5 52 396) °
Fpanelb ÉFX 'panelb;D;T;C124;D124' °
'Σ Full screen Auxilliary processor 124' °
'T╜124 SVOFFER ''D124'' ''C124''' °
'D╜4 6µ1 1 1 2000 2 7 10 5 10 25 2 31 2 45 20 4 2 79 17 20 4 50 2 127' °
'D124╜D' 'C124╜1' 'D124╜''Press Enter twice''' 'C124╜2 1' 'C124╜3 1' °
'D124╜1 51µ''THE FULL SCREEN MANAGEMENT AUXILLIARY PROCESSOR 124''' °
X 'C124╜4 1' 'C124╜2 1' °
XCpath 1 13 C:\APL2\WORK\ °
*(1992 1 14 9 44 44 496) °
Fpause ÉFX 'v pause w;t' °
'Σ Pause, then print w v spaces right and return' °
X 't╜(0=ÉNC ''v'')doif ''v╜6''' 'do' '(vµ'' ''),w' 'do' °
XCq 0 ' °
XCr 0 °
*(1992 1 14 9 44 43 492) °
Freplace ÉFX 'u╜v replace w;i;r;s' 'Σ Replace elements in v in w' °
'i╜Γ∞µu╜w' 's╜2πv╜(v⌠'' '')Γv' 'i╜⌡r╜i⌡■Γ[1]w°.=╞v' °
X 'u[(εi)/εr]╜s[(εi)/εi⌡■∞µs]' °
*(1992 1 14 9 44 44 496) °
Fround ÉFX 'u╜v round w' 'Σ Half adjust w to vth decimal' °
X 'u╜(╛0.5+w⌡10*v)÷10*v' °
XCs 1 2 " °
*(1992 8 10 10 58 49 588) °
Fshared ÉFX 'U╜shared;T;C2;D2;E2' °
'Σ List all shared variables currently active' °
'T╜2 ÉSVO■''C2'' ''D2'' ''E2''' °
'╕((δ/2⌠T╜ÉSVO■''C2'' ''D2'' ''E2'')doif ''''''AP 2 not active'''''')/ °
X0' 'C2╜0' 'U╜D2[;4]' 'U╜((εsv)εU)/εsv' °
*(1991 11 11 8 25 12 312) °
Fshow ÉFX '╢v show ╢w;╢t;╢b' 'Σ Display and execute ╢w' °
'╢t╜(0=ÉNC ''╢v'')doif ''╢v╜0''' °
'╕((0=╧╢w)doif ''show ╢w,'''' '''''')/0' °
'╕((1<╧╢w)doif ''╢v show■ ╢w'')/0' ''' '',╢w' °
X '╕((╢v^'':''ε╢w)doif ''╢t╜evaldd ╢w'')/L0' '''ÉEM'' ÉEA ╢w' 'L0:do' °
*(1992 1 14 9 44 44 496) °
Fshowdd ÉFX 'u╜showdd w;a;b;c;r' °
'Σ Display a direct definition function' °
'╕((1=╧w)doif ''u╜showdd Γw'')/u╜0' °
'╕((3⌠ÉNC╞w)doif ''(ε╞w),'''' is not a function'''''')/0' °
'c╜Γ[2]ÉCR╞w' 'c╜notb(2╞c),(Γ''aw α∙'')replace■2╟c' °
'╕((~''ΣDD''╧3╞2πc)doif ''''''Not a direct definition function'''''')/ °
0' 'u╜1' 'b╜('' ''⌠╞c)Γ╞c' 'a╜'' ''' 'r╜2╟3πc' °
'╕((3=µc)doif ''a,(╞w),'''':'''',r,(3<µ2πc)/'''' Σ'''',3╟2πc'')/0' °
'a╜a,(╞w),'':'',(2╟5πc),'':''' 'b╜(+\r=''('')-+\r='')''' 'b╜b∞0' °
X 'a╜a,(²3╟(b-1)╞3╟r),'':'',2╟»(b+2)╟r' 'a,(3<µ2πc)/'' Σ'',3╟2πc' °
*(1992 1 14 9 44 44 496) °
Fshowfn ÉFX 'u╜v showfn w;f;n;t;ÉIO' 'Σ Simulate the STSC ÉVR command' °
't╜(0=ÉNC ''v'')doif ''v╜,0''' 'ÉIO╜0' °
'u╜'' '',''╖'',w,''[É]'',(╞v)╞''╖''' 'n╜1╞µf╜ÉCR w' °
'v╜v[0],((1╟v)ε∞n)/1╟v' 'n╜«∞n' 'n╜(n⌠'' '')Γn' °
'f╜(π''['',■n,■Γ''] ''),f' °
't╜(1<µ,v)doif ''f╜f[1╟v;]'' ''u╜''''''''''' 'u╜²1╟u,r,,f,r' °
X 'u╜((-+/^\'' ''=Φu)╟u),('' ''(r,'' ╖'',date 2 ÉAT w))[╞v]' °
*(1992 1 14 9 44 45 500) °
Fsimdd ÉFX 'u╜simdd w;e' 'Σ Simple direct definition mode' 'u╜0' °
'╕((0⌠ÉNC╞w)doif ''''''Already defined'''''')/0' 'e╜''α''ε2πw' °
'w[2]╜Γ''u╜'',''α∙ aw'' replace 2πw' 'w╜w[1 3 2]' °
X 'w[1]╜Γε''u╜'',(e/''a ''),w[1],'' w''' 'u╜╧ÉFX w' °
XAsv╜(100 211 80 206)(120 210 124) °
XCt 1 16 TEACH10 °
*(1992 6 3 9 59 17 424) °
Ftab ÉFX 'U╜V tab W;T;A;B;C;D;E;F;G;M;ÉPW' 'Σ Tabulate list W' °
'T╜(0=ÉNC ''V'')doif ''V╜0''' 'M╜''Invalid data for tabulation''' °
'V╜4╞V' 'ÉPW╜130╛30⌐G╜V[2]+79⌡V[2]=0' °
'L1:╕((1<╧W)doif ''''''W╜∞0'''' ÉEA ''''W╜πW'''''')/L1' °
'╕(((0=µεW)δ2<µµW)doif ''U╜(~V╧4╞0)/M'')/0' °
'T╜(1≥µµU╜«W)doif ''U╜πW╜(U⌠'''' '''')ΓU''' °
'T╜(0<V[1])doif ''U╜(«(Φ1,╞µW)µ(V[3]µ'''' ''''),∞(╞µW)-V[3]),'''' '''' °
,U''' '╕(G<30)/0' 'T╜(F╜µεV[4])+C╜1╟B╜µA╜(V[3],0)╟U' °
'T╜⌐(1╞B)÷1⌐╛(ÉPW+F)÷T' 'U╜(E╜(V[3],C)╞U),[1](B╜T,1╟B)╞A' °
'''D╜εV[4]'' ÉEA ''D╜ÉAV[εV[4]+33⌡V[4]=0]''' 'L0:A╜(T,0)╟A' °
X '╕(0=1╞µA)/0' 'U╜U,(((T+V[3]),µD)µD),E,[1]B╞A' '╕L0' °
*(1996 6 15 13 15 10 300) °
Ftest ÉFX 'test;T' 'Σ test return code' '╕(0=T╜C124)/0' °
X '''SESSION ABORTED: The return code is '',T ╪ ╕' °
XCuc 1 26 ABCDEFGHIJKLMNOPQRSTUVWXYZ °
*(1994 3 15 11 25 49 468) °
Fucf ÉFX 'U╜ucf W;T;R;B;N' °
'Σ Convert all lower case text in W to upper case' 'R╜µW' °
'╕((1<╧,W)doif ''U╜Rµucf■ ,W'')/0' 'T╜lc∞W╜,W' 'N╜(B╜T<27)/∞µW' °
X 'W[N]╜uc[B/T]' 'U╜RµW' °
XCul 0 ² °
*(1996 6 13 13 16 24 352) °
Fwarna ÉFX 'warna;T' 'Σ clear AP124 and explai' °
X 'T╜ÉSVR■''C124'' ''D124''' 'T╜ÉEX■''C124'' ''D124''' °
*(1996 6 15 18 50 30 540) °
Fwarnb ÉFX 'warnb;T' 'Σ clear AP124 and explain' °
'''WARNING: As you study this lesson, try to respond to all requests.' °
',r' °
'''Of course as in all these tutorials, you are encouraged to experime °
nt''' °
'''at any pause. However, on some AP124 commands the screen may FREEZE °
.''' '''If that happens, do the following:'',r' °
''' 1. Press one of the "gray" keys, such as Home or End''' °
''' 2. Click on the QUAD symbol on the APL2 screen'',r' °
'''If this fails to continue the lesson, then try the following:'',r' °
''' 1. Select the SIGNAL pull down menu and do and interrupt''' °
''' 2. Branch to zero (╕0)''' ''' 3. Press Enter'',r' °
'''If this also fails, you will have to re-start the lesson, but befor °
e''' °
'''you do, be sure to check the WINDOW LIST and make sure there are no °
X''' '''active AP124 windows left.''' 'do' °
*(1996 6 13 13 34 23 420) °
Fwarning ÉFX 'warning;T' 'Σ clear AP124 and explai' 'warna' 'warnb' °
X 'end' °