Page 1 of 1

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

Posted: Sun Mar 19, 2017 10:20 am
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)

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

Posted: Sun Mar 19, 2017 10:31 am
by gurj
RemoveString(String$,..) & InsertString() & ReplaceString()... optimize ,if String$=ZString$

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

Posted: Wed May 24, 2017 8:48 am
by gurj
and add character sets
Structure z
CharacterSets.a
size.l
s.s
EndStructure

CharacterSets:
0 ; =unknown
#PB_Ascii
#PB_UTF8
#PB_Unicode
...

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

Posted: Sun Jun 25, 2017 3:26 pm
by gurj
change to:

Code: Select all

Structure z
StrAddress.i
size.i
CharacterSets.a
EndStructure