mikeg
New Member
Posts: 4
|
Post by mikeg on Mar 25, 2020 14:41:40 GMT
Here is a link to my code forum. It provides a place for people to share code tools and examples for the world to use. Consider contributing. link
|
|
ken
New Member
Posts: 4
|
Post by ken on Mar 25, 2020 21:37:40 GMT
It's an interesting forum, but it would be useful if the REMs at the beginning contained more information about the program - what it does, why it does it, etc.
For example, your "New type of text tool" produces a black background onto which you can type white text. So? What is it supposed to accomplish?
|
|
mikeg
New Member
Posts: 4
|
Post by mikeg on Mar 26, 2020 0:41:27 GMT
Hi Ken
On the board called 'RETROLIB 10 tools divided' I have provided the tools in modular form and using 16 color base colors.
I created the command to give a graphics INPUT style tool that returns the content of the text you type in a string so you can use it for a game or what ever you want in a graphics environment on any platform with a keyboard.
It allows control of the length of the text and the graphics coordinate based location for your needs.
If you look closely, RETROLIB 10 commands divided, tries to make each command not require the entire library and each one has TONNES of REMs explaining things.
Here is a copy of the simplified sample with tonnes of REMs for what you are speaking:
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$
|
|
ken
New Member
Posts: 4
|
Post by ken on Mar 26, 2020 8:48:24 GMT
Ok. Thanks. Can't think of a use for it at the moment, but one never knows ...
|
|
mikeg
New Member
Posts: 4
|
Post by mikeg on Mar 26, 2020 13:38:54 GMT
It was created for my projects and I used it frequently. The code tools, were created for those who may be new and wanted a quick solution.
I cant imagine any expert programmer needing to use it, much less any of the other tools. "A new type of text tool" post , if I remember correctly was on the BBC4W forum years ago.
Thanks for reminding me and thanks for contributing to the Code forum.
|
|