Jump to content

Al T

Members
  • Content Count

    104
  • Joined

  • Last visited

Everything posted by Al T

  1. CopyDate is called by a thread component (which is on a constant loop until the stop button is pressed or the program stops the thread): procedure TForm1.IdThreadComponent1Run(Sender: TIdThreadComponent); begin if ((OptionsUnit.OptionsForm.CleanUpBox.IsChecked = true) and (DeleteFiles = true) and (breakit=true) and (copydataActive = false) and (DeleteInProgress = false)) then begin AniIndicator1.Enabled := true; DeleteData(); end; if ((copydataActive = false) and (breakit = false) and (DeleteFiles = false) and (DeleteInProgress = false)) then //breakit = true don't create files begin AniIndicator1.Enabled := true; CopyData(); end; sleep(250); end; I think I understand... the label and copydata need to be in separate threads?
  2. [Solved Second Post] Hi... I had found out in a previous question that my Segment Fault was caused by LabelLine1.Text. Now I'm trying to figure out how to use Label.Text without creating a Segment Fault 11? I've already tried LabelLine1.BeginUpdate / EndUpdate... that doesn't stop the Segment Fault... what else could I do? while FileNameCounter<126 do begin inc(FileNameCounter); RandomFileName := FolderArea + TPath.DirectorySeparatorChar + 'ran' + IntToStr(FileNameCounter) + '.txt'; try LabelLine1.BeginUpdate; LabelLine1.Text := 'Creating: ran' + IntToStr(FileNameCounter) + '.txt'; // May cause Segment Fault 11 LabelLine1.EndUpdate; dString('Create RandomFile:'+RandomFileName); //could write a TStringList and save to it... later savetofile //sleep(500); //dString writes to a file log file. MemoryCopyToFile(RandomFileName); Except On E: Exception Do begin dString('TFile.Copy(RandomFileToCopy, RandomFileName):'+E.ClassName + ' ERROR: ' + E.Message); breakit := true; //break on error end; end; if breakit = true then exit; end;
  3. Okay... I disabled AutoSize, AutoTranslate, EnableDragHighLight, ParentShowHint and it seems to work perfectly now. I'm not going thru those to figure out the "real" problem.
  4. Solved the issue: For some reason Delphi 11 and Android 9 & 12 do not like refreshing LabelLine1.Text ... it will cause a segment fault refreshing it. I don't understand... but after commenting that line out just before the copying of a file makes it run perfectly! Even though memo1.lines is in dString... the LabelLine1.Text was the issue! This is the DEFAULT Label component that comes with Delphi 11 Enterprise! I wonder if Skia Label will handle better? try //if FileExists(RandomFileName) = true then DeleteFile(RandomFileName); ------->LabelLine1.Text := 'Creating: ran' + IntToStr(FileNameCounter) + '.txt'; dString('Create RandomFile:'+RandomFileName); sleep(50); //dString writes to a file log file. TFile.Copy(RandomFileToCopy, RandomFileName, true); Except On E: Exception Do begin dString('TFile.Copy(RandomFileToCopy, RandomFileName):'+E.ClassName + ' ERROR: ' + E.Message); breakit := true; //break on error end; end;
×