News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Question for Michael Webster

Started by hutch--, November 16, 2005, 03:26:47 AM

Previous topic - Next topic

hutch--

I have done a quick "knife and fork" job on the switch$ macro so that a variant version "switchi$" will perform block compare case insensitive. I have written a variation of the "szCmpi" algo that works with the macro and it all seems to be working OK at the moment. My quesion to Micheal is do I need to modify the equate names in the macros as well to be different to the normal "switch$" macro so that they do not interfere with each other ?

I have attached a working example that has the macro, the Cmpi algo and the test condition. If you have time, would you have a look at it to see if it works according to your design criterion ?

[attachment deleted by admin]
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

MichaelW

Intuitively it seemed to me that you would need to change the equate names to support nesting of switch$ and switchi$. But after some testing it seems that no changes are necessary (although I did not test all possibilities). The values of the three equates are being preserved on entry and recovered on exit, and the counter is being incremented on each expansion, so it all works. I think only the case$ macro needs to differentiate between case-sensitive and case-insensitive. There are MASM32 versions of strcmp and _stricmp, but what about strncmp and _strnicmp? Would casen$ and caseni$ macros be useful?





[attachment deleted by admin]
eschew obfuscation

hutch--

Michael,

At the risk of wearing you out, I have just changed all of the equates and macro names for the switchi$ macros and if it looks OK I would like to add it to the main macro file and do the documentation for it.

If you have the time would you have a look at this version just to check that I have not messed it up somewhere. It is testing OK so far.

[attachment deleted by admin]
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php