Funny Function Result with Merlin Optimizer 3.0.6.15

mc-electronic
Benutzer
Avatar
Gender: n/a
Location: Sauerland NRW
Posts: 372
Registered: 03 / 2008
Subject:

Funny Function Result with Merlin Optimizer 3.0.6.15

 · 
Posted: 18.01.2011 - 13:28  ·  #1
Hi Merlin,

I am using the function below for getting the leading text of a string, i.e. GetLeadingText("CH1") = "CH". This routine works fine when compiled normally. When I compile it with the Optimizer I get strange results like GetLeadingText("CH1") = "CCCC". I checked in the loop the value of lCnt and I get strange values like 88..?? Any Idea?


Code
Function GetLeadingText1 (lStr : String[15]) : String[15];                       // Returns the text 'CH' in a string like 'CH15' or 'YEAR' in 'YEAR2000'
Var
   lTextStr : String[15];
   lCnt : Byte;
Begin
   lTextStr := '';
   For lCnt := 1 To Length(lStr) Do
      If lStr[lCnt] In ['0'..'9'] Then
         Return (lTextStr);
      Else
         lTextStr := lTextStr + lStr[lCnt];
      EndIf;
   EndFor;
   Return (lTextStr);
End;



I send the ASM and DSM as PM.

Best regards, Michael
Merlin
Administrator
Avatar
Gender:
Age: 24
Posts: 1373
Registered: 03 / 2005
Subject:

Re: Funny Function Result with Merlin Optimizer 3.0.6.15

 · 
Posted: 18.01.2011 - 18:39  ·  #2
Hello Michael.

This is due to a bug in the optimiser. I have e-mailed a fix to you. Details are in Change History file also sent.

@all

I have also sent the fix to Rolf for inclusion in the next release. If anyone needs it in the meantime, please let me know.

Regards

Merlin.
mc-electronic
Benutzer
Avatar
Gender: n/a
Location: Sauerland NRW
Posts: 372
Registered: 03 / 2008
Subject:

Re: Funny Function Result with Merlin Optimizer 3.0.6.15

 · 
Posted: 19.01.2011 - 17:02  ·  #3
Hi Merlin,

thank you for the update! Yes, it works now.

Cheers, Michael
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 15 · Cache Hits: 14   65   79 · Page-Gen-Time: 0.025583s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI