Post by Admin on Jan 3, 2020 20:56:24 GMT
Copy and paste this tool in BBC BASIC or BBCSDL and execute it
Look carefully at the code to understand what it does. I have put explanation inside to make it easier to
understand
Look carefully at the code to understand what it does. I have put explanation inside to make it easier to
understand
MODE 8 :REM a graphics screen
VDU 5:REM makes text have graphics positioning
REM notice that this doesnt require a loop for your message to be created?
REM FNinput works on its own
MOVE 10,500:GCOL 15:PRINT "Type something and press ENTER "
REM x,y,textlimit ----- Text limit is the longest you will be allowed to make your text
M1$=FNinput(100,100,50)
MOVE 10,200:GCOL 15:PRINT "Your message was: "+M1$
END
REM remember this allows input message to be completed before it cycles.
REM this command takes control until message is entered.
REM I am working on a more flexible version that can be left and revisited like in windows
REM so sorta like live multi processes
REM H,V,TEXTLIMIT (simpler?)
DEF FNinput(bx,by,textlimit)
LOCAL fill,MESSAGE$
initialx%=0:sl%=0:key$="":MESSAGE$="":MES$=""
initialx%=textlimit*16.2
FOR fill=1 TO 58
GCOL 15:LINE bx-4,by+20-fill,bx+initialx%,by+20-fill
NEXT fill
GCOL 0:LINE bx+3,by+20,bx+initialx%,by+20:LINE bx+3,by+20-fill,bx+initialx%,by+20-fill
REPEAT
REPEAT
key$ =INKEY$(1)
GCOL 0
MOVE bx,by:PRINT MESSAGE$;"_" :* REFRESH
sl%=LEN(MESSAGE$)
UNTIL key$ <>""
sl%=LEN(MESSAGE$)
IF INKEY(-48) sl%=LEN(MESSAGE$)-1:key$=""
REPEAT UNTIL INKEY(0)=-1
IF sl%<LEN(MESSAGE$) THEN
GCOL 15
MOVE bx,by
PRINT MESSAGE$;"_"
ENDIF
MES$=MID$(MESSAGE$,0,sl%)
MESSAGE$=MES$
GCOL 15:MOVE bx,by:PRINT MESSAGE$;"_"
IF LEN(key$) = 1 THEN
IF LEN(MESSAGE$)<textlimit THEN GCOL 15:MOVE bx,by:PRINT MESSAGE$;"_": MESSAGE$=MESSAGE$+key$:* REFRESH OFF
REM (jump)
ENDIF
UNTIL INKEY(-74)
* REFRESH ON
=MESSAGE$