stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Upcoming Empty4 4 and MQL4 Upgrades
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3016
Page 7 of 19
Author:  boldtrader [ Tue Feb 04, 2014 10:15 pm ]
Post subject:  Re: Can't use a dot

milanese » Tue Feb 04, 2014 4:41 pm wrote:better something like the crap editor self or, Notepad++, because word can cause problems in the encoding..

Cheers :)

Tommaso
Jemook » Tue Feb 04, 2014 9:35 pm wrote:For the time being maybe put your code into Microsoft Word or Notepad and use it's find and replace feature?

Cheers
Jeremy


Notepad++ worked fine for me. Pain to have to do the extra work, but is the more simple of solutions.

Pips to all.
AnotherBrian » Wed Feb 05, 2014 4:13 am wrote:So now we have to replace all out "." dots in the variables to something else, or delete them.

This is going to be time consuming and prone to errors, opening files in the editor and using find replace.I've done two EA's and an include and what a pain in the ass.
A script would sure help move this along, even if it catches 80% of the fixes.

What we could really use is a script that will find and replace "." with "_"
It needs to look for a letter before and after the "." before it changes the "." to a "_"

I suggest a vbscript that can be run from the command line with the target filename. Any other ideas? Maybe a script run within scite? VB would be more universal.

Here is a start from a Google search. This script is not smart enough and will change all "." to "_". We need to add smarts but I don't get this VB stuff. This can even take care of the search string and the replace string, inside the code.

Any takers on a little code help? In the code below, add a filter to check the text has a letter before and after the "." before replacing. I have no idea how this would search for text, if it not taking word by word then the code below is a non-starter.

To use the script (call it replace.vbs), type a command similar to this from the command prompt:
cscript replace.vbs "C:\Scripts\Text.txt" ". " "_ "

Code: Select all

Const ForReading = 1
Const ForWriting = 2

strFileName = Wscript.Arguments(0)
strOldText = Wscript.Arguments(1)
strNewText = Wscript.Arguments(2)

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strFileName, ForReading)

strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, strOldText, strNewText)

Set objFile = objFSO.OpenTextFile(strFileName, ForWriting)
objFile.WriteLine strNewText
objFile.Close
Author:  kwanann [ Tue Feb 04, 2014 10:53 pm ]
Post subject:  Re: Upcoming Empty4 4 and MQL4 Upgrades

hmm so any "new" downloads of Empty4 will give me version 600?
Author:  SteveHopwood [ Tue Feb 04, 2014 10:56 pm ]
Post subject:  Re: Upcoming Empty4 4 and MQL4 Upgrades

kwanann » Tue Feb 04, 2014 10:53 pm wrote:hmm so any "new" downloads of Empty4 will give me version 600?
Looks like it. Jem has already posted that there is nothing he can do about it and he is on our side, so fuck help those without a broker on their side.

:D
Author:  kwanann [ Tue Feb 04, 2014 11:11 pm ]
Post subject:  Re: Upcoming Empty4 4 and MQL4 Upgrades

Haha yes, just got the short end of the stick for this one.

Seems the Empty4 PL just got a whole smackload of restrictions thrown in to deter external DLL calls, lucky for me minimal changes to what i have now since everything is offloaded to simple web calls

:yahoo:
Author:  AnotherBrian [ Tue Feb 04, 2014 11:21 pm ]
Post subject:  Re: Can't use a dot

Jemook » Tue Feb 04, 2014 4:35 pm wrote:For the time being maybe put your code into Notepad and use it's find and replace feature?

Cheers
Jeremy
That's what I did in the Empty4 editor, it has that feature. I will be painful to change all the EA's out there that use a variable such as Daily.Slope It will need to be changed to Daily_Slope or it can't be compiled in the new build.

SlipShods Sup/Res indicator has a whole bunch of these. No big deal I guess - as long as an great indi like Slipshots gets fixed and posted. There are lots of others out there.
Author:  slipshod [ Tue Feb 04, 2014 11:47 pm ]
Post subject:  Re: Can't use a dot

AnotherBrian » Wed Feb 05, 2014 9:21 am wrote:It will be painful to change all the EA's out there that use a variable such as Daily.Slope It will need to be changed to Daily_Slope or it can't be compiled in the new build.

SlipShods Sup/Res indicator has a whole bunch of these. No big deal I guess - as long as an great indi like Slipshots gets fixed and posted. There are lots of others out there.
Speaking of which, I'll do my best to get that fixed & uploaded today. Thanks for the heads-up on the indicator's thread btw, I wouldn't have known otherwise.

Edit: the new version of the indicator is now available in its thread in the Indicators forum. AnotherEdit: Library updated as well.
Author:  Elixe [ Wed Feb 05, 2014 10:53 am ]
Post subject:  Re: Upcoming Empty4 4 and MQL4 Upgrades

milanese » Yesterday, 23:41 wrote:better something like the crap editor self or, Notepad++, because word can cause problems in the encoding..

Cheers :)

Tommaso
Hi all, Notepad++ is actually a very good way to do this bulk replace, it has the builtin functionnality in Search / Find in files

Make a backup of the files you want to check, open Notepad++, go to Search / Find in files...

Find what : enter this regexp : ([A-Za-z])[.]([A-Za-z]) it will look for any text matching an alphabetic character, followed by a dot, followed by an alphabetic character.
Replace with : for instance, leave this empty as you will first execute the search through your files to check the result.
Filters : *.mq4 for all your mq4 files
Directory : select the directory where you put the copied files
Uncheck In all subfolders

And, finally in the search mode zone, click the radio button Regular Expression
Click Find All, the find result window will list all occurences found, you can double click on any of theses occurences to open the file at the specified spot.

If what you see is a GO, go again in the Find in Files, reselect the correct options & regexp, but add in Replace with the following regexp replacer : \1_\2
It will preserve the first & last part of the found item and only replace the middle one (the dot) by an underscore

take note that it will replace all dots surrounded by two characters by an underscore, that means http address, email address will be modified
Author:  meska [ Wed Feb 05, 2014 12:17 pm ]
Post subject:  Re: Can't use a dot

My favorite tool for this kind of tasks is Powergrep: it can search and replace on whole folders and subfolders using regular expressions. there is a 15 day trial on their website.

try search for this: ([\w\d]+)\.([\d\w]+)
and replace with this: \1_\2
AnotherBrian » Tue Feb 04, 2014 6:13 pm wrote:So now we have to replace all out "." dots in the variables to something else, or delete them.

This is going to be time consuming and prone to errors, opening files in the editor and using find replace.I've done two EA's and an include and what a pain in the ass.
Author:  dudest [ Wed Feb 05, 2014 1:20 pm ]
Post subject:  Re: Upcoming Empty4 4 and MQL4 Upgrades

Anyone else having an issue with MyFXB publisher EA (not sending statements) despite files being in correct place?
Author:  dietcoke [ Wed Feb 05, 2014 1:26 pm ]
Post subject:  Re: Can't use a dot

meska » Wed Feb 05, 2014 12:17 pm wrote:My favorite tool for this kind of tasks is Powergrep: it can search and replace on whole folders and subfolders using regular expressions. there is a 15 day trial on their website.

try search for this: ([\w\d]+)\.([\d\w]+)
and replace with this: \1_\2
AnotherBrian » Tue Feb 04, 2014 6:13 pm wrote:So now we have to replace all out "." dots in the variables to something else, or delete them.

This is going to be time consuming and prone to errors, opening files in the editor and using find replace.I've done two EA's and an include and what a pain in the ass.

Be careful!! that will also replace the "." in decimals and filenames.
All times are UTC Page 7 of 19