Page 2 of 8 FirstFirst 1234 ... LastLast
Results 11 to 20 of 79

Thread: thinbasic Lionmodule :D

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

    Re: thinbasic Lionmodule :D

    short

    hi petr...
    all...

    no offence, but you are little bit like a squirrel - jumping from tree to tree Smile
    "better to burn out than fade away"
    (neil young, rust never sleeps !)

    yes it's ok and I am in some way guilty for confusing, but it's not the problem here

    a) my first example was an external dll test with declare function and how michael has seen it quite right an extern DLL... was just the first example for me to test thinbasic.dll things... so I did this first step

    b) the "liongfx" example shows the first really own module power for thinbasic so I am be proud of it I have used the fbgfx example from FB to make it...

    c) this direction I will go with some kind of similar power of oxygen and would like to use graphic commands to realize colour things (lion-painting) and effects (lion-fx) and some more things like nurbs (lion-nurbs) scripts for thinbasic...

    that was my idea the last day, better the last nights !!!... it takes time to become a closer project... I cannot say a lot of things about it... this idea must take time, but the more I work with different scripts... the more I can say you more about my LION module project... Four days ago I haven't any idea how to build an DLL for thinbasic and until today I have realize that it can works... I am happy about it

    do I can help you with this added infos ?

    thanks for
    When you need to parse 2 or 3 numbers, you can use following:
    Code

    thinBasic_ParseXNumbers(2, 3, a, b, c)
    I will test it... must go now at work.. I am a little bit in a stressy time today and tomorrow! therefore I concentrate all the things and focussed it here with several inputs... must laugh . I can say more about the module the next days... have patience

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

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

    Re: thinbasic Lionmodule :D

    sorry... dear thinbasic friends, I have deleted this post... one more good as running example will be better than write a bible about virtuell problems, better to solve it from me

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

  3. #13

    Re: thinbasic Lionmodule :D

    Sorry Franck, I have a very hard time understanding your english. Maybe it is just me. Drop me a PM in german if you want.

  4. #14

    Re: thinbasic Lionmodule :D

    And to answer some things I understood, there are 2 things a module can do for you. You can create new thinBasic commands or create a wrapper for an external DLL. 99,9% of the time it is not just calling another command. The sources of my modules are open so if you take your time, you will see that it takes much much more then this. And 99,9% of the time it is forbidden by a license to just replicate a command by just calling it.

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

    Re: thinbasic Lionmodule :D

    hi michael, sorry, I was in a hurry... having had fun with sports (squash)...

    for me it's better to say or show my thoughts with more words than to reduce it, because I am not very familiar with coding words in english

    And to answer some things I understood, there are 2 things a module can do for you. You can create new thinBasic commands or create a wrapper for an external DLL. 99,9% of the time it is not just calling another command. The sources of my modules are open so if you take your time, you will see that it takes much much more then this. And 99,9% of the time it is forbidden by a license to just replicate a command by just calling it.
    ok, thanks! I have understood it, yes...

    Drop me a PM in german if you want.
    ok again, I will do that

    I have no problem to ask here... better one more time than loosing my head

    best regards, Lionheart
    ps: a new "thinbasic_liongfx.tbasic" example will follow... to show what I am meaning...
    you can't always get what you want, but if you try sometimes you might find, you get what you need

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

    Re: thinbasic Lionmodule :D

    hi all

    perhaps somebody with freebasic knowledge can check this code part, if it's wrong or ok - for me it's totally ok!

    part one:
    [code=thinbasic]sub Exec_LIONGFX_LINE()
    '----------------------------------------------------------------------------
    '
    '----------------------------------------------------------------------------

    Dim ParensPresent As Long
    Dim lX1 As Long, lY1 As Long
    Dim lX2 As Long, lY2 As Long
    Dim a as integer, b as integer
    Dim lRadius As Double
    Dim lColorPresent As Long
    Dim lColor As long
    Dim lR as long ,lG as long, lB as long


    '---Check if open parens is present
    ParensPresent = thinBasic_CheckOpenParens_Optional

    thinBasic_ParseLong(lX1)
    If thinBasic_CheckComma_Mandatory = TB_TRUE Then
    thinBasic_ParseLong(lY1)
    If thinBasic_CheckComma_Mandatory = TB_TRUE Then
    thinBasic_ParseLong(lX2)
    If thinBasic_CheckComma_Mandatory = TB_TRUE Then
    thinBasic_ParseLong(lY2)
    thinBasic_ParseLong(lR)
    If thinBasic_CheckComma_Mandatory = TB_TRUE Then
    thinBasic_ParseLong(lG)
    If thinBasic_CheckComma_Mandatory = TB_TRUE Then
    thinBasic_ParseLong(lB)

    LINE (lX1, lY1)-(lX2,lY2),RGB(lR, lG, lB),b
    'LINE (20, 20)-(300, 180), RGB(255,0,0), b

    EndIf
    ENDIF
    ENDIF
    ENDIF
    ENDIF
    If ParensPresent = TB_TRUE Then thinBasic_CheckCloseParens_Mandatory

    End sub[/code]

    compilation was done with success

    but the thinbasic example doesn't have fun to work with "line" part... circles are working very well

    code part two...

    Do
    incr CountCircles
    ch = liongfx_Inkey
    liongfx_locate 10, 75
    if ch <> "" then liongfx_Print "[" & ch & "]"
    liongfx_Circle rnd(100,540), rnd(100,380), rnd(10,200), rnd(1, RGB(255,255,255))
    liongfx_LINE (100,100)-(300,200), rgb(255,0,0), b '- here's the problem line!

    Loop Until ch = chr$(27)
    ok, some good advices are very welcome

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

  7. #17
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: thinbasic Lionmodule :D

    you check for (
    then a long
    then a ,
    then a long
    then a ,
    then a long
    then a ,
    then a long
    then a long
    then a ,
    then a long
    then a ,
    then a long
    then a )

    so your calling command would look like this liongfx_LINE(x1,y1,x2,y2 r,g,b)
    but i dont know what TB would do with the "y2 r" because you dont check for a comma
    [code=freebasic]ParensPresent = thinBasic_CheckOpenParens_Optional
    thinBasic_ParseLong(lX1)
    If thinBasic_CheckComma_Mandatory = TB_TRUE Then thinBasic_ParseLong(lY1)
    If thinBasic_CheckComma_Mandatory = TB_TRUE Then thinBasic_ParseLong(lX2)
    If thinBasic_CheckComma_Mandatory = TB_TRUE Then thinBasic_ParseLong(lY2)
    If thinBasic_CheckComma_Mandatory = TB_TRUE Then thinBasic_ParseLong(lColour)
    [/code]

    liongfx_LINE(x1,y1,x2,y2,Colour)
    liongfx_LINE (100,100,300,200, rgb(255,0,0))
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

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

    Re: thinbasic Lionmodule :D

    hi michael "abraxas"

    thank you for your very welcome script part... good idea... but freebasic calls a "line" command in this case... so far as I know... looks like this one... and works

    screen 17, 32
    sleep 500
    LINE (20, 20)-(300, 180), RGB(255,0,0), b
    sleep 1000
    or

    LINE (x, y)-(x1, y1), RGB(255,0,0), b
    I have checked all possibilities but without success... the thinbasic script with "line" command or other thing (I cannot find) must be the problem...

    @charles...
    -send you here my whole script project as zip-file: *.bas, *.dll, *.tbasic
    -have "thinbasic_liongfx" compiled with FB and was ok...

    a) thinbasic script: first part of script is ok
    b) second part with "liongfx_line" is still the main problem, so I have got here an error message... push escape key and you will see... perhaps you can check it... would be great...

    good night... see you, Lionheart
    ps: I have deleted the zip file and add a new working fine one in my next post of thursday
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  9. #19

    Re: thinbasic Lionmodule :D


    Hi Frank,

    Got your code working by matching the params and syntax on the thinBasic side.

    Your FB code is not expecting the b parameter.

    And in your FB parsing of LINE, you check for an optional left bracket at the start and a mandatory right bracket at the end (if the left bracket was present). So to match these parsing rules:


    [code=thinbasic]
    Do
    incr CountLines
    ch1 = liongfx_Inkey
    liongfx_locate 20, 80
    if ch1 <> "" then liongfx_Print "[" & ch & "]"

    ''PROBLEM LINES
    ''-------------
    '' liongfx_Line (100,100)-(300,200), rgb(255,0,0), b
    '' liongfx_Line (100,100),(300,200), rgb(255,0,0)', b
    '' liongfx_Line (100,100,300,200, rgb255,0,0) ', b
    '
    'BUT THESE WORK
    ''--------------
    liongfx_Line (100,100, 300,200, 255,0,0) ', b
    liongfx_Line 100,100, 300,200, 255,0,0 ', b
    liongfx_Line rnd(0,100),rnd(0,100), rnd(0,300),rnd(0,200), rnd(0,255),255,255 ', b
    Loop Until ch1 = chr$(27)

    [/code]

  10. #20
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: thinbasic Lionmodule :D

    Hi Frank,

    sorry for yesterday evening. I promised to check code but I fall sleeping as soon as I returned back from work

    Charles and Michael are right.
    First you need to decide syntyax of "liongfx_Line" command.
    When done, follow it step by step in module parsing.

    So if syntax is liongfx_Line(x1, y2, x2, y2, lColor) than follow it in module.
    Attention RGB(r,g,b) is just a single numeric expression, you do not have to parse all parameters, thinBasic will do it for you. Unless you want to parse something like: liongfx_Line(x1, y2, x2, y2, r, g, b)

    Ok, we have decided that the syntax is liongfx_Line(x1, y2, x2, y2, lColor)
    Your module code to parse the above syntax is something like:
    [code=freebasic]
    Sub Exec_LIONGFX_LINE()
    '----------------------------------------------------------------------------
    ' syntax: liongfx_Line(x1, y2, x2, y2, lColor)
    '----------------------------------------------------------------------------
    Dim pp As Long
    Dim lX As Long , lY As Long
    Dim lX1 As Long , lY1 As Long
    Dim lColor As Long

    '---Check if open parens is present
    pp = thinBasic_CheckOpenParens_Optional

    thinBasic_ParseLong(lX)
    If thinBasic_CheckComma_Mandatory = TB_TRUE Then
    thinBasic_ParseLong(lY)
    If thinBasic_CheckComma_Mandatory = TB_TRUE Then
    thinBasic_ParseLong(lX1)
    If thinBasic_CheckComma_Mandatory = TB_TRUE Then
    thinBasic_ParseLong(ly1)
    If thinBasic_CheckComma_Mandatory = TB_TRUE Then
    thinBasic_ParseLong(lColor) '---This is just a single numeric expression regardless what will be used to pass a numeric value

    Line (lX, lY)-(lX1, lY1), lColor

    End If
    End If
    End If
    End If

    If pp = TB_TRUE Then thinBasic_CheckCloseParens_Mandatory

    End Sub

    [/code]

    Hope to be of any help.
    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Page 2 of 8 FirstFirst 1234 ... LastLast

Similar Threads

  1. MOVED: thinbasic Lionmodule :D
    By Petr Schreiber in forum User tools
    Replies: 0
    Last Post: 01-08-2009, 10:59

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
  •