IT-Berater: Theo Gottwald (IT-Consultant) > Brians Board

PluriBASIC 6.0, A new way to create 64 Bit Applications.

(1/3) > >>

Brian Alvarez:
 Well, here it is.  The engine is ready to roll. It can handle a lot of the PowerBASIC stuff and more can be added very easily.

 This will make PowerBASIC development of 64 Bit applications possible.  This thing can handle very complex code and will not choke... hopefully.

 There may be some bugs or crashes here and there but nothing that a bunch of Beta testers cannot find and report, bugs can be easily fixed! I could right now develop it in itself, but i am using PluriBASIC 5.0 to do so.

 So, jump right in! If you want to try it, you will need to install a C++ compiler, and configure in PluriBASIC 6.0 beta.

 Be aware that this is a tool in development in a relatively early stage, and it will require input from you and others. Please do not expect a finished product.
Although you will be able to compile simple apps, it will take a few more days until we can be a complex app compiling, like an SDK dialog or something.

 Heres the status:


* DDT is on its way too. It will be possible and emulated almost one to one.
* MACROS are there, and removed some limitations of the PowerBASIC macros (like, not being able to use IF blocks in macrofunctions).
* Assembly is there, just needs an expert to guide us.
* UDTS and UNIONS are there.
* The IDE is in an early stage but JK IDE will be compatible as well.
* IF THEN SELECT FOR NEXT DO LOOP all those are there...
* GOTO GOSUB RETURN ON / GOTO are there. (currently working on ON ERROR GOTO)
* Pointers, yes, although everything needs testing.
* COM classes will need an expert to guide me in emulating them in C++.
* PREFIX is there too, kind of like a macro functions that expands every row.
* The engine is acceptably fast at generating C++ code, sometimes as fast as PowerBASIC (The engine can parse its own code in 1.5 seconds), but it requires an extra step to compile it. (It is prepared to output machine code too)
 There are more goodies than i can report here, but i will be working actively on the reports (after my day job) to fix them if possibly instantly.

 The engine is prepared to generate code to complex statements, but the stock code is missing. For example, it can convert:


--- Code: ---STDOUT "Hello World"
--- End code ---

to:


--- Code: ---PRINTR("Hello World", "")
--- End code ---

However, the PRINTR function is missing (see Screenshot1). However, you can create it using the C++ definitions creator (see screenshot2), just enter the name on the top textbox, and click "New" the definition will be created and you will be able to enter the code for it (See screenshot3). The engine will include it automatically (See screenshot 4).

 By the way, the engine does not include functions or UDT's unless they are used. Even user ones. :)

 SO far i havent found many unsolvable issues, most are pretty easy to overcome. A couple ones, like UBOUND and LBOUND are a bit of a challenge, but i will tackle them. Also being able to dimension arrays with specific ranges, is a bit hard bit i can do it. Although maybe we should stick to the standards and allow arrays to be resized only with a base 0.

 Anyway, any comments are welcome.






Patrice Terrier:

--- Quote --- A couple ones, like UBOUND and LBOUND are a bit of a challenge
--- End quote ---
Do you use vector or an array new/free combination?

Brian Alvarez:
For the moment it is using plain "new", but i was thinking of using someting else, like a class. What do you suggest? If you give me an example of th code that should be generated for DIM, REDIM and RESET i can make the engine generate whatever code you want.

 However, i was thinking of compatibility with Existing PowerBASIC DLLs, if possible, i would like to reatain that.

Brian Alvarez:
In fact, i will need all the C++ help and tips possible. My abilities with c++ are average.

Patrice Terrier:
Using macro definition

For array new
#define UBOUND(T) (sizeof((T)) / sizeof((T[0]))-1)

For vector
#define UBOUND(T) (T.size())

A couple of helper functions based on the use of vector


--- Code: ---wstring REPLACE(IN wstring MainString, IN wstring MatchString, IN wstring NewString) {
    size_t pos = 0;
    while((pos = MainString.find(MatchString, pos)) != std::wstring::npos) {
         MainString.replace(pos, MatchString.length(), NewString);
         pos += NewString.length();
    }
    return MainString;
}
--- End code ---


--- Code: ---long PARSECOUNT(IN wstring MainString, IN wstring MatchString) {
    long count = 0;
    size_t pos = 0;
    while((pos = MainString.find(MatchString, pos)) != std::wstring::npos) {
         ++count; ++pos;
    }
    return count;
}
--- End code ---


--- Code: ---long INSTR(IN long nIndex, IN wstring sMain, IN wstring sSearch) {
    long nRet = -1; // Not found
    long nLength = (long) (sMain.length());
    if (nLength && (sSearch.length())) {
        if (nIndex < 0) {
            nRet = (long) (sMain.rfind(sSearch, nLength + nIndex + 1)); }
        else {
            nRet = (long) (sMain.find(sSearch, nIndex));
        }
    }
    return nRet + 1;
}
--- End code ---


--- Code: ---wstring PARSE$(IN wstring sMain, IN wstring sDelim, IN long nIndex) {
    wstring sResult = $NULL;
    long nLength = (long) sDelim.length();
    if (nLength == 0) { sDelim = L","; ++nLength; } // Use comma "," as default delimiter
    sMain = RTRIM$(sMain, sDelim); sMain += sDelim;
    if (sMain.length() && nLength) {
        LONG_PTR prev_pos = 0, pos = 0, nCount = 0;
        while( (pos = sMain.find(sDelim, pos)) != std::wstring::npos ) {
            wstring substring(sMain.substr(prev_pos, pos - prev_pos));
            ++nCount;
            if (nCount == nIndex) { sResult = substring; break; }
            prev_pos = ++pos;
        }
    }
    return sResult;
}
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version