Results 1 to 2 of 2

Thread: Low level macros enhanced

  1. #1

    Low level macros enhanced



    Macro Block Parameters

    Pass block of data as single parameter: (enclosing the data between brackets)




    Oxygen Update http://community.thinbasic.com/index.php?topic=2517

    [code=thinbasic]
    '
    '------------------
    'MACRO BLOCK PARAMS
    '==================


    uses "oxygen","file"
    dim src as string
    src="
    #basic
    '
    def pr print %1

    pr `Hello`
    pr ( `Hello` ` ` `Sky!` )
    pr ( 21*2 )
    terminate
    "


    'msgbox 0,o2_prep src
    o2_basic src
    if len(o2_error) then msgbox 0,o2_error
    o2_exec

    [/code]

  2. #2

    Re: Low level macros enhanced


    Families of Macros with dotted names.

    Related macros can be bunched together - like methods the individual routines are referenced by dotted names. The macro members are defined inside the group macro.

    [code=thinbasic]
    '
    '--------------
    'MACRO FAMILIES
    '==============


    uses "oxygen","file"
    dim s as string
    s="
    #basic

    def mac
    (
    .hello
    (
    print `hello %1`
    )
    .goodbye
    (
    print `goobye %1`
    )
    )

    mac.hello fred
    mac.goodbye fred
    terminate

    "


    'msgbox 0,o2_prep s
    o2_basic s
    if len(o2_error) then msgbox 0,o2_error
    o2_exec


    [/code]


Similar Threads

  1. B3D - MapLet level editor
    By kryton9 in forum TBGL General
    Replies: 3
    Last Post: 31-07-2008, 21:33

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
  •