ok well here's the newest update.
not much done but i made it so you can call how much the counters are inc by and set the key rate. here you go:
Function Textinput(Lnum,RNum,Inum)
Rem where the starting text ends
endoftext=Len(Text$)
Rem Add the cursor indicator (_)
Text$=line$(Lnum)+"_"
Repeat
Rem Get the pressed key
Add$ = Inkey$()
rem if there is a key pressed and Backspace(14) enter(return) and tab(15) arn't pressed
if add$>"" and keystate(14)=0 and returnkey()=0 and keystate(15)=0 and left=0
Rem check if the the timer is greater then ten
if Addtimer>RNum
rem if the text is larger then 640 add a line
if Text width(Text$+Add$)>640
ShiftLinesDown(Lnum)
Rem take of the _
Line$(Lnum)=Left$(Text$,Len(Text$)-1)
Rem Set text to one line infront of the line number + _
Text$="_"
Rem add one to line number
Lnum=Lnum+1
endif
rem take off the "_"
Text$=Left$(text$,Len(Text$)-1)
Rem add the new character and add the _ back in
Text$=Text$+Add$+"_"
Rem set timer back to 0
addtimer=0
endif
endif
Rem If Tab is pressed
If Keystate(15)=1
if Text width(Text$+" ")>640
ShiftLinesDown(Lnum)
Rem take of the _
Line$(Lnum)=Left$(Text$,Len(Text$)-1)
Rem Set text to one line infront of the line number + _
Text$="_"
Rem add one to line number
Lnum=Lnum+1
endif
Rem Switch so you can't hold down tab
if Tab=0
if left=0
Rem Take of the _
Text$=Left$(Text$,Len(Text$)-1)
Rem add 5 spaces and the _
Text$=Text$+" _"
Rem Turn the switch on
tab=1
else
Text$="_ "+Right$(Text$,Len(Text$)-1)
tab=1
endif
endif
else
Rem If tab isn't pressed turn switch off
tab=0
endif
Rem If backspacce is pressed
If keystate(14)=1
Rem if timer is greater then 10
if backtimer>RNum
if left=0
Rem the line isn't 0
if Lnum>0
Rem Take of the _ and one other character
Text$=Left$(text$,Len(Text$)-2)
rem add the _ back on
Text$=Text$+"_"
Rem set timer to 0
backtimer=0
else
Rem If line is 0 and the cursor is not on the text passed to the function
if Len(Text$)-1>endoftext
Rem Same as above
Text$=Left$(text$,Len(Text$)-2)
Text$=Text$+"_"
backtimer=0
endif
endif
endif
Rem if your at the last one go up a line
If Len(text$)=1 and Lnum>0
if left=0
ShiftlinesUP(Lnum)
Rem Set the line number -1 of what it was
Lnum=Lnum-1
Rem Set text$ to the line array text plus the _
Text$=Line$(Lnum)+"_"
endif
endif
If left=1
Rem If the _ is on the left side
if Left$(Text$,1)="_"
Rem if your on a line greater the 0
if Lnum>0
Rem shift lines up
Shiftlinesup(lnum)
Rem subtract from the line number
lnum=lnum-1
Rem Set timer to 0
BackTimer=0
endif
endif
endif
endif
endif
rem if enter is pressed and timer is greater then 15
Percent = Rnum + rnum/2
IF returnkey()=1 and returntimer>Rnum+(Rnum/2)
if left=0
ShiftLinesDown(Lnum)
Rem take of the _
Line$(Lnum)=Left$(Text$,Len(Text$)-1)
Rem Set text to one line infront of the line number + _
Text$="_"
Rem add one to line number
Lnum=Lnum+1
Rem set timer to 0
ReturnTimer=0
else
Rem Subract one from the line number
rem so that when it shifts down
rem it shifts the current line also
Line$(Lnum)=""
lnum=lnum-1
Rem Shift lines down
Shiftlinesdown(Lnum)
Rem Set the line one ahead of what
rem it was before(-1 was already
rem added so we need to add +2)
Lnum=Lnum+2
Rem set timer to 0
Returntimer=0
endif
endif
Rem Upkey/downkey line movments
If upkey() and movecounter>Rnum*2 and Lnum>0
if left=0
Line$(lnum)=left$(Text$,Len(Text$)-1)
else
line$(Lnum)=Right$(Text$,Len(Text$)-1)
endif
Lnum=Lnum-1
if Line$(Lnum)="" then Left=0
Text$ = Line$(Lnum)+"_"
movecounter=0
endif
If downkey() and movecounter>RNum*2 and Lnum<100
Line$(lnum)=left$(Text$,Len(Text$)-1)
Lnum=Lnum+1
Text$ = Line$(Lnum)+"_"
movecounter=0
endif
If Leftkey() and left=0
Rem set left on
Left=1
Rem Put the _ at the biginning
Text$="_"+left$(Text$,Len(Text$)-1)
endif
if rightkey() and left=1
Rem Set Left off
Left=0
rem Put the _ at the end
Text$=Right$(Text$,Len(Text$)-1)+"_"
endif
rem sift through all the line exept the line number
rem and if it is equal to anything print it at the
rem appropriate place
for X=0 to 100
if line$(X)>"" and X!Lnum
text 0,X*15,Line$(X)
endif
next x
Rem Just to make sure the _ is always at the right spot
If Left=1
if right$(Text$,1)="_"
Text$=Left$(Text$,Len(Text$)-1)
Text$="_"+Text$
endif
else
if Left$(Text$,1)="_"
Text$=Right$(Text$,Len(Text$)-1)+"_"
endif
endif
rem Print the line numbers text.
Text 0,Lnum*15,Text$
Rem Add to all the timers
BackTimer = BackTimer + Inum
AddTimer = AddTimer + Inum
Returntimer = Returntimer + Inum
movecounter = movecounter + Inum
TabCounter = TabCounter + Inum
sync
cls
Rem repeat until Mouseclick and mouse y is above or below the current line
until Mouseclick() and MouseY()>(Lnum+1)*20 or Mouseclick() and mouseY()<lnum*20
Repeat : sync : until Mouseclick()=0
Rem set the line number array to the text$ minus the _
if left=0
Rem if left then take one from the right
Line$(Lnum) = Left$(Text$,Len(Text$)-1)
else
Rem if right then take one from the left
Line$(Lnum = Right$(Text$,Len(Text$)-1)
endif
Rem Set left to 0
Left=0
Rem exit function with the line number for if the user wants
rem to start at the same line next time
endfunction Lnum
Function ShiftLinesDown(Line)
For X=99 to line+1 step -1
line$(X+1)=Line$(X)
next x
endfunction
Function ShiftLinesUp(Line)
if line>0
For X=line to 99
Line$(X)=Line$(X+1)
next x
Line$(99)=""
endif
endfunction
anything else (other then positioning the input and single character editing. working on that now)
New Site! Check it out \/