Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passing fixed length string array to function
#6
I'll take a whack at it, but I didn't have the subs and functions to ref...

Code: (Select All)
REDIM ss(8) AS STRING * 8
ss(1) = "1:Ia": ss(2) = "2:Ib": ss(3) = "3:II": ss(4) = "4:III"
ss(5) = "5:IV": ss(6) = "6:V": ss(7) = "7:VI": ss(8) = "8:D"
SELECT CASE specindex
    CASE IS > 50
        DIM m AS _MEM: m = _MEM(ss)
        memsmush m, 5
        _MEMFREE m 'removes 5th element by copying upper ones down over it
        REDIM _PRESERVE ss(UBOUND(ss) - 1) AS STRING * 8
        ss(0) = "1234678"
    CASE IS <= 34
        DIM m1 AS _MEM: m1 = _MEM(ss): memsmush m1, 7: _MEMFREE m1 'removes the 7th ""    """  """
        REDIM _PRESERVE ss(UBOUND(ss) - 1) AS STRING * 8
        ss(0) = "1234568"
    CASE ELSE
        ss(0) = "12345678"
END SELECT

ch% = Chs_Key_Button("h", 540, UBOUND(ss), 50, 50, 5, scrw / 2, ss()) ' <<<This last parameter is the issue
SUB memsmush (m AS _MEM, b)
END SUB

FUNCTION Chs_Key_Button (h AS STRING, n1, ubss, n2, n3, n4, n5, ss() AS STRING * 8)
END FUNCTION
Reply


Messages In This Thread
RE: Passing fixed length string array to function - by Pete - 08-25-2022, 05:33 AM



Users browsing this thread: 5 Guest(s)