Results 1 to 2 of 2

Thread: "any" and "ptr" :)

  1. #1
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    51
    Posts
    941
    Rep Power
    111

    "any" and "ptr" :)

    hi all

    how can I find more about these thinbasic commands "any" and "ptr" ??? the help manual is silent..

    '- testscript with "any" and "ptr" by lionheart

    uses "console"

    DECLARE SUB PrintFirstByte( x as any ptr ) '- ptr is not necessary

    dim i,k as integer
    dim z,v as string * 48
    dim s as string
    i = -1
    k = -100
    s = "hello World!"
    z = "hello brave new World!"
    v = "nothing is impossible with thinbasic!"
    printl
    PrintFirstByte i
    printl
    Printl s
    Printl z
    Printl v
    printl
    PrintFirstByte k
    printl
    waitkey

    SUB PrintFirstByte( x as any )
    printl x
    printl k
    END SUB
    found it also last night in a freebasic script and have translated and changed / improved it for thinbasic

    best regards, Lionheart
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  2. #2

    Re: "any" and "ptr" :)


    Hi Frank,

    any is a sort of wild card - any data type id accepted whether it's a dword or double or a UDT.

    ptr means the address of the variable is passed - not the contents of the variable.

    qualifying a parameter as byval .. as any ptr is a way of bypassing type checking.

    Charles

Similar Threads

  1. Uses "File", "Crypto" ... ???
    By marcuslee in forum thinBasic General
    Replies: 3
    Last Post: 01-12-2009, 19:38

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
  •