Hi José,
it´s me again ...
Working with what i find in "AfxStr.inc", i think i found some problems. I put it together in this code:
'console 32
#include "afx\afxstr.inc"
'dim t as CWstr = "ФЫВЙЦУФЫ" 'fails for "any"
'dim t as CBstr = "ФЫВЙЦУФЫ" 'fails for "any"
dim t as wstring * 64 = "ФЫВЙЦУФЫ" 'fails for "any"
print str(AfxStrTallyAny(t, "ФЫ")) 'fails for wide strings (returns 0)
print str(AfxStrTally(t, "ФЫ")) 'this works
'dim t1 as Zstring * 10 = "asdfgas"
dim t1 as string * 10 = "asdfgas"
print str(AfxStrTallyAny(t1, "as")) 'this works
print str(AfxStrTally(t1, "as")) 'this works
print str(AfxStrParseCountAny(t1, "as")) 'returns 3 - should return 5 ?
t = "aЙЦäУКЙЦöööУКЙЦУК123üüüü45"
messageboxw 0, "-" + afxstrshrink(t, " äöü") + "-", "Error", 0
messageboxw 0, "-" + afxstrshrink(t, " Й") + "-", "Error", 0
messageboxw 0, "-" + afxstrreverse(t) + "-", "Error", 0
The more, i wrote own functions for sting manipulation in FreeBASIC mostly using your code with small changes ("fb_str.inc" in "Ustring.zip" attachment). You must add a "#define USTRING Afx.CBstr" and it makes use of some constants defined in "fb.inc" e.g "any_".
Woud you please be so kind as to review it or even test it with your methods, so i can be sure, that it is bug free ? The basic idea is making it possible to have an implementation of your CWstr (defined as USTRING) and string helper functions for it (and all other FreeBASIC string types) even, if WINFBX is not present or intentionally isn´t used. When WINFBX is included, USTRING gets defined as CBstr and all WINFBX functionality can be used without interfering with my aditions (which are always available nevertheless).
You should not use my IDE for testing, because the latest public version still has some inconsistencies regarding FreeBASIC. There will be an update fixing this, but i would like to include the attached code and i want to be as sure as possible, that it works properly.
Thanks,
JK