Questions tagged [findfirst]

55 questions
17
votes
2 answers

Why does FindFirst return file names that don't match the mask?

I pass the parameter value '*1.dat' to FindFirst, still the first file that the FindFirst() routine return is 46checks5.dat, very consistently. Is this a known problem? vpath:=trim(vpath); result:=true; try …
Blow ThemUp
  • 895
  • 6
  • 18
  • 29
8
votes
1 answer

Delphi Rio fails to read external storage with READ_EXTERNAL_STORAGE permissions set

I have a project that I once created in Delphi Seattle and I would now like to move to Delphi Rio. I read the directory structure on an external SD-Card using findfirst/findnext i := findfirst(datadir + '*', faanyfile, ts); datadir variable…
Andre Ruebel
  • 518
  • 3
  • 12
5
votes
4 answers

How to return upon encountering first "true" in a List[IO[Boolean]] in Scala Cats Effect

Say I have a set of rules that have a validation function that returns IO[Boolean] at runtime. case class Rule1() { def validate(): IO[Boolean] = IO.pure(false) } case class Rule2() { def validate(): IO[Boolean] = IO.pure(false) } case class…
iamsmkr
  • 800
  • 2
  • 10
  • 29
5
votes
10 answers

How to optimize $.find().first()?

I need to retrieve the first element. I do that with this code... $(element).find('.x').first(); As much as I understand, that code... Retrieves all elements from element that matched .x, Removes unneeded elements; Is there any better way to do…
daGrevis
  • 21,014
  • 37
  • 100
  • 139
5
votes
2 answers

Using multiple conditions with findfirst() in Julia

Say I have two arrays like so: x = [10, 30, 50, 99, 299] y = [3, 29, 30, 23, 55] How can I find the index where both following conditions are satisfied? x > 80 & y > 30 So for my example, I expect the return would be index 5. I imagine the…
Wingmore
  • 139
  • 7
4
votes
5 answers

Resume processing of a Java Stream after running findFirst()

Given a simple list of strings: List strings = Arrays.asList("Mary", "James", "Jim", "Camilla"); I'd like to process each item of the list with a anotherMethod() method, however the first item shall be processed additionally by…
Robert Strauch
  • 12,055
  • 24
  • 120
  • 192
3
votes
1 answer

FindFirstFile causes "There is no disc in the drive" Error

FindFirstFile function is causing "There is no disc in the drive. Please insert a disc into drive" Error. The cause of this error is that there is no sd-card in the USB stick and it's empty. My problem is that I have to scan all the drives for a…
Farooq Zaman
  • 495
  • 1
  • 6
  • 21
3
votes
5 answers

How do I find the first occurrence of a vowel and move it behind the original word (pig latin)?

I need to find the first vowel of a string in python, and I'm a beginner. I'm instructed to move the characters before the first vowel to the end of the word and add '-ay'. For example "big" becomes "ig-bay" and "string" becomes "ing-stray"…
markiv189
  • 151
  • 1
  • 3
  • 9
3
votes
1 answer

FindFirst returns folders in English - Delphi

Good morning ... I am listing all files in a directory ... But I am facing the following problem ... When folders are coming All in English ... But the operating system is Ministry of Defence for the Portuguese ... How to list it according to the …
abcd
  • 441
  • 6
  • 24
3
votes
1 answer

Search multiple fields access using findfirst criteria in VBA

The following code is populating values on a form after it finds a match in a Mobile phone records table, in the criteria, how can I search for the value in 2 different fields? I could replace the combo box with a text box and would like to search…
user1687929
  • 143
  • 2
  • 2
  • 12
3
votes
2 answers

jQuery. Function to find first div containing invalid fields

I have a form divided into three tabs and validate it with jQuery validation plugin. User can switch between tabs with links. After submit button is pushed and validation failed, error class is being added to links which corresponding…
Mitya Ustinov
  • 903
  • 3
  • 11
  • 17
2
votes
3 answers

How use stream parallel and filter and findFirst shortcircuit

I have a list of TxnTypes with different complexities (process durations). I want to find matched TxnType from the list. I tried to implement it by mixing parallel processing and short-circuit filter features of the stream. but I noticed there is…
Moh Tarvirdi
  • 685
  • 1
  • 13
  • 25
2
votes
3 answers

Delphi search for files in a thread

Got this pretty straight forward function to search for files: function FindFiles(const Path, Mask: string; IncludeSubDir: boolean): integer; var FindResult: integer; SearchRec: TSearchRec; begin Result := 0; FindResult := FindFirst(Path +…
user645976
2
votes
1 answer

VBA: type mismatch in rs.findfirst

I have this code: Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset("tblJobs", dbOpenDynaset) rs.FindFirst "EmpNo=" & "'cbEmpNo.Value'" & " And " & "JobNo=" & "'cbJobNo.Value'" and I've been getting type mismatch (removing the ' doesn't…
Igal Klebanov
  • 348
  • 2
  • 15
2
votes
2 answers

Unexpected behaviour with .FindFirst VBA MS Access function: .NoMatch always returns true

View the following lines of code below. Dim rst As DAO.Recordset Dim strSql As String strSql = "SELECT * FROM MachineSettingsT;" Set rst = DBEngine(0)(0).OpenRecordset(strSql) rst.FindFirst "Microwave = " & "'" & Me.Microwave & "'" & " AND…
jaromey
  • 666
  • 2
  • 10
  • 27
1
2 3 4