Hi,
Which function is used for case insensitive string comparison? I found stricmp, strnicmp, strcasecmp but none of them exist in MDL API. I can write my own but it is better to use the library function if on exist.
Hi Sedat,
Sedat Alis said:Which function is used for case insensitive string comparison?
stricmp you mentioned is the right function I think. It's replaced by _stricmp, but still can be used.
Sedat Alis said:I found stricmp, strnicmp, strcasecmp but none of them exist in MDL API.
You do not specify whether your code is pseudocode .mc project (which should not be used, because officially obsolete in V8i) or standard native C.
In pseudocode, I guess there is no stricmp available, whereas in native code you can freely use all standard C functions.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Jan,
Thank you.
Jan Šlegr said:stricmp you mentioned is the right function I think. It's replaced by _stricmp, but still can be used.
I can't find it in stdio.h.
Jan Šlegr said:You do not specify whether your code is pseudocode .mc project (which should not be used, because officially obsolete in V8i) or standard native C.
I am compiling my project as ma+dll.
Jan Šlegr said:In pseudocode, I guess there is no stricmp available, whereas in native code you can freely use all standard C functions.
OK. But all available functions must be defined. I can't find function definition of stricmp in any Bentley or standard C library header files.
Kind regards,
Sedat AlisAEC Technology Inc.
Sedat Alis said:I can't find it in stdio.h.
Why you expect it should be in stdio.h, when it's string function?
Sedat Alis said:I can't find function definition of stricmp in any Bentley or standard C library header files.
It cannot be in Bentley header, when it is standard C function.
Visual Studio 2005 is the only supported for V8i native code compilation. In this version, I see both stricmp and _stricmp declarations in string.h (on my computer it's at C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\string.h).
Regards,
Jan Šlegr said:Why you expect it should be in stdio.h, when it's string function?
Sorry, I thought string.h but I wrote stdio.h.
Jan Šlegr said:It cannot be in Bentley header, when it is standard C function. Visual Studio 2005 is the only supported for V8i native code compilation. In this version, I see both stricmp and _stricmp declarations in string.h (on my computer it's at C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\string.h).
You are totally right!
I was looking into wrong string.h which is under MDL SDK folder. string.h under MDL SDK folder is used when compiling pseudocode which produces only MA.
Both stricmp and strnicmp are working fine.
Thank you again for your help.