Results 1 to 6 of 6

Thread: module maker test :)

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

    module maker test :)

    hi charles, some month ago I tested this module maker part with some problems, but now I have tried to use your oxygen module maker dll example again and it works. It was just an idea to proof it. thanks for your great work!

    I've only add a lightspeed constant value. please see the curious result with odded nine numbers after the point

    [code=thinbasic]
    '---------------------------
    'thinBasic Modules in Oxygen
    '===========================

    'MODULE TESTING SCRIPT BY FRANK

    Uses "x-men"
    MsgBox 0,greet "2: welcome to all new mutants in our school ", %MB_OK, "test OXYGEN x-men example"
    MsgBox 0,"cube parameter result ^3: " + cubed 3, %MB_OK, "test OXYGEN x-men example"
    MsgBox 0, "Light speed in a vacuum (m/sec): " + lightspeed, %MB_OK, "test OXYGEN x-men example"
    [/code]

    all more in zip file.

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

  2. #2

    Re: module maker test :)


    Hi Frank,
    This should return LightSpeed correctly. Parameter e is parsed but is otherwise unused in the function.

    Charles

    [code=thinbasic]
    '-----> frankos input--------------->
    'Light_speed_in_a_vacuum_(m/sec) , "299792458"
    '--------------------------------------------------
    function lightspeed alias `lightspeed` () as ext external
    '==================================================

    dim As Long ParensPresent
    ParensPresent = thinBasic_CheckOpenParens_Optional
    dim as ext e,lightspeed
    lightspeed = 299792458
    thinBasic_parseNumber(e)
    If ParensPresent Then thinBasic_CheckCloseParens_Mandatory
    function = lightspeed
    end function
    '-----> frankos input--------------->
    [/code]

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

    Re: module maker test :)

    hi charles, can you check my new example please ?

    [code=thinbasic]
    '---------------------------
    'thinBasic Modules in Oxygen
    '===========================

    'MODULE TESTING SCRIPT BY FRANK

    1) thinbasic test part

    Uses "x-men"
    MsgBox 0,greet "2: welcome to all new mutants in our school ", %MB_OK, "test OXYGEN x-men example"
    MsgBox 0,"cube parameter result ^3: " + cubed 3, %MB_OK, "test OXYGEN x-men example"
    MsgBox 0, "Light speed in a vacuum (m/sec): " + lightspeed, %MB_OK, "test OXYGEN x-men example"
    MsgBox 0, Str$(lightspeed)
    MsgBox 0, lightspeed
    '299792458.000010897
    '299792458.00003
    '299792458.000003815[/code]

    2. module maker dll part:

    [code=thinbasic]'Light_speed_in_a_vacuum_(m/sec) , "299792458"
    '--------------------------------------------------
    function lightspeed alias `lightspeed` () as ext external
    '==================================================

    dim As Long ParensPresent
    ParensPresent = thinBasic_CheckOpenParens_Optional
    dim lightspeed as ext
    lightspeed = 299792458
    'thinBasic_parseNumber(e)
    thinBasic_parseNumber(lightspeed)
    If ParensPresent Then thinBasic_CheckCloseParens_Mandatory
    function = lightspeed
    end function
    '-----> frankos input--------------->
    [/code]

    my three results you can see above. something wrong with "ext" ?

    all again in zip folder.

    nice day, servus, frank
    Attached Files Attached Files
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  4. #4

    Re: module maker test :)


    Sorry Frank, I do not understand what your code is trying to do. Why are you passing a parameter when calling the Lightspeed function?

    Charles

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

    Re: module maker test :)

    hello charles, the problem of parsing belongs to the numbers with the lines

    "dim lightspeed, v as ext"

    [code=thinbasic]'Light_speed_in_a_vacuum_(m/sec) , "299792458"
    '--------------------------------------------------
    function lightspeed alias `lightspeed` () as ext external
    '==================================================

    dim As Long ParensPresent
    ParensPresent = thinBasic_CheckOpenParens_Optional
    dim lightspeed, v as ext
    lightspeed = 299792458
    thinBasic_parseNumber(lightspeed)
    If ParensPresent Then thinBasic_CheckCloseParens_Mandatory
    function = lightspeed
    end function
    '-----> frankos input--------------->
    [/code]

    parsing part: If I only using one number (dim lightspeed as ext) the result for lightspeed is incorrect as you can see in my last post. If I am using two numbers (here: dim lightspeed, e as ext) the result for lightspeed is correct. that was the main reason for confusing me. perhaps something incorrect for parsing parameters with oxygen, don't know, it was only a test.

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

  6. #6

    Re: module maker test :)


    Hi Frank,

    Try removing this line in your function:

    [code=thinbasic]
    thinBasic_parseNumber(lightspeed)
    [/code]

    You then have a function that takes no parameters and simply returns LightSpeed.

    Charles

Similar Threads

  1. thinBasic Module Maker Script
    By Charles Pegge in forum Programs
    Replies: 0
    Last Post: 09-07-2009, 23:52

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
  •