Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mac _CLIPBOARD$ Bug??
#3
Here's how it works for Windows, I don't have Mac to test it on but you aren't depending on Mac's Clipboard.
Code: (Select All)
f$ = _OpenFileDialog$("Get File to process", _CWD$, "*.bas", "any bas file", -1)
ReDim fArr$(1 To 1)
Split f$, "|", fArr$()
For i = LBound(fArr$) To UBound(fArr$)
    Print fArr$(i)
Next

' note: I buggered this twice now, FOR base 1 array REDIM MyArray (1 to 1) AS ... the (1 to 1) is not same as (1) which was the Blunder!!!
'notes: REDIM the array(0) to be loaded before calling Split '<<<< IMPORTANT dynamic array and empty, can use any lbound though
'This SUB will take a given N delimited string, and delimiter$ and create an array of N+1 strings using the LBOUND of the given dynamic array to load.
'notes: the loadMeArray() needs to be dynamic string array and will not change the LBOUND of the array it is given.  rev 2019-08-27
Sub Split (SplitMeString As String, delim As String, loadMeArray() As String)
    Dim curpos As Long, arrpos As Long, LD As Long, dpos As Long 'fix use the Lbound the array already has
    curpos = 1: arrpos = LBound(loadMeArray): LD = Len(delim)
    dpos = InStr(curpos, SplitMeString, delim)
    Do Until dpos = 0
        loadMeArray(arrpos) = Mid$(SplitMeString, curpos, dpos - curpos)
        arrpos = arrpos + 1
        If arrpos > UBound(loadMeArray) Then ReDim _Preserve loadMeArray(LBound(loadMeArray) To UBound(loadMeArray) + 1000) As String
        curpos = dpos + LD
        dpos = InStr(curpos, SplitMeString, delim)
    Loop
    loadMeArray(arrpos) = Mid$(SplitMeString, curpos)
    ReDim _Preserve loadMeArray(LBound(loadMeArray) To arrpos) As String 'get the ubound correct
End Sub

   
As you can see multiple Pathed Filenames.
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
Mac _CLIPBOARD$ Bug?? - by tothebin - 01-23-2023, 09:57 PM
RE: Mac _CLIPBOARD$ Bug?? - by bplus - 01-23-2023, 10:07 PM
RE: Mac _CLIPBOARD$ Bug?? - by bplus - 01-23-2023, 11:06 PM
RE: Mac _CLIPBOARD$ Bug?? - by mnrvovrfc - 01-24-2023, 02:55 AM
RE: Mac _CLIPBOARD$ Bug?? - by bplus - 01-24-2023, 07:30 PM
RE: Mac _CLIPBOARD$ Bug?? - by tothebin - 01-24-2023, 09:18 PM
RE: Mac _CLIPBOARD$ Bug?? - by tothebin - 01-31-2023, 11:03 PM
RE: Mac _CLIPBOARD$ Bug?? - by bplus - 01-31-2023, 11:26 PM
RE: Mac _CLIPBOARD$ Bug?? - by tothebin - 01-31-2023, 11:31 PM
RE: Mac _CLIPBOARD$ Bug?? - by mnrvovrfc - 01-31-2023, 11:37 PM
RE: Mac _CLIPBOARD$ Bug?? - by tothebin - 02-01-2023, 12:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Mac print #file crlf? BlameTroi 5 342 02-16-2026, 08:42 PM
Last Post: BlameTroi
  Mac debugger not connecting, a user error! BlameTroi 0 110 02-07-2026, 06:18 PM
Last Post: BlameTroi
  Mac current release sigabrt BlameTroi 3 238 02-05-2026, 02:26 PM
Last Post: a740g
  Joysticks on a Mac, _DEVICEINPUT() NakedApe 15 1,741 01-01-2026, 04:05 PM
Last Post: pmackay
  Either I'm doing MID$( wrong or it has a bug TDarcos 4 825 04-13-2025, 11:14 PM
Last Post: TDarcos

Forum Jump:


Users browsing this thread: 1 Guest(s)