Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - jcfuller

#16
Bug Reports / Re: $INCLUDE <filename> issues
August 24, 2024, 06:17:45 AM
Kevin,
  All versions of BCX prior to 8.1.2 work.
I don't know what else to tell you but I'll putter a bit after breakfast.

James
#17
Bug Reports / Re: Re: $INCLUDE <filename> issues
August 23, 2024, 06:47:45 PM
Kevin,
  You are treating <  > the same as "  ".
BCXLIB needs to be defined for <  > to work correctly.

James
#18
Bug Reports / Re: Re: $INCLUDE <filename> issues
August 23, 2024, 04:16:58 PM
Ok I think I have it.
See Help File $INCLUDE Syntax 3

James
#19
Bug Reports / $INCLUDE <filename> issues
August 23, 2024, 03:02:41 PM
Kevin,
NOT FIXED. Same issue
James
#20
Bug Reports / $Include issue
August 23, 2024, 12:39:34 PM
Kevin,
  I have not coded in a bit and missed this issue with BCX 8.1.2 and subsequently 8.1.3
No issue with earlier builds.

$Include <TClibinc.bi>
Error: Cannot Access File or File Not Found. <TCLIBINC.BI>

#21
UbxBasic would be my work.
I used to test on every Linux update but have not done so in many years.
I have been meaning to remove it from SF but .....

You would do much better with Armando's MBC:

https://github.com/Airr/MBC

James
#22
Tips & Tricks / Re: UBOUND for Dynamic Arrays
June 26, 2024, 05:10:02 AM
Isn't _msize Microsoft only?

James
#23
Off-Topic Discussions / LibreChat
June 23, 2024, 08:20:33 AM
Kevin,
  I am not doing anything with AI but this sounded interesting?
Have you explored it?

James
#24
Bug Reports / Re: Better Late Than never ???
May 28, 2024, 03:58:26 PM
I did not remember RBFOR's addition to BCX but I did checked the help file anyway.
It's all Robert's fault! :) No reference in the help file index
With my failing memory I depend on you to keep me current.

James
#25
Bug Reports / Better Late Than never ???
May 28, 2024, 02:26:58 PM
Kevin,
  I haven't coded in quite awhile, but of course now that I want to, I find an issue that started with 7.9.1.

I know we discussed c++ "Range Based For" Loops but I don't remember when or how it went..??

I use a BCXPP.DLL to do the translation.

The test bas source (VEC4C.bas) attached

'==============================================================================
RbFor ( auto itx : s)
If itx = B$ Then
cout << "B$ match" << endl
A$ = itx.c_str()
break
End If
cout << " " << itx << endl
RbNext

'------------------------------------------------------------------------------
Translated with 7.9.0
'------------------------------------------------------------------------------

    cout << "range-based for loop" << endl;
    for  (auto itx : s) {
        if(itx == B ) {
            cout << "B$ match" << endl;
            strcpy(A, itx.c_str());
            break;
        }
        cout << " " << itx << endl;
    };

'==============================================================================
The bas code in the BCXPP.DLL:
'==============================================================================

'c++11 range-based for loops
If LeftStr(Src$,"rbfor",1) Then
iReplace "rbfor" With "! for" In Src$
Src$ = Src$ & "{"
Function = 1
EndIf

If LeftStr(Src$,"rbnext",1) Then
Src$ = "}"
Function = 1
EndIf

'------------------------------------------------------------------------------
translated to:
    if(LeftStr(Src, "rbfor", 1)) {
        strcpy(Src, iReplace(Src, "rbfor", "! for"));
        strcat(Src, "{");
        return 1;
    }
    if(LeftStr(Src, "rbnext", 1)) {
        strcpy(Src, "}");
        return 1;
    }
'==============================================================================

Bcx Hangs on the
RbFor ( auto itx : s)
Line

James


#26
Try this.

James


'REM Specifying a data block - record
'REM \CHAP_1\CH1_3.BAS

CLS
TYPE vb
DIM s AS STRING * 10
DIM n AS INTEGER
DIM dn AS LONG
DIM x AS SINGLE
DIM dx AS DOUBLE
END TYPE

DIM VarBlock AS vb
VarBlock.s = "QWERTY"
VarBlock.n = 3
VarBlock.dn = 123456789
VarBlock.x = VarBlock.dn
VarBlock.dx = 1 / VarBlock.n
PRINT VarBlock.s, VarBlock.n, VarBlock.dn
PRINT VarBlock.x, VarBlock.dx

PAUSE

END
[code]
#27
Bug Reports / Re: SetDialogScale(hWnd, 0); added
February 20, 2024, 07:08:04 AM
Crap!
It appears I did it again and did not explain myself fully.
I have no reason to believe your fix will not work. On the contrary it will work for c++ but will not for "c" coding.

I am on a new coding rig (my old Gaming box) and cannot compile a new bc.exe at present.

The "BEGIN DIALOG AS DlgProcName" is not searchable in the help file and it took me a bit to find it this am. I am aware now it is part of the BCX_DIALOG coding. As such the adding of the "SetDialogScale(hWnd, 0);" is NOT a BUG.

I am probably the only one who wants to use it with a resource dialog so I will find my own way around it.
Sorry for the inconvenience.

James
#28
Bug Reports / Re: SetDialogScale(hWnd, 0); added
February 19, 2024, 01:46:01 PM
That's a negatory. Fails with Pelles also after removing c++ stuff
It appears you cannot use "Begin Dialog As DlgProc" with a resource dialog.
For a real hack if you switch    case WM_INITDIALOG with case WM_INITDLG it works
       
James


$NOMAIN
$ONEXIT "ASTYLE.EXE -pn $FILE$.C"
$ONEXIT "PEL.BAT $FILE$ -m64 gui"

CONST MANIFEST                24
CONST IDD_DLG1                1000
CONST IDC_BTN1                1003
CONST IDC_BTN2                1004
CONST IDC_BTN3                1005
CONST IDC_STC1                1001
CONST IDC_STC2                1002
CONST IDR_XPMANIFEST1         1
CONST CTLHNDL(id) = GetDlgItem(hWnd,id)
CONST WM_INITDLG = WM_INITDIALOG
'==============================================================================
Function WinMain()
    Local As HWND hDlg
    Local As MSG Msg
Local As HFONT hFont
Dim As HWND hCtl
    hDlg = CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_DLG1),0,(DLGPROC)DlgProc,0)
    While GetMessage(&Msg,NULL, 0, 0)
        If (IsDialogMessage(hDlg, &Msg) = 0) Then
            TranslateMessage(&Msg)
            DispatchMessage(&Msg)
        End If
    Wend
   
    Function = Msg.wParam   
End Function
'==============================================================================
Begin Dialog As DlgProc


    Select Case (CBMSG)
    'This is added automagically by BCX
    'case WM_CLOSE
        '    DestroyWindow(CBHWND)
    case WM_INITDIALOG
    'case WM_INITDLG
    BCX_SET_FONT(CTLHNDL(IDC_STC2),"Tahoma",14)
    BCX_SET_FONT(CTLHNDL(IDC_STC1),"Tahoma",14)
    BCX_SET_FONT(CTLHNDL(IDC_BTN1),"Tahoma",12)
    BCX_SET_FONT(CTLHNDL(IDC_BTN2),"Tahoma",12)
    BCX_SET_FONT(CTLHNDL(IDC_BTN3),"Tahoma",12)
    case WM_DESTROY
            PostQuitMessage(0)
            Function = 0   
    case WM_COMMAND
            Select Case(CBCTL)
            case IDC_BTN3
                    PostMessage(CBHWND,WM_CLOSE,0,0)
                    CloseDialog
            End Select
    End Select
End Dialog


#29
Bug Reports / SetDialogScale(hWnd, 0); added
February 19, 2024, 10:51:13 AM
Kevin,
  SetDialogScale(hWnd, 0);
  is added to the cpp translation when a
  case WM_INITDIALOG is added to the bcx source
  Comment the WM_INITDIALOG and it is not added
  This is an rc dialog app. you will need to compile and include the res in the construction.
James


$CPP
$CPPHDR
$NOMAIN
$ONEXIT "ASTYLE.EXE -pn $FILE$.CPP"
$ONEXIT "VSCPP.BAT $FILE$ -m64 con"

$CCODE CONST
  using namespace std;
$CCODE

CONST MANIFEST                24
CONST IDD_DLG1                1000
CONST IDC_BTN1                1003
CONST IDC_BTN2                1004
CONST IDC_BTN3                1005
CONST IDC_STC1                1001
CONST IDC_STC2                1002
CONST IDR_XPMANIFEST1         1
CONST CTLHNDL(id) = GetDlgItem(hWnd,id)
$PP
'$USE USE_IMATCH USE_bc9StrParseCount USE_SetColor USE_CLIPBOARD
'$Include <BCppXLib.bi>
'==============================================================================
Function WinMain()
    Local As HWND hDlg
    Local As MSG Msg
Local As HFONT hFont
Dim As HWND hCtl
    hDlg = CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_DLG1),0,(DLGPROC)DlgProc,0)
    While GetMessage(&Msg,NULL, 0, 0)
        If (IsDialogMessage(hDlg, &Msg) = 0) Then
            TranslateMessage(&Msg)
            DispatchMessage(&Msg)
        End If
    Wend
   
    Function = Msg.wParam   
End Function
'==============================================================================
Begin Dialog As DlgProc


    Select Case (CBMSG)
    'This is added automagically by BCX
    'case WM_CLOSE
        '    DestroyWindow(CBHWND)
    case WM_INITDIALOG
    ' BCX_SET_FONT(CTLHNDL(IDC_STC2),"Tahoma",11)
    case WM_DESTROY
            PostQuitMessage(0)
            Function = 0   
    case WM_COMMAND
            Select Case(CBCTL)
            case IDC_BTN3
                    PostMessage(CBHWND,WM_CLOSE,0,0)
                    CloseDialog
            End Select
           
    End Select
End Dialog
$PP

'==============================================================================
cpp Source

// *************************************************
//      Made with BCX BASIC To C/C++ Translator
//            Version 8.0.8 (12/27/2023)
// *************************************************
//    Translated for compiling with a C++ Compiler
// *************************************************

#ifndef __cplusplus
#error A C++ compiler is required
#endif

#ifdef _MSC_VER
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#endif

#if defined(__cplusplus)
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
typedef std::string stdstr;
#endif


#include <windows.h>    // WinApi
#include <windowsx.h>   // WinApi
#include <commctrl.h>   // WinApi
#include <commdlg.h>    // WinApi
#include <direct.h>     // WinApi
#include <mmsystem.h>   // WinApi
#include <oaidl.h>      // WinApi
#include <objbase.h>    // WinApi
#include <ocidl.h>      // WinApi
#include <ole2.h>       // WinApi
#include <oleauto.h>    // WinApi
#include <olectl.h>     // WinApi
#include <richedit.h>   // WinApi
#include <shellapi.h>   // WinApi
#include <shlobj.h>     // WinApi
#include <urlmon.h>     // WinApi
#include <wchar.h>      // WinApi
#include <wctype.h>     // WinApi
#include <tchar.h>      // WinApi
#include <unknwn.h>     // WinApi
#include <wingdi.h>     // WinApi
#include <wininet.h>    // WinApi
#include <winsock.h>    // WinApi
#include <winuser.h>    // WinApi
#include <stdbool.h>    // ISO StdLib
#include <ctype.h>      // ISO StdLib
#include <math.h>       // ISO StdLib
#include <setjmp.h>     // ISO StdLib
#include <stdarg.h>     // ISO StdLib
#include <stddef.h>     // ISO StdLib
#include <stdio.h>      // ISO StdLib
#include <stdlib.h>     // ISO StdLib
#include <string.h>     // ISO StdLib
#include <time.h>       // ISO StdLib
#include <process.h>    // ISO StdLib
#include <inttypes.h>   // ISO StdLib
#include <fcntl.h>      // POSIX
#include <io.h>         // WinNT POSIX subset
#include <conio.h>      // Primitive i/o


// *************************************************
//            System Defined Macros
// *************************************************

#define BCXSTRSIZE 2048

// *************************************************
//             User Defined Macros
// *************************************************

using namespace std;
#define MANIFEST 24
#define IDD_DLG1 1000
#define IDC_BTN1 1003
#define IDC_BTN2 1004
#define IDC_BTN3 1005
#define IDC_STC1 1001
#define IDC_STC2 1002
#define IDR_XPMANIFEST1 1
#define CTLHNDL(id) GetDlgItem(hWnd,id)

// *************************************************
//                  Compiler Macros
// *************************************************

#if defined(__cplusplus)
#define overloaded
#define C_EXPORT EXTERN_C __declspec(dllexport)
#define C_IMPORT EXTERN_C __declspec(dllimport)
#else
#define C_EXPORT __declspec(dllexport)
#define C_IMPORT __declspec(dllimport)
#endif

// *************************************************
//                   Microsoft VC++
// *************************************************

#ifndef DECLSPEC_UUID
#if(_MSC_VER >= 1100) && defined(__cplusplus)
#define DECLSPEC_UUID(x)  __declspec(uuid(x))
#else
#define DECLSPEC_UUID(x)
#endif
#endif
#if (_MSC_VER >= 1900)            // earlier versions untested
#include <intrin.h>
#ifndef _rdtsc
#define _rdtsc __rdtsc   // MSVC uses 2 underscores
#endif
#pragma warning(disable: 4018) // signed/unsigned mismatch warnings
#pragma warning(disable: 4100) // unreferenced argument warnings
#pragma warning(disable: 4244) // conversion from type1 to type2 warnings
#pragma warning(disable: 4267) // conversion from type1 to type2 warnings
#pragma warning(disable: 4305) // truncation from double to float warnings
#pragma warning(disable: 4800) // forcing value to bool warnings
#pragma warning(disable: 4838) // conversion from type1 to type2 warnings
#endif

// *************************************************
//                  GCC and CLANG
// *************************************************

#if defined(__GNUC__) || defined(__clang__)
#ifndef __BCPLUSPLUS__
#include <x86intrin.h>
#endif
#pragma GCC diagnostic ignored "-Wwrite-strings"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#pragma GCC diagnostic ignored "-Wdangling-else"
#pragma GCC diagnostic ignored "-Wdeprecated"
#endif

// *************************************************
//                  Embarcadero C++
// *************************************************

#if defined(__BCPLUSPLUS__)
#if defined (_clang__)
#include <mmintrin.h>
#endif
#define _kbhit kbhit
#ifndef _rdtsc
#define _rdtsc __rdtsc  // Uses 2 underscores
#endif
#endif


// *************************************************
// Instruct Linker to Search Object/Import Libraries
// *************************************************

#if !defined(__GNUC__) && !defined(__TINYC__)
#if !(defined(__BCPLUSPLUS__) && defined(_WIN64))
#pragma comment(lib,"kernel32.lib")
#pragma comment(lib,"user32.lib")
#pragma comment(lib,"gdi32.lib")
#pragma comment(lib,"comctl32.lib")
#pragma comment(lib,"advapi32.lib")
#pragma comment(lib,"winspool.lib")
#pragma comment(lib,"shell32.lib")
#pragma comment(lib,"msimg32.lib")
#pragma comment(lib,"ole32.lib")
#pragma comment(lib,"oleaut32.lib")
#pragma comment(lib,"uuid.lib")
#pragma comment(lib,"odbc32.lib")
#pragma comment(lib,"odbccp32.lib")
#pragma comment(lib,"winmm.lib")
#pragma comment(lib,"comdlg32.lib")
#pragma comment(lib,"imagehlp.lib")
#pragma comment(lib,"version.lib")
#pragma comment(lib,"wininet.lib")
#pragma comment(lib,"urlmon.lib")
#endif
#endif


// *************************************************
//               Standard Macros
// *************************************************


// *************************************************
//               User's Prototypes
// *************************************************

int     WINAPI WinMain (HINSTANCE, HINSTANCE, LPSTR, int);
INT_PTR CALLBACK DlgProc (HWND, UINT, WPARAM, LPARAM);

// *************************************************
//            User's Global Initialized Arrays
// *************************************************


// *************************************************
//                 Runtime Functions
// *************************************************

// *************************************************
//            User's Subs and Functions
// *************************************************

int WINAPI WinMain (HINSTANCE  hInst, HINSTANCE  hPrev, LPSTR  CmdLine, int CmdShow)
{
    HWND     hDlg = {0};
    MSG      Msg = {0};
    HFONT    hFont = {0};
    HWND     hCtl = {0};
    hDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_DLG1), 0, (DLGPROC)DlgProc, 0);
    while(GetMessage(&Msg, NULL, 0, 0)) {
        if((IsDialogMessage(hDlg, &Msg) == 0)) {
            TranslateMessage(&Msg);
            DispatchMessage(&Msg);
        }
    }
    return Msg.wParam;
}


INT_PTR CALLBACK DlgProc (HWND hWnd, UINT Msg, WPARAM  wParam, LPARAM  lParam)
{
    if((Msg) == WM_INITDIALOG ) {
        SetDialogScale(hWnd, 0);
        goto L1001;
    }
    if((Msg) == WM_DESTROY ) {
        PostQuitMessage(0);
        return 0;
    }
    if((Msg) == WM_COMMAND ) {
        if((LOWORD(wParam)) == IDC_BTN3 ) {
            PostMessage(hWnd, WM_CLOSE, 0, 0);
            DestroyWindow(hWnd);
        }
    }
L1001:
    ;
    if(Msg == WM_CLOSE) DestroyWindow(hWnd);
    return EXIT_SUCCESS;
}





James

#30
Bug Reports / Re: BCX 8.0.7 & unicode
December 11, 2023, 01:27:56 PM
Kevin,
  Looks ok although I still have issues I think are unrelated to Bcx?
I'm not doing any coding at present but I do try to run through a few tests on each Bcx  and MSVC release.

James