var1 := Document.ReplaceAll does not work

Ask questions about how to create a script or swap scripts with other users.
Post Reply
dustwalker
Posts: 28
Joined: 08 Jun 2011 17:14

var1 := Document.ReplaceAll does not work

Post by dustwalker »

According to TextEd's Help, the document objects LineCount and ReplaceAll both generate integer outputs. I can assign LineCount's output to a variable, but not ReplaceAll's. Why?
For example:

Code: Select all

// Pascal script

// Global variables
var
var1, var2 : Integer;
// Enter code here
begin
  var1 := Document.LineCount;
  var2 := Document.ReplaceAll('a','a',False,False,False,False);
  ShowMessage(var1);
  ShowMessage(var2);
end.
User avatar
Rickard Johansson
Site Admin
Posts: 6577
Joined: 19 Jul 2006 14:29

Post by Rickard Johansson »

Fixed. It's working in the next version (v7.43). Thanks!
dustwalker
Posts: 28
Joined: 08 Jun 2011 17:14

Post by dustwalker »

Thank you for your fast response. And congratulations for the best text editor I have ever seen.

Best regards
dustwalker
Posts: 28
Joined: 08 Jun 2011 17:14

Re: var1 := Document.ReplaceAll does not work

Post by dustwalker »

Hello again,
I have updated RJ TextEd to version 7.43, and I still have the same problem.

Regards
User avatar
Rickard Johansson
Site Admin
Posts: 6577
Joined: 19 Jul 2006 14:29

Re: var1 := Document.ReplaceAll does not work

Post by Rickard Johansson »

I tried your script above and it seems to work properly. I get two dialogs which both display the same count value.
dustwalker
Posts: 28
Joined: 08 Jun 2011 17:14

Re: var1 := Document.ReplaceAll does not work

Post by dustwalker »

I downloaded the install file again. The command prompt program FC confirmed that this download and the previous one are identical. I Installed one of them in a clean "Windows XP Mode" virtual machine running under VMWare. I got the same behavior as in my main Windows 7 install. Document.ReplaceAll changes, for example, 122 strings, but var2 remains "0".

Best regards
User avatar
Rickard Johansson
Site Admin
Posts: 6577
Joined: 19 Jul 2006 14:29

Re: var1 := Document.ReplaceAll does not work

Post by Rickard Johansson »

It's an option issue. Replace all doesn't always display the search result list when the "Silent" argument is false. It's been fixed.

I'll release a new beta in a day or so, please try it out to confirm it is working.
dustwalker
Posts: 28
Joined: 08 Jun 2011 17:14

Re: var1 := Document.ReplaceAll does not work

Post by dustwalker »

Version 7.50 is working.

Thank you and best regards
Post Reply