You help me understand because I try to help wherever I can. Read, read, read... Often I fail, and I try again. Then one day I see something I didn't see before.

Consider two things regarding your macro:
1) You're using the match directive extensively, even though it's not needed. Remember, that match and equ perform symbol expansion. Thus in the following case I would expect y to have the value var1*2, not var5*2 .

Nice execution. Don't understand why the prior value of (.) should be lost though, but that's just me.

15 Jul 2013, 16:00

l_inc

Joined: 23 Oct 2009
Posts: 881

l_inc

bitRAKE

Quote:

Don't understand why the prior value of (.) should be lost though

That's for convenience. I don't like macro or constant stacks to arbitrarily accumulate. Kinda principle of least side effect. Thus every time a logical scope of a constant (or a macro) is closed it should be restored (or purged). For that reason it's easier to include restore into the constant transformation routines than to explicitly invoke restore each time a constant needs to be transformed:

How to make a counter?
Example. We have V1 fix 2+1/2*3 and after using macro x Parse V1 we have x = 2,1/2*3
And need have count = 6. Number 6 is pointer to * befor 3.
If we do restore count we get count= 4 (Number 4 is pointer to / befor 2)
My code not work.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum