Recent Posts

Pages: [1] 2 3 ... 10
1
Announcements / BCX v7.9.7 is available for download
« Last post by MrBcx on Today at 05:10:52 AM »
Hello Friends,

Here is BCX 7.9.7.   It is a minor update built with the latest MSVC++ compiler.

https://bcxbasiccoders.com/archives/YahooGroups/Bcx_Files_New/Bcx797.zip

REVISIONS:
**********************************************************************************************
2022/11/28       Changes in 7.9.7 from 7.9.6
**********************************************************************************************
Robert Wishlaw : Reported $INTERFACE/$ENDINTERFACE parsing errors.  Fixed by MrBcx
Kevin Diggins  : Added more auto-detection and allowance for BCX's C++ directives





2
Questions & Answers / Re: $INTERFACE ... $ENDINTERFACE directive
« Last post by MrBcx on Today at 04:47:02 AM »

Hi MrBCX:

$INTERFACE / $ENDINTERFACE  still needs tweaking.[/b]
 

Hi Robert - I didn't know $INTERFACE / $ENDINTERFACE was broken. 

My changes in 796 fixed $NAMESPACE / $ENDNAMESPACE

Regardless, I've patched $INTERFACE / $ENDINTERFACE and I'm making a few more small
changes, so rather than re-upload 796, I'll go straight to 797.

Thank you for the bug report.
3
Questions & Answers / Re: $INTERFACE ... $ENDINTERFACE directive
« Last post by Robert on Today at 12:14:51 AM »
Hi MrBCX:

$INTERFACE ... $ENDINTERFACE

was added to a page dedicated to C++ class-oriented directives and was first documented, as far as I can tell, in BCX Help Version 6.2.1.

It seems that page vanished at some point between 2010 and now.

Here's the section that I have so far located

Code: [Select]
$INTERFACE ... $ENDINTERFACE directive


 $INTERFACE <InterfaceName> ' comments allowed
 <C++ Class Code>
 $ENDINTERFACE

This BCX code


 $INTERFACE IElectricalEquipment
public:
    virtual void PowerOn(); //Each electrical equipment can be turned on
    virtual void PowerOff(); //Each electrical equipment can be turned off
 $ENDINTERFACE

translates to


interface  IElectricalEquipment {
    public:
    virtual void PowerOn(); //Each electrical equipment can be turned on
    virtual void PowerOff(); //Each electrical equipment can be turned off
};

I'm on the case and will uncover the skullduggery that removed this. I already have a suspect.

Thanks Robert,

That sample seems vaguely familiar and the still functioning ( and needed ) $INTERFACE / $ENDINTERFACE
still works with the current versions of BCX.  Thanks for the sanity check!

Hi MrBCX:

$INTERFACE / $ENDINTERFACE still needs tweaking.

From

Code: [Select]
$INTERFACE IElectricalEquipment
  public:
  virtual void PowerOn(); //Each electrical equipment can be turned on
  virtual void PowerOff(); //Each electrical equipment can be turned off
 $ENDINTERFACE

BCX 7.9.6 outputs

Code: [Select]
interface IElectricalEquipment
  {
  public:
  virtual void PowerOn(); //Each electrical equipment can be turned on
  virtual void PowerOff(); //Each electrical equipment can be turned off
} $ENDINTERFACE;
4
Compiler Related Discussions / No Exceptions !
« Last post by Robert on November 27, 2022, 09:16:13 PM »
Coding C++?

While documenting the neglected BCX C++ exception handling keywords $TRY $CATCH $THROW $ENDTRY, I was given this guidance by Google, LLVM and Qt.

Don't use exceptions !

Google C++ Style Guide
https://google.github.io/styleguide/cppguide.html#Exceptions

LLVM Coding Standards
https://llvm.org/docs/CodingStandards.html#do-not-use-rtti-or-exceptions

Qt Coding Conventions
https://wiki.qt.io/Coding_Conventions

5
Announcements / BCX v7.9.6 is available for download
« Last post by MrBcx on November 27, 2022, 06:38:25 PM »
Hello Friends,

Here is BCX 7.9.6.   It is a minor update built with the latest MSVC++ compiler.

https://bcxbasiccoders.com/archives/YahooGroups/Bcx_Files_New/Bcx796.zip

REVISIONS:

**********************************************************************************************
2022/11/27       Changes in 7.9.6 from 7.9.5
**********************************************************************************************
Robert Wishlaw : Reported bitwise "AND NOT" error stemming from 765 bug fix.  Fixed by MrBcx

Robert Wishlaw : Reported $NAMESPACE/$ENDNAMESPACE parsing errors.  Fixed by MrBcx

Kevin Diggins  : Silenced warnings involving the initialization of MONITORINFO structures.

Kevin Diggins  : Ongoing formatting improvements to the source, output and runtime code
6
Questions & Answers / Re: $INTERFACE ... $ENDINTERFACE directive
« Last post by Robert on November 26, 2022, 10:07:12 PM »
Very good !

I will re-establish a section with those directives on the CPP page.
7
Questions & Answers / Re: $INTERFACE ... $ENDINTERFACE directive
« Last post by MrBcx on November 26, 2022, 08:23:34 PM »
Hi MrBCX:

$INTERFACE ... $ENDINTERFACE

was added to a page dedicated to C++ class-oriented directives and was first documented, as far as I can tell, in BCX Help Version 6.2.1.

It seems that page vanished at some point between 2010 and now.

Here's the section that I have so far located

Code: [Select]
$INTERFACE ... $ENDINTERFACE directive


 $INTERFACE <InterfaceName> ' comments allowed
 <C++ Class Code>
 $ENDINTERFACE

This BCX code


 $INTERFACE IElectricalEquipment
public:
    virtual void PowerOn(); //Each electrical equipment can be turned on
    virtual void PowerOff(); //Each electrical equipment can be turned off
 $ENDINTERFACE

translates to


interface  IElectricalEquipment {
    public:
    virtual void PowerOn(); //Each electrical equipment can be turned on
    virtual void PowerOff(); //Each electrical equipment can be turned off
};

I'm on the case and will uncover the skullduggery that removed this. I already have a suspect.

Thanks Robert,

That sample seems vaguely familiar and the still functioning ( and needed ) $INTERFACE / $ENDINTERFACE
still works with the current versions of BCX.  Thanks for the sanity check!

8
Does BCX has TextMate?

I've never seen TextMate mentioned on any of the BCX forums.

Isn't TextMate macOS only?
9
Questions & Answers / Re: $INTERFACE ... $ENDINTERFACE directive
« Last post by Robert on November 26, 2022, 06:54:01 PM »
Mike Henning added the, below quoted, initial C++ prototype docs in BCXHelp 5.06.012 2005-07-09.

Wayne Halsdorf added $INTERFACE ... $ENDINTERFACE to that C++ prototype section in BCX Help Version 6.2.1.

That section of the BCX documentation was removed in BCXHelp 6.5.0.

This is Mike Henning's original documentation.

Code: [Select]
Using C++ Code in BCX

Remarks :

Directives have been added to help implement a crude BCX version of a C++ class.
This is not meant to be permanent, but can be useful for testing what must be done to make BCX output C++ code.
I think at the moment for the most part it only emits C code.

Here is list of all temporary directives for C++ class work:


$CLASS/$ENDCLASS

$NAMESPACE/$ENDNAMESPACE

$USENAMESPACE

$TRY

$THROW

$CATCH

$ENDTRY


What little experimenting I have done indicates that many changes and additions will be required
to make BCX emit useful C++ code. I believe these simple directives will help ease that.

Note that using the $CLASS, $ENDCLASS and $NAMESPACE directives will automatically set UseCpp = TRUE.

Directives:


$CLASS  ' comments allowed

$ENDCLASS

The code between the $class/$endclass directives must be real C++ class code without the "class classname {" and the ending "};".

Example of C++ class:

// ***************************
C++ Version of CRectangle:
// ***************************
#include
 class CRectangle {
  int x, y;
public:
  void set_values (int a,int b) {
   x = a;
   y = b;
  }
  int area (void){return(x*y)};
} rect;


// **************************
BCX Version of CRectangle:
' ***************************

#include
 $CLASS CRectangle
  int x, y;
public:
  void set_values (int a,int b) {
   x = a;
   y = b;
  }
  int area (void){return(x*y)};
$ENDCLASS rect

$NAMESPACE 

translates to:
using namespace identifier;

Example:

$NAMESPACE std

translates to:
using namespace std;

' **************************
$TYPEDEF 

Example:
$TYPEDEF long (CALLBACK *CPP_FARPROC)(char *)

translates to:
typedef long (CALLBACK *CPP_FARPROC)(char *);

' **************************
Also added two new keywords 'NEW' and "DELETE' to be used with C++ classes.
Basically these keywords when found will just be emitted in lower case.

Note also that BCX will abort the translation if you attempt to use either of these words
without UseCpp being set to true using the -c commandline switch or the $CPP directive.

-----------------------------------------------------------
URL of a good C++ tutorial: http://www.cplusplus.com/doc/tutorial/index.html

URL of C++ tutorial for C Users: http://www.4p8.com/eric.brasseur/cppcen.html#l17
10
Questions & Answers / Re: $INTERFACE ... $ENDINTERFACE directive
« Last post by Robert on November 26, 2022, 04:37:32 PM »
Hi MrBCX:

$INTERFACE ... $ENDINTERFACE

was added to a page dedicated to C++ class-oriented directives and was first documented, as far as I can tell, in BCX Help Version 6.2.1.

It seems that page vanished at some point between 2010 and now.

Here's the section that I have so far located

Code: [Select]
$INTERFACE ... $ENDINTERFACE directive


 $INTERFACE <InterfaceName> ' comments allowed
 <C++ Class Code>
 $ENDINTERFACE

This BCX code


 $INTERFACE IElectricalEquipment
public:
    virtual void PowerOn(); //Each electrical equipment can be turned on
    virtual void PowerOff(); //Each electrical equipment can be turned off
 $ENDINTERFACE

translates to


interface  IElectricalEquipment {
    public:
    virtual void PowerOn(); //Each electrical equipment can be turned on
    virtual void PowerOff(); //Each electrical equipment can be turned off
};

I'm on the case and will uncover the skullduggery that removed this. I already have a suspect.
Pages: [1] 2 3 ... 10