Results 1 to 6 of 6

Thread: C Basic

  1. #1
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    C Basic

    Eros, Petr and other PowerBasic gurus here is an update to a project that could use your help. With your guy's extensive PB code, you could run it through and post recommendations. I think this a worthy project for the future of your huge code base.

    Look here first:
    http://www.ucalc.com/transform.html

    Then here:
    https://github.com/uCalc/powerbasic-to-cpp

    On another totally different front there is a new language that many of us are falling for. Take your time and give it a few days, you will see why it is very unique and could be the one language that does it all.
    I found the irc chat room very helpful and friendly also for things I got stuck on.
    http://nimrod-code.org/

    Also John has put together a lot of translator tools on his site in a nice organized manner. In addition, some experimental Basic to Nimrod tests here:
    http://www.allbasic.info/forum/index.php?board=4.0
    Last edited by kryton9; 05-11-2013 at 00:40.

  2. #2
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404
    Wow that has come along so quickly and looks great. Thanks for the update John and thanks to Charles.

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Can you please drive me into the right direction?
    Where can I get C BASIC in order to test it?

    Thanks
    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
    Hi Eros,

    This language was invented a few days ago

    And we think it has legs. Especially for BASIC programmers who want or need to go mainstream and make the transition to C. We are using GCC.

    In it's simplest form, it is this small list of #defines, which can be used to write native C code that looks like BASIC.

    The greater challenge is how to deal with dynamic strings, and other objects, which have always been integral to BASIC. I am currently writing a dynamic string library. It works in a similar way to Patrice's VC10 strings.

      #define function
      #define method
      #define gosub
      #define dim
      #define as
      #define to
      #define limit
      #define step
      #define then
      #define procedure void
      #define sub   void
      #define begin {
      #define end   }
      #define and   &&
      #define or    ||
      #define class typedef struct
      #define types typedef struct
      #define member ->
      #define addressof &
      #define has =
      #define incr ++
      #define decr --
      #define next ++
      #define prior --
      #define byref *
      #define ref   void*
      #define references = &
      #define FreeSpace free
    
    
      #define FUNCTION
      #define BEGIN_FUNCTION {
      #define END_FUNCTION }
      #define SUB void
      #define BEGIN_SUB {    
      #define END_SUB }
      #define RETURN return
      #define CALL
      #define AND &&
      #define OR ||
      #define MOD %
      #define DIM    
      #define AS
      #define LET
      #define INCR ++
      #define DECR --
      #define IF if
      #define BEGIN_IF {
      #define THEN {
      #define THEN_DO
      #define ELSE } else {    
      #define END_IF }
      #define FOR for
      #define TO ;
      #define STEP ;
      #define BEGIN_FOR {
      #define NEXT }
      #define SELECT_CASE switch
      #define BEGIN_SELECT {
      #define CASE case    
      #define _TO_ ...
      #define END_CASE break;
      #define CASE_ELSE default:
      #define END_SELECT }
      #define DO do {
      #define WHILE } while
    

    http://www.allbasic.info/forum/index.php?topic=256
    Last edited by Charles Pegge; 30-10-2013 at 10:41.

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Ok, got the idea of macro usage.

    Interesting for a quick and dirty migration/testing.
    As soon as I will have some time I will try to make a thinBasic module where no or very few strings are involved.

    Thanks a lot.
    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

  6. #6
    I'm testing out some dynamic string functions:

      types StringClassTableStruct
      begin
        method StringObject (byref Redim)   (StringObject*pthis, int n, int wi, int cnt);
        method StringObject (byref Get)     (StringObject*r, StringObject this);
        method StringObject (byref Set)     (StringObject*pthis, StringObject s);
        method char*        (byref GetChars)(char**r, StringObject this, int wi);
        method StringObject (byref SetChars)(StringObject*pthis, char*c, int le, int wi);
        method StringObject (byref GetMid)  (StringObject*r, StringObject this, int s, int le, int wi);
        method StringObject (byref SetMid)  (StringObject*pthis, StringObject s, int i);
        method StringObject (byref Join)    (StringObject*pthis, int n,...);
        method StringObject (byref Ucase)   (StringObject*r, StringObject this);
        method StringObject (byref Lcase)   (StringObject*r, StringObject this);
        method StringObject (byref Ltrim)   (StringObject*r, StringObject this);
        method StringObject (byref Rtrim)   (StringObject*r, StringObject this);
        method StringObject (byref Insert)  (StringObject*pthis, StringObject s, int i);
        method StringObject (byref Delete)  (StringObject*pthis, int i, int le);
        method StringObject (byref Chr)     (StringObject*r, int a, int wi);
        method StringObject (byref Str)     (StringObject*r, double d);
        method int          (byref Show)    (StringObject this);
        method int          (byref Asc)     (StringObject this, int i);   // also supports wide chars
        method int          (byref Instr)   (int i, StringObject this,  StringObject k);
        method double       (byref Val)     (StringObject this);
      end
      StringClassTable,*StringMethods;
    

Similar Threads

  1. Replies: 0
    Last Post: 14-07-2013, 17:27
  2. Basic md5
    By John Spikowski in forum Events
    Replies: 0
    Last Post: 19-06-2013, 08:50
  3. Basic-256 or ( Kids Basic )
    By zak in forum Development
    Replies: 2
    Last Post: 21-01-2011, 20:19
  4. Quite basic
    By Michael Clease in forum Other languages
    Replies: 0
    Last Post: 02-03-2009, 22:55
  5. FNX Basic
    By zlatkoAB in forum Other languages
    Replies: 0
    Last Post: 16-04-2008, 13:24

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
  •