Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

String Function Equivalents

Intel_C_Intel
Employee
922 Views
Does anybody know if there is an equivalent to 'VERIFY' in C / C++?
Cheers,

Dan
0 Kudos
3 Replies
TimP
Honored Contributor III
922 Views
I don't believe there is a standard C function close to that name. I'll guess that you're looking for something akin to strcspn() or the Cobol verify, not the verify function which comes up under info. These string functions can be written in terms of INDEX(), and the efficiency could be fairly good with compilers which do some form of in-line expansion. You might be interested in what you could find with a Google search on Fortran INDEX().
0 Kudos
Intel_C_Intel
Employee
922 Views
nVerify = VERIFY(privid, VALID_CHARS)
DO WHILE (nVerify > 0)
privid(nVerify:nVerify) = '_'
nVerify = VERIFY(privid, VALID_CHARS)
END DO
0 Kudos
Intel_C_Intel
Employee
922 Views
What I tried to say...I'm not to bothered about efficiecny since this is (MFC) GUI code, so for:
nVerify = VERIFY(privid, VALID_CHARS)
DO WHILE (nVerify > 0)
privid(nVerify:nVerify) = '_'
nVerify = VERIFY(privid, VALID_CHARS)
END DO
I used CString functions:
for (int i = 0; i < m_strItemName.GetLength(); i++)
{
chr = m_strItemName.GetAt(i);
nLoc = strValid.Find(chr, 0);
if (-1 == nLoc)
{
m_strItemName.SetAt(i, '_');
}
}
which seems a little less elegant, but works ok.
Thanks anyway,

Dan
0 Kudos
Reply