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
short
hi petr...
all...
"better to burn out than fade away"no offence, but you are little bit like a squirrel - jumping from tree to tree Smile
(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
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 patienceWhen you need to parse 2 or 3 numbers, you can use following:
Code
thinBasic_ParseXNumbers(2, 3, a, b, c)
best wishes, Lionheart
you can't always get what you want, but if you try sometimes you might find, you get what you need
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
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.
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.
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
ok, thanks! I have understood it, yes...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 again, I will do thatDrop me a PM in german if you want.
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
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...
ok, some good advices are very welcomeDo
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)
best regards, Lionheart
you can't always get what you want, but if you try sometimes you might find, you get what you need
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
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
orscreen 17, 32
sleep 500
LINE (20, 20)-(300, 180), RGB(255,0,0), b
sleep 1000
I have checked all possibilities but without success... the thinbasic script with "line" command or other thing (I cannot find) must be the problem...LINE (x, y)-(x1, y1), RGB(255,0,0), b
@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
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]
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
Bookmarks