Hey Gabe,
the variables in g-code are called “parameters”. There are numbered parameters, named parameters and subroutine parameters. See G-Code overview.
The user parameters are the number #31–#5000, available for free use.
The subroutine parameters are #1–#30, which correspond to the parameters following a subroutine call.