Array Descriptor (split from Wiki Improvements)

Forum for discussion about the documentation project.
Juergen Kuehlwein
Posts: 284
Joined: Mar 07, 2018 13:59
Location: Germany

Re: Array Descriptor (split from Wiki Improvements)

Postby Juergen Kuehlwein » Sep 05, 2019 16:01


i need a name for my include file, a logical name would be "". But then there already is "" in \fbc-int. Two files with the same name in different directories - not a very good idea i think, this is bound to lead to confusion.

So either your "" or my "" needs a different name. Following the purpose and the naming convention started with "fbc-int" (for FreeBASIC internals), you could name your "" (and maybe future files in this folder) "". Or i would have to make it "" or something like that.

What do you think?

Posts: 3602
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Array Descriptor (split from Wiki Improvements)

Postby MrSwiss » Sep 05, 2019 16:24

JK wrote:Or i would have to make it "" or something like that.
Why not simply calling it: (ex = as in "extended") just a idea.

I've just made: "" containing a Macro and a overloaded Sub().
(along the lines of ScreenInfo(), byref returns of the four most important
parts of the new header (As ULong))

Code: Select all

' -- (c) 2019-09-05, MrSwiss

#Pragma Once

#Macro SetTypeArrayInfo(DataType)       ' define datatype for overloaded Sub
Sub ArrayInfo OverLoad( _               ' check for dynamic array
    a() As DataType, _                  ' _in_ mandatory: array as defined by macro
    ByRef t_mem As ULong = 0, _         ' _out_ opt. total memory (in Bytes)
    ByRef e_len As ULong = 0, _         ' _out_ opt. element size (dito)
    ByRef _dims As ULong = 0, _         ' _out_ opt. number of dimensions
    ByRef _flag As ULong = 0 _          ' _out_ opt. flags (all as one)
    Dim As FBC.FBARRAY Ptr pa = _
        FBC.ArrayDescriptorPtr(a())     ' get array descriptor ptr (pa)

    t_mem = CULng(pa->size)             ' original is UInteger, needs type cast
    e_len = CULng(pa->element_len)     
    _dims = CULng(pa->dimensions)
    _flag = CULng(pa->flags)            ' assure 32 bit's max. (as in FBC 32)
End Sub
' ----- EOF -----

Return to “Documentation”

Who is online

Users browsing this forum: No registered users and 2 guests