How can I freeze the screen until the function's done? Make Choices() :let save_view = winsaveview() let start = line('.') "Locate previous *choice. This is to avoid finding *choice blocks nested in another *choice block.)" return -1 endif "return getline(target_line_num, target_line_num 4) "Locate end of *choice block "echo getline(choice Start Line, choice Start Line 2) let choice End Line = search('^\S.*', 'W') "End is first line that starts with non-whitespace "If above search fails, might be at bottom of buffer if choice End Line == 0 let choice End Line = search('^$', 'W') "End is first empty line endif "Now go back up to the last *goto let choice End Line = search('*goto', 'b W') "Get the entire *choice block and put it in goto Block let goto Block = getline(choice Start Line, choice End Line) "Make label Array (contains all labels to goto) let label Array =  for cur in goto Block if match(cur, '*goto') !
(b=backwards, W=nowrap, n=do Not move cursor) let choice Start Line = search('^*choice', 'b W') if ! = -1 "echo 'cur: 'let cur Parsed = matchlist(cur, '*goto \(\S\ \)') "echo cur Parsed if len(cur Parsed) 1 let cur Label = cur Parsed else echo 'ERROR: Bad *goto ('')' return -1 endif call add(label Array, cur Label) endif endfor "Restore window to what it looked like (in case the searches scrolled "it) call winrestview(save_view) "Make newline after choice block if needed if strlen(getline(choice End Line 1)) 0 echo 'big line: '.getline(choice End Line 1) call cursor(choice End Line, 1) put='' endif call cursor(choice End Line 1, 1) "Put the new label blocks let skipped Labels = '' let num New Labels = 0 for cur in label Array if !
The user can select which time series to plot from a popup. Try if this works:if isfield(handles,) && ishandle(handles.y1) && ishandle(handles.y2) %update existing plot set(handles.y1,'XData',[Y1 XDATA],'Ydata',[Y1 YDATA]) %update data of y1 set(handles.y2,'XData',[Y2 XDATA],'Ydata',[Y2 YDATA]) %update data of y2 else %create new plot [handles.axis, handles.y1, handles.y2] = plotyy(handles.
My issue is that when the user selects a time series, the chart doesn't update very quickly.
But perhaps there is another way to make your function run with less screen updates?
The updates will download and install even if they are working on something, making the computer slow in some cases.
I have a workbook that has many macros that are run individually at times, but more often run in succession.
I turn off Screen Updating & Enable Events at the beginning and back on at the end for most of the macros that I run individually.
However, when these macros are part of a macro chain (triggered by a parent macro) in order to do more complex automations, the screen updating flickers on and off.
Is there any way to run a Workbook macro that automatically turns of Screen Updating whenever any macro is running and then turns it back on when the procedure is complete?