I tested this with control variables, and the issue is actually in the
way it changes StringSubStr, not the hex thing.
But here it is anyway:
string hex(int i)
{
static string h = "0123456789ABCDEF";
string ret="";
int a = i % 16;
int b = (i-a)/16;
if (b>15) ret = StringConcatenate(hex(b), StringSubstr(h,a,1));
else ret = StringConcatenate(StringSubstr(h, b ,1),
StringSubstr(h,a,1));
return (ret);
}
On May 15, 8:36 am, Fx1 Inc <
i...@fx1.net> wrote:
> Hi Jos,
>
> do you mind to post us the hex() function as .mqh or .dll please? So we
> can test this case?
>
>
>
>
>
> > Hi,
>
> > the following code will produce issues when mql-locked.
>
> > Every last character of strings inserted, will turn into %00 instead
> > of the actual character it should be (or was).
>
> > string URLEncode(string toCode)
> > {
> > int max = StringLen(toCode);
> > string RetStr = "";
> > for(int i=0;i<max;i++) {
> > string c = StringSubstr(toCode,i,1);
> > int asc = StringGetChar(c, 0);
> > Print("String: ",toCode, "i: ",i, "Str: ",c," Asc: ",asc);
> > if((asc> 47&& asc< 58) || (asc> 64&& asc< 91) || (asc> 96
> > && asc< 123))
> > RetStr = StringConcatenate(RetStr,c);
> > else if (asc == 32)
> > RetStr = StringConcatenate(RetStr,"+");
> > else {
> > if(hex(asc) != "00") {
> > RetStr = StringConcatenate(RetStr,"%",hex(asc));
> > }else{
> > RetStr = StringConcatenate(RetStr,c);
> > }
> > }
> > }
> > return (RetStr);
> > }
>
> --
> *HIGH RISK DISCLOSURE:* Foreign exchange trading carries a high level of
> risk that may not be suitable for all investors. Leverage creates
> additional risk and loss exposure. Before you decide to trade foreign
> exchange, carefully consider your investment objectives, experience
> level, and risk tolerance. You could lose some or all of your initial
> investment; do not invest money that you cannot afford to lose. Educate
> yourself on the risks associated with foreign exchange trading, and seek
> advice from an independent financial or tax advisor if you have any
> questions. *ADVISORY WARNING:*Fx1.net provide references and links to
> selected blogs and other sources of economic and market information as
> an educational service to our users and we do not endorse the opinions
> or recommendations of the blogs or other sources of information. Users
> are advised to carefully consider the opinions and analysis offered in
> the blogs or other information sources in the context of the user's
> individual analysis and decision making. None of the blogs or other
> sources of information is to be considered as constituting a track
> record. Past performance is no guarantee of future results and we
> specifically advise users to carefully review all claims and
> representations made by advisors, bloggers, money managers and system
> vendors before investing any funds or opening an account with any Forex
> dealer. Any news, opinions, research, data, or other information
> contained within this website is provided as general market commentary
> and does not constitute investment or trading advice. We expressly
> disclaim any liability for any lost principal or profits without
> limitation which may arise directly or indirectly from the use of or
> reliance on such information. As with all such advisory services, past
> results are never a guarantee of future results. *US CFTC RULE 4.41* -