Interactive PowerBasic Forum

IT-Consultant: Charles Pegge => Software Design and Development Issues => Topic started by: Zlatko Vid on June 13, 2024, 11:22:17 AM

Title: Macro Function as...
Post by: Zlatko Vid on June 13, 2024, 11:22:17 AM
...as local or function parameters container

is that even possible ?

like

macro myMacro(arg1,arg2,arg3)

i hope that my question is not stupid  ;D
Title: Re: Macro Function as...
Post by: Charles Pegge on June 13, 2024, 12:05:41 PM
Macro functions with a defined return type and parameters look like this:

macro inlimits int(r,  a,min,max)
=================================
r=-1
if a<min then r=0
if a>max then r=0
end macro

print inlimits(20,10,30) '-1
print inlimits(31,10,30) '0


Title: Re: Macro Function as...
Post by: Zlatko Vid on June 14, 2024, 07:26:43 AM
thanks Charles
I will try to use it