terrypin Posted March 15, 2013 Report Share Posted March 15, 2013 The standard test for an empty clipboard If Clipboard Equals "" seems to take much longer than this alternative, assuming T1 holds the selected text. Variable Set Integer %N[1]% to the length of variable %T[1]%If Variable %N[1]% Equals "0" In some lengthy iterations that approach might produce a useful speed improvement? Is my assumption correct, that only an empty string has a length of zero? --Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
Cory Posted March 19, 2013 Report Share Posted March 19, 2013 Don't forget that the Windows Clipboard is far more complex that just something that contains plain text. Quote Link to comment Share on other sites More sharing options...
redwards Posted April 5, 2013 Report Share Posted April 5, 2013 The same holds true for VisualBasic 6. I always use the command If Len(variable) = 0 Than. Numeric compare are much faster than string compare. I don't know what language Macro Express was created with but I guess the same holds true for that complier. Quote Link to comment Share on other sites More sharing options...
Cory Posted April 9, 2013 Report Share Posted April 9, 2013 It's not the comparison that takes up a lot of time. It's the speed of the process of inducting the contents of the clipboard. MEP does not simply grab the contents but rather there is a routine that does some sort of checking or something to make it more stable for the user. Also the Windows Clipboard itself and lag at times. As an asside MEP is written in Delphi. Also in VB I find the string.isnullorempty() or string.isnullorwhitespace() to be very quick. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.