DIM s as string = "1234567890"
mid(s, 2, 3) = "xxx"
print s
DIM s as string = "1234567890"
mid s, 2, "x"
print s
DIM s as string = "1234567890"
mid(s, 2) = "xxx"
print s
mid(s, 2,"xxx")
print s
mid(s, 2) = "xxx" 'pseudo assignment:o
José,
Yes, and the mid statement can take 2 forms:
mid(s, 2) = "xxx" 'pseudo assignment
mid(s, 2,"xxx") 'underlying formCode: [Select]DIM s as string = "1234567890"
mid(s, 2) = "xxx"
print s
mid(s, 2,"xxx")
print s
s = LEFT(s, 1) & "xxx" & MID(s, 2)
Quotemid(s, 2) = "xxx" 'pseudo assignment:o
what i don't know for that
dim s as string2 = "1234567890"
dim s2 as string2 = "00"
mid(s, 3) = s2
print s
dim s as string2 = "1234567890"
mid(s, 3) = "00"
print s
macro midset(cw)
================
sys ps=strptr s
sys pw=strptr w
int ls=cw*len s
int lw=cw*len w
i*=cw
n*=cw
if i<0 then i=ls+i+cw 'index from right
i-=cw 'base 0
if n>lw then n=lw
if n+i>ls
n=ls-i
if n<0 then return
end if
copy ps+i,pw,n
end macro
function amid(char*s,int i, int n,char* w)
==========================================
midset(1)
end function
function amid(string s,int i, int n,string w)
=============================================
midset(1)
end function
function wmid(wchar*s,int i, int n,wchar* w)
============================================
midset(2)
end function
function wmid(wstring s,int i, int n,wstring w)
===============================================
midset(2)
end function
string s="1234567890"
amid (s,2,3)="abcd"
print s
'
wstring s="1234567890"
wstring w="abcd"
wmid (s,2,3)=w
print s
'
char s="1234567890"
amid (s,2,3)="abcd"
print s
'
wchar s="1234567890"
wstring w="abcd"
wmid (s,2,3)=w
print s