add type of variables 'z' & StrAdd() & StrSub()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
gurj
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

add type of variables 'z' & StrAdd() & StrSub()

Post by gurj »

add type of variables 'z' & StrAdd() & StrSub()

Structure z
size.l
s.s
EndStructure

.z must use Variable name
a.z="xxx" ,then a\size automate properly by pb own
@a=@a\s

StrAdd(Str$,"xxx",Position=-1) ,[-1=ending] ,if Str$ is ZString ,then ZStr$\size added automate

StrSub(Str$,SubtractSize,Position=-1)...

*************************
from
Fast string:
http://www.purebasic.fr/english/viewtop ... =3&t=58892
------------
pb every allocating Memory for new string ,or for update string.
so pb sure has size of string (as use own len()...)
so .s add size.l is compliant
so save size of string for use whenever ,this is properly


or .s add not size.l ,but add .z and add...:
(.z replace .BSTR)
my pb for chinese:
http://ataorj.ys168.com
User avatar
gurj
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: add type of variables 'z' & StrAdd() & StrSub()

Post by gurj »

RemoveString(String$,..) & InsertString() & ReplaceString()... optimize ,if String$=ZString$
my pb for chinese:
http://ataorj.ys168.com
User avatar
gurj
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: add type of variables 'z' & StrAdd() & StrSub()

Post by gurj »

and add character sets
Structure z
CharacterSets.a
size.l
s.s
EndStructure

CharacterSets:
0 ; =unknown
#PB_Ascii
#PB_UTF8
#PB_Unicode
...
my pb for chinese:
http://ataorj.ys168.com
User avatar
gurj
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: add type of variables 'z' & StrAdd() & StrSub()

Post by gurj »

change to:

Code: Select all

Structure z
StrAddress.i
size.i
CharacterSets.a
EndStructure
my pb for chinese:
http://ataorj.ys168.com
Post Reply