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: 1607
Location: Ukraine
shoorick
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: 7752
Location: Kraków, Poland
Tomasz Grysztar
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: 1607
Location: Ukraine
shoorick
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.