Author Topic: Macro error "Global within global not allowed"  (Read 3015 times)


  • Junior Community Member
  • Posts: 4
  • Hero Points: 1
Macro error "Global within global not allowed"
« on: April 18, 2017, 11:02:26 pm »
Hey All - My simple macro below gives the error "Global within global not allowed" on the second "g" substitution. The remainder of the macro finishes without error. If I enter the commands manually in the same order they all succeed. Any idea what that error means?


_command Load_Table_Test() name_info(','VSARG2_MACRO|VSARG2_MARK|VSARG2_REQUIRES_MDI_EDITORCTL)
   ex_parse_and_execute('g/\[datetime/ s/$/      --was DATETIME/');  // <--SUCCEEDS
   ex_parse_and_execute('g/\[float/ s/$/      --was FLOAT/');    // <--ERROR
   ex_parse_and_execute('g/\[int/ s/$/      --was INT/');  // <--SUCCEEDS
   ex_parse_and_execute('1,$ s/\[datetime\]/NVARCHAR(255)/');
   ex_parse_and_execute('1,$ s/\[float\]/NVARCHAR(255)/');
   ex_parse_and_execute('1,$ s/\[int\]/NVARCHAR(255)/');
   ex_parse_and_execute('g/\[ntext/ s/$/      --NTEXT column has restrictions/');


  • Senior Community Member
  • Posts: 2518
  • Hero Points: 327
Re: Macro error "Global within global not allowed"
« Reply #1 on: April 19, 2017, 11:37:18 pm »
I don't really know what VIM ex mode is but I notice that on this page there's also a "global within global not allowed" error message.

Can you post some example text that these commands can be tested on and explain what ex mode is for?

In case you didn't notice, the error message you're getting comes from the function __ex_global.  prev-index and last-index are indexes into the slickedit names table.  I'm not 100% sure when they get updated.