ENITITY
PURPOSE:
Set up a new workspace that is isolated from the primary workspace.
STATEMENT SYNTAX:
{stno} ENTITY entno,datano,progname
where:
entno = entity number (normally 253 or 254) (the primary workspace is 128 the internal
SM32 console mode program is 255)
datano = data area number (1->14) (the primary workspace is 0)
progname = the program to load into the new workspace
EXAMPLE:
10 ENTITY 254,14,"$__BEDIT"
Notes:
Currently there is only 1 use for an ENTITY, that is to supply a console mode program to support
the main workspace(entity 128). When entity 128 goes into console a special call (BCALL)
is made to the next highest entity #. Usually this is $__BEDIT running as entity # 254. There is an
internal entity # 255 that takes control if there is no entity 129->254. Note that if $__BEDIT went to
console mode it would do the same as entity 128 did and call the next highest entity # which is #255.
For the layout the BCALL see BENTER.
To see entity 255 simply remove
the entity command from the Initial Statement (Properties - System page). You will see a prompt of:
>>
and also notice there is no EDIT command available.
There are 2 examples of the console mode entity in the distribution. The $__BEDIT refered to above and
the $__FATAL program for a release versions.
A console mode program can pass a call onto a higher # entity by using a BEXIT -1.
If the following program was added as an entity in the Initial Statement:
10 entity 253,13,"MYEDIT";entity 254,14,"$__BEDIT";call "$__setup";RUN "START"
Only someone who new the password "This is Ken" could get into console mode.
10 REM "MYEDIT"
20 BENTER ENT,EI$,NV,CN,KSA![ALL],NAM$,ADD$,UN1,UN2,US1$,US2$,ERR=6000
30 LET A$=ETBL("ken_is_here",ERR=.+1)
40 IF A$="yes" THEN BEXIT -1
50 PRINT 'gwin'("console"),'sw'("restore"),
60 PRINT 'window'(20,5,40,10,"Fatal Error",'red'),'backgr','yellow','default','cs',
70 INPUT @(2,3),'rb',"Call Ken at 717-0728",'ee',A$,'be',
80 IF A$<>"This is Ken" THEN GOTO 0070
90 PRINT 'pop',
100 LET A$=ETBL("ken_is_here","yes")
110 BEXIT -1