Skip to main content

#EXPAND

#EXPAND( token );

tokenThe name of the MACRO parameter whose passed string constant value to expand.

The #EXPAND statement substitutes and parses the text of the passed token's string within the MACRO.

Example:

  MAC_join(attrname, leftDS, rightDS, linkflags) := MACRO
    attrname := JOIN(leftDS,rightDS,#EXPAND(linkflags));
  ENDMACRO;
  
  MAC_join(J1,People,Property,'LEFT.ID=RIGHT.PeopleID,LEFT OUTER')
  //expands out to:
  // J1 := JOIN(People,Property,LEFT.ID=RIGHT.PeopleID,LEFT OUTER);
  
  MAC_join(J2,People,Property,'LEFT.ID=RIGHT.PeopleID')
  //expands out to:
  // J2 := JOIN(People,Property,LEFT.ID=RIGHT.PeopleID);

See Also: MACRO