flat assembler
Message board for the users of flat assembler.

Index > Main > How to avoid name redefinition?

Author
Thread Post new topic Reply to topic
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 18 Mar 2005, 12:54
hi!

i want to define structure, but avoid redefinition, but have no success.

the first attempt i've done:

Code:
if not defined CHARRANGE
    struct CHARRANGE
        .cpMin dd ?
        .cpMax dd ?
    ends
end if    

got message "reserved word used"

the second one:

Code:
if defined CHARRANGE
else
    struct CHARRANGE
        .cpMin dd ?
        .cpMax dd ?
    ends
end if    

-- "code cannot be generated"

so, what can help me?
or, just thought, i should use one of such variances:

if (defined CHARRANGE)=FALSE
..

if !(defined CHARRANGE)
..

if !defined CHARRANGE
..

?

thanks!

_________________
UNICODE forever!
Post 18 Mar 2005, 12:54
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8390
Location: Kraków, Poland
Tomasz Grysztar 18 Mar 2005, 13:01
First, read about conditional expressions in fasm's manual.
Second, the solution to your particular problem, which is very fasm-specific is discussed in this article. In short, it should be something like:
Code:
if ~ defined CHARRANGE | defined ..here
 ..here = 1
 struct CHARRANGE
  .cpMin dd ?
  .cpMax dd ?
 ends
end if    
Post 18 Mar 2005, 13:01
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 18 Mar 2005, 13:23
thanks!
Post 18 Mar 2005, 13:23
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.