Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: what are the counter part of "thinBasic_ReturnCodeSingle"

  1. #1

    what are the counter part of "thinBasic_ReturnCodeSingle"

    i mean if i can return a float/single data type
    where are "thinBasic_ParseSingle" ?

    and why are the C interface have only rudimentary function ?

    looks like the BASIC SDK's have the whole thinBasic interface implemented.

    i can add missing thinks to the C/C++ headers
    but than the MSC xxx.lib and GCC libxxx.a files
    are out of date

    of course i can use FreeBASIC too
    but if you have C++ classes
    you must make a wrapper for FreeBasic

    and than you can write a TBXX module with FreeBASIC
    but the result would be 2 *.dlls

    From C/C++ you can write a thinBasic module
    without a second wrapper lib.

    how to handle the EXT number data type ?

    and last but not least
    i can't see any rule when params must inside of "(" ")"

    for example TBGL_Vector 1,2,3 ' no "()" are needed
    but TBGL_SetWindowTitle(hWnd,"Title") needs "()"

    "normaly" SINGLE is the most used floting point dadata type
    it has a big range of numbers and needs only 4 bytes
    i don't see the sence to use 8 bytes double or the bigger EXT format
    from a interpreted language

    sorry for all my questions but i'm new with thinBasic
    and it's currently a liltle bit confuse for me


    thanx for your help

    Joshy
    (Sorry about my bad English.)

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: what are the counter part of "thinBasic_ReturnCodeSingle"

    Eros will give you more complete reply,

    but here few sinsights:
    - C/C++ interface is behind others, as no one used it here. I think most modules are developed in PowerBASIC currently.

    - rule to determine which commands must have "()" and which not is completely up to programmer. When you use interface function like thinBasic_Parse2Numbers ... I think it allows both Command 1, 2 and Command(1, 2). It seems the tendention in last time is to prefer the "()" syntax.

    - instead of using the simple thinBasic_ParseNNumbers function, you can take full control of the parser, where you can force the "()" like:
    [code=thinbasic]
    IF thinBasic_CheckOpenParens_Mandatory() THEN
    thinBasic_ParseNumber x
    IF thinBasic_CheckComma_Mandatory() THEN
    thinBasic_ParseNumber y
    IF thinBasic_CheckCloseParens_Mandatory() THEN
    ' do something here
    END IF
    END IF
    END IF
    [/code]

    With this "sequential" parsing you can create interesting multi syntax commands, which decide what to parse on the fly.

    - EXT data type is 80bit precision floating point. I think in C/C++ it is nicknamed "long double", but not sure.


    Escaping back to school,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

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

    Re: what are the counter part of "thinBasic_ReturnCodeSingle"

    I will reply widely later when back home this evening.

    In any case, as said before, thinBasic SDK for C/C++ has just very few of the interface function available. Since the beginning there was no interest on it other than few users. In the mean time there was a bigger interest in Power Basic and Free Basic.
    As already said (again) I'm not in the position to develop C/C++ further in short time period because I'm not a C programmer. Maybe I can handover it but I have to check, so I cannot promise anything now, sorry.

    Regarding why EXT data type, EXT is the native FPU data type and the fastest.

    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

  4. #4

    Re: what are the counter part of "thinBasic_ReturnCodeSingle"

    Hi joshi,

    as i dont want to use PowerBasic for my future modules anymore, i need a current c sdk too. Next week i have more time in the evenings and so have plans to work on a new include file.

    Michael



  5. #5

    Re: what are the counter part of "thinBasic_ReturnCodeSingle"

    Quote Originally Posted by Michael Hartlef
    Hi joshi,

    as i dont want to use PowerBasic for my future modules anymore, i need a current c sdk too. Next week i have more time in the evenings and so have plans to work on a new include file.

    Michael


    Hi Joshi,

    so far not much to show. I was able to create a new import lib from the newest thincore.dll but somehow MinGW doesn't like it really because as soon I add a second command to the LoadSymbols section, ThinBasic gives a GPF when I run the script. The same C++ code works with the old import files.

    Any idea what it could be?

    Michael

  6. #6

    Re: what are the counter part of "thinBasic_ReturnCodeSingle"

    hello Michael
    here are how i would create a new import lib

    makelib.bat
    [code=DOS]pexports .\thinCore.dll > .\thinCore.def
    dlltool -k -d .\thinCore.def -l .\libthinCore.dll.a
    pause[/code]

    you can try the import lib libthinCore.dll.a from zip file

    Joshy
    (Sorry about my bad English.)

  7. #7

    Re: what are the counter part of "thinBasic_ReturnCodeSingle"

    No, no go. Can't even link with it. Thanks anyway.

  8. #8

    Re: what are the counter part of "thinBasic_ReturnCodeSingle"

    Quote Originally Posted by Michael Hartlef
    No, no go. Can't even link with it. Thanks anyway.
    why not ?

    I'm a VisualStudio Pro user and use *.lib not *.dll.a files.

    please post the error message.

    sorry wihtout it i can't help you

    Joshy
    (Sorry about my bad English.)

  9. #9

    Re: what are the counter part of "thinBasic_ReturnCodeSingle"

    please try this import lib and let me know wehats going on
    (Sorry about my bad English.)

  10. #10

    Re: what are the counter part of "thinBasic_ReturnCodeSingle"

    Quote Originally Posted by D.J.Peters
    Quote Originally Posted by Michael Hartlef
    No, no go. Can't even link with it. Thanks anyway.
    why not ?

    I'm a VisualStudio Pro user and use *.lib not *.dll.a files.

    please post the error message.

    sorry wihtout it i can't help you

    Joshy

    Hi Joshi,

    I am using Mingw with Code:Blocks. Here is the error list:

    -------------- Build: Release in thinBasic ---------------
    
    Linking dynamic library: bin\Release\thinBasic_myC.dll
    Info: resolving _thinBasic_LoadSymbol by linking to __imp__thinBasic_LoadSymbol (auto-import)
    Info: resolving _thinBasic_CheckCloseParens by linking to __imp__thinBasic_CheckCloseParens (auto-import)
    Info: resolving _thinBasic_ParseString by linking to __imp__thinBasic_ParseString (auto-import)
    Info: resolving _thinBasic_CheckOpenParens by linking to __imp__thinBasic_CheckOpenParens (auto-import)
    Creating library file: bin\Release\libthinBasic_myC.a
    C:\Programme\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
    This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.
    fu000001.o:(.idata$2+0xc): undefined reference to `__libthinCore_dll_a_iname'
    fu000003.o:(.idata$2+0xc): undefined reference to `__libthinCore_dll_a_iname'
    fu000004.o:(.idata$2+0xc): undefined reference to `__libthinCore_dll_a_iname'
    fu000006.o:(.idata$2+0xc): undefined reference to `__libthinCore_dll_a_iname'
    fu000007.o:(.idata$2+0xc): undefined reference to `__libthinCore_dll_a_iname'
    fu000009.o:(.idata$2+0xc): more undefined references to `__libthinCore_dll_a_iname' follow
    nmth000000.o:(.idata$4+0x0): undefined reference to `_nm__thinBasic_LoadSymbol'
    nmth000002.o:(.idata$4+0x0): undefined reference to `_nm__thinBasic_CheckCloseParens'
    nmth000005.o:(.idata$4+0x0): undefined reference to `_nm__thinBasic_ParseString'
    nmth000008.o:(.idata$4+0x0): undefined reference to `_nm__thinBasic_CheckOpenParens'
    collect2: ld returned 1 exit status
    Process terminated with status 1 (0 minutes, 1 seconds)
    9 errors, 1 warnings
    

Page 1 of 2 12 LastLast

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
  •