flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > please help me

Author
Thread Post new topic Reply to topic
luckystar



Joined: 23 Mar 2004
Posts: 8
luckystar
macro name a,b,c
{
if a eq true
a#.param = 1
end if

if ~ defined a#.param ;??????
.....
end
}

if call marco with "name,aaa,sf,asdf" to be get error,
==========>
a#.param
error: undefined symbol.
Post 10 Nov 2007, 03:09
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
This is the code I used
Code:
macro name a,b,c
{ 
if a eq true 
  a#.param = 1
end if 

if ~ defined a#.param ;?????? 
  display "hello"
end if
} 

name aaa,sf,asd     

But I couldn't reproduce the error. And if I use "name true, sf, asd" no error neither and "hello" is not displayed.

Can you provide more info about what are you trying to do and if the "undefined symbol" error is really triggered by this macro? Providing a minimal code that produces this error would be the best.
Post 10 Nov 2007, 04:44
View user's profile Send private message Reply with quote
mike.dld



Joined: 03 Oct 2003
Posts: 235
Location: Belarus, Minsk
mike.dld
luckystar wrote:
if call marco with "name,aaa,sf,asdf" to be get error

You don't need that comma after macro name. Just write it as LocoDelAssembly proposed: name aaa,sf,asd. When you write this comma, it means that you pass nothing as first argument to your macro, thus making "aaa" second arg, "sf" third and "asdf" fourth. This makes "if a eq true" never succeed.
Post 10 Nov 2007, 06:41
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
mike, but the error for writing that extra comma is not "undefined symbol" but "invalid macro arguments", so the error seems to be located somewhere else but luckystar provided too few code to trigger the error he says.
Post 10 Nov 2007, 15:59
View user's profile Send private message 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 GitHub, YouTube, Twitter.

Website powered by rwasa.