Results 1 to 3 of 3

Thread: redim byref passed array-variable

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,554
    Rep Power
    174

    redim byref passed array-variable

    i want to know something

    see the small example:
    Uses "console"
    
    Function fTest( ByRef a(), ByVal newDims As Long ) As Long
    
    ' this function shall redim some array a and return new ubound
    
      ReDim Preserve a(newDims)
      
      Function = UBound(a)
      
    End Function
    
    
    Dim foo() As Long ' the real, global array
    
    PrintL Str$( fTest( foo, 123) )
    
    PrintL "now:" & UBound(foo) ' i want it to print 123 too :(
    
    
    WaitKey
    
    thinBasic itself has a few functions that can do this as Dir_ListArray or Parse - where the passed variable to redim is mandatory a string.
    But is it possible from script-side to do similar and redim any array passed by user like that?

    Any ideas- hints?
    Last edited by ReneMiner; 24-01-2015 at 10:13.
    I think there are missing some Forum-sections as beta-testing and support

Similar Threads

  1. Redim non-dynamic array?
    By ReneMiner in forum thinBasic General
    Replies: 3
    Last Post: 11-05-2013, 00:05
  2. byref or not byref that is the question.
    By Michael Clease in forum Module SDK (Power Basic version)
    Replies: 2
    Last Post: 04-11-2010, 02:55

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •