Page 1 of 1

Something not working with Macros

Posted: Sat Apr 26, 2025 6:29 pm
by es_91

Code: Select all

macro  declareClass

	declareModule

endMacro

macro  endDeclareClass

	endDeclareModule

endMacro


declareClass  test

	declare  hello()

endDeclareClass


module  test

	procedure hello ()
	
		debug 1
	
	endProcedure

endModule


test::hello()
PB Compiler wrote:Line 18: Syntax error.

Re: Something not working with Macros

Posted: Sat Apr 26, 2025 8:28 pm
by User_Russian
This is probably not a bug.
You are calling a macro inside the module declaration, but macro located outside the module.

Re: Something not working with Macros

Posted: Sat Apr 26, 2025 11:54 pm
by Little John
User_Russian wrote: Sat Apr 26, 2025 8:28 pm This is probably not a bug.
You are calling a macro inside the module declaration, but macro located outside the module.
Yep.

Re: Something not working with Macros

Posted: Sun Apr 27, 2025 12:10 am
by STARGĂ…TE

Code: Select all

DeclareModule Class
	
	Macro  declareClass
	
		DeclareModule
	
	EndMacro
	
	Macro  endDeclareClass
	
		EndDeclareModule
	
	EndMacro

EndDeclareModule

Module Class

EndModule


Class::declareClass  test

	Declare  hello()

Class::endDeclareClass


Module  test

	Procedure hello ()
	
		Debug 1
	
	EndProcedure

EndModule


test::hello()

Re: Something not working with Macros

Posted: Sun Apr 27, 2025 12:27 am
by es_91
Special thanks, STARGATE !!