dbpax.blogg.se

Delphi xe10 static function memory leak
Delphi xe10 static function memory leak








delphi xe10 static function memory leak

Move along the string 1 position every repeatĬh := Str // At every position get that character and pass it to variable chĬase Ch of // valid char. Index := XPos // Give X position to Index. XPos := ansipos('X',Str)-1 // get position of X in the string StrLen := Length(Str) // Get the length of the string passed to the function. Result := '' // Make sure result is empty first. HasRun := 1 //Setting HasRun variable to 1 prevents converting the code twice.ĮditRadius.Enabled := False // Code is already converted so can't be run again.įunction GetXMove(Str : string) : String

delphi xe10 static function memory leak

Showmessage(' Y to B axis'+#13#10 +'conversion complete.') Showmessage(' X to A axis'+#13#10 +'conversion complete.')

delphi xe10 static function memory leak

Showmessage(' Y to A axis'+#13#10 +'conversion complete.') Showmessage(' X to B axis'+#13#10 +'conversion complete.') ltext := '(Y AXIS MOVES CONVERTED TO ROTATIONAL B AXIS)'+#13#10 ltext := '(X AXIS MOVES CONVERTED TO ROTATIONAL A AXIS)'+#13#10 ltext := '(Y AXIS MOVES CONVERTED TO ROTATIONAL A AXIS)'+#13#10 ltext := '(X AXIS MOVES CONVERTED TO ROTATIONAL B AXIS)'+#13#10 ltext := '(PROGRAM CONVERTED WITH WRAPPER)'+#13#10 Apply comments to the start of the converted program. Progressbar1.Position := Trunc(i/Linecount*105) Richedit1.Lines := NewValue // write converted line back into memo NewValue := AnsiReplaceStr(Line,(OldValue), (NewValue)) //Swap the old X or Y value with the new A or B value. OldValue := AnsiMidstr(Line,(ansipos('Y',Line)),maxint) NewValue := 'A' + Convert(OldValue,Radius) OldValue := AnsiMidstr(Line,(ansipos('X',Line)),maxint) NewValue := 'B' + Convert(OldValue,Radius) Line := Richedit1.Lines // load current line which is a string to variable 'Line' Linecount := // save the amount of lines to variable 'Linecount'ītnRun.Caption := 'Calculating' // Change caption of Run button.įor i := 0 to -1 do //from line 0 to total number of lines less 1 do the following. Radius := StrToFloat(EditRadius.Text) // Get the Stock radius from user.ĭiameter := StrToFloat(EditRadius.Text) * 2 // Convert to Diameter You must reopen file to convert with another setting.')

delphi xe10 static function memory leak

Procedure TForm1.btnRunClick(Sender: TObject)










Delphi xe10 static function memory leak