Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Testing against multiple elements at a time without select case
#4
You could also try:

Code: (Select All)
Sub LoadFromTxt (txt_file$, names_list$())
  ' load a list of file names from a txt file
  Dim fp&: fp& = FreeFile
  Dim tmp$
  Dim count&: count& = 1

  Open txt_file$ For Input As fp&
  While Not EOF(fp&)
      Input fp&, tmp$
      tmp$ = LTrim$(RTrim$(tmp$))
      If tmp$ <> "" Then
        ' test for image suffix .*
        Restore
        Do
            Read Tst$
            If Tst$ = ".eod" Then Exit Do
            If Mid$(tmp$, Len(tmp$) - 4, 4) = Tst$ Then
              names_list$(count&) = tmp$
              count& = count& + 1
            End If
        Loop
      End If
  Wend
  Close fp&
End Sub
Data ".png",".bmp",".jpg",".tga",".psd",".gif",".hdr",".pic",".pnm",".pcx",".svg",".ico",".cur",".qoi",".eod"
Reply


Messages In This Thread
RE: Testing against multiple elements at a time without select case - by eoredson - 04-16-2025, 08:59 PM



Users browsing this thread: 1 Guest(s)