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

Possibly Related Threads…
Thread Author Replies Views Last Post
  question on determining time spent in area fistfullofnails 9 845 08-25-2025, 01:55 PM
Last Post: fistfullofnails
  Testing for program Install routine. Cross Platform Compatible. ahenry3068 8 1,214 05-20-2025, 11:19 AM
Last Post: SpriggsySpriggs
  how to get a file's modified date/time and size in bytes? madscijr 36 7,830 05-10-2025, 05:17 AM
Last Post: eoredson
  Hard time with hardware acceleration. Pete 8 1,039 03-21-2025, 11:29 PM
Last Post: Pete
  testing a number's quare root is an integer and casting to a value? madscijr 22 3,514 01-29-2025, 11:12 PM
Last Post: Pete

Forum Jump:


Users browsing this thread: 1 Guest(s)