Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Testing against multiple elements at a time without select case
#2
Something similar to this?

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&

Open txt_file$ For Input As fp&
While Not EOF(fp&)
Line Input #fp&, tmp$
tmp$ = Right$(_Trim$(tmp$), 4)
If Len(tmp$) = 4 Then
If InStr(".png.bmp.jpg.tga.psd.gif.hdr.pic.pnm.pcx.svg.ico.cur.qoi", tmp$) Then
count& = count& + 1
names_list$(count&) = tmp$
Else
Print "Unknown file type " + tmp$
End If
End If
Wend
Close #fp&
End Sub
Reply


Messages In This Thread
RE: Testing against multiple elements at a time without select case - by SMcNeill - 04-16-2025, 08:10 AM



Users browsing this thread: 1 Guest(s)