FUNCTION Right(getStr As String,rLen As Int) As String
String retStr
retStr = MID(getStr,-rLen)
RETURN retStr
END FUNCTION
#lookahead
string text
string r$,w$,out
text="oxygenbasic"
r$="Dev"
w$="basic"
out=""
out = Replace(text,w$,r$)
print out 'out -> oxygenDev
FUNCTION Replace(t as string,w as string,r as string) As String
'=======================================
'
sys a,b,lw,lr
string s=t
'
lw=Len w
lr=Len r
a=1
'
DO
a=INSTR a,s,w
IF a=0 THEN EXIT DO
s=LEFT(s,a-1)+r+MID(s,a+lw)
a=a+lr
END DO
RETURN s
END FUNCTION
#lookahead
string text
string r$,w$,out
text="oxygenbasic"
r$="Dev"
w$="basic"
out=""
'test Replace()
out = Replace(text,w$,r$)
print out 'out -> oxygenDev
'test Right()
out = Right(out,3)
print out 'out -> Dev
FUNCTION Replace(t as string,w as string,r as string) As String
'=======================================
'
sys a,b,lw,lr
string s=t
'
lw=Len w
lr=Len r
a=1
'
DO
a=INSTR a,s,w
IF a=0 THEN EXIT DO
s=LEFT(s,a-1)+r+MID(s,a+lw)
a=a+lr
END DO
RETURN s
END FUNCTION
FUNCTION Right(getStr As String,rLen As Int) As String
String retStr
retStr = MID(getStr,-rLen)
Return retStr
END FUNCTION
'save file
SUB doSave
INT hsize=0
dir=""
'char tx[32768]
'bstring tx
string ext=".o2bas"
filter="All Files (*.*)" + Chr(0) + "*.*" + Chr(0) + "Oxygen Files (*.o2bas)" + Chr(0) + "*.o2bas" + Chr(0)
title="Save File... "
hwnd=0
fName = FileDialog(dir,filter,title,0,1,"o2bas")
IF Right(fName,6)<>".o2bas"
fName=fName+ext
END IF
If fName="" then Return
print fname
hsize = SendMessage hsci, SCI_GETTEXTLENGTH, 0, 0
SendMessage hsci,SCI_GETTEXT,hsize+1,tx
PutFile fName,tx
END SUB
There is no RIGHTS !
spend some time at your local court house