Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Visual FreePro, Jr
Message
De
18/08/2020 00:39:09
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Titre:
Visual FreePro, Jr
Divers
Thread ID:
01675802
Message ID:
01675802
Vues:
148
I had someone contact me today. He's someone I've been working with teaching him how to write a compiler. He's been studying the book Compiler Construction for Digital Computers by David Gries. I got the ball rolling for him last year about this time, and have helped him off and on up through earlier this year when COVID-19 hit. I gave him basic hints on which direction to go as he was a total newbie.

He contacted me today and he's stuck with it daily. He's been studying that book and is developing a real working knowledge of compiler technology. He's even written a recursive descent JSON parser in FoxPro!

His goal is to hone his C/C++ coding skills and bring his Windows knowledge up to a sufficient level to come on board and help me finish Visual FreePro, Jr.

I've been going over the VJr code base here these past few months, and with this individual offering to step up and help possibly ... this thing may ride again.

When last we left our hero in 2016, he had the entire object hierarchy completed including _screen, _cmd, a debugger, full variable and logic support, a basic XBASE-access-only database engine, 182 functions had been completed, primitive support for ActiveX/OLE, primitive command support. Had I not gotten sick it would've been completed by now.

The completed functions thus far:
abs(), acos(), addbs(), alltrim(), alp(), asc(), asin(), at(), atan(), atc(), atn2(), between(), bfp(), bi(), bits(), bits8(), bits16(), bits32(), bits64(), bitstr(), blu(), bgr(), bgra(), cdow(), ceiling(), chr(), chrtran(), chrtranc(), cmonth(), colorize(), cos(), createobject(), curdir(), date(), datetime(), datetimex(), day(), dbundle(), dmy(), dow(), dtoc(), dtor(), dtos(), dtot(), dtox(), dtransform(), empty(), endswith(), endswithc(), evl(), exp(), floor(), forceext(), forcefname(), forcepath(), forcestem(), fv(), getwordcount(), getwordnum(), gomonth(), grayscale(), grn(), hour(), iif(), inlist(), int(), isalpha(), isdigit(), islower() isnull(), isupper(), justdrive(), justext(), justfname(), justpath(), juststem(), left(), len(), like(), log(), log10(), lower(), ltrim(), malp(), max(), mdy(), min(), minute(), mod(), month(), ncset(), nvl(), occurs(), occursc(), outside(), padc(), padl(), padr(), payment(), pi(), pow(), proper(), pv(), quarter(), ranger(), ranger2(), rat(), ratc(), replicate(), rgb(), rgba(), red(), right(), round(), rtod(), rtrim(), sec(), seconds(), secondstot(), secondstotime(), secondstotimex(), secondstox(), secondsx(), secondsxtot(), secondsxtotime(), secondsxtotimex(), secondsxtox(), set(), sign(), sign2(), sin(), space(), sqrt(), startswith(), startswithc(), strtran(), strtranc(), stuff(), sys(1, 2, 3, 5, 10, 11, 2003, 2007, 2015, 2023), sysmetric(), tan(), textmerge(), time(), timetoseconds(), timetosecondsx(), timetot(), timetox(), timex(), timextoseconds(), timextosecondsx(), timextot(), timextox(), transform(), ttoc(), ttod(), ttoseconds(), ttosecondsx(), ttotime(), ttotimex(), ttox(), type(), typedetail(), upper(), val(), vartype(), version(), week(), xtod(), xtoseconds(), xtosecondsx(), xtot(), xtotime(), xtotimex(), and year().

Also some commands are completed or partially implemented:
CLEAR, DECLARE, DEBUG (like SET STEP ON), DIMENSION, DO, FLEX (like BROWSE, but is a mini-spreadsheet), GOTO, LIST, MODIFY CLASS/COMMAND/CONNECTION/DATABASE/FILE/FORM/GENERAL/LABEL/LAYOUT/MEMO/MENU/PROCEDURE/PROJECT/QUERY/REPORT/STRUCTURE/VIEW/WINDOW partial implementation, OPEN dbc, SET mostly complete, SKIP, USE.

Here's some sample code from the RIGHT() function, C/C++:
//////////
//
// Function: RIGHT()
// Returns the right N characters of a string.
//
//////
// Version 0.58
// Last update:
//     Jul.12.2014
//////
// Change log:
//     Jul.12.2014 - Initial creation
//////
// Parameters:
//     pString      -- Character, the string to trim
//     pCount       -- Numeric, the number of characters to copy
//
//////
// Returns:
//    Character     -- The string of the right N characters
//////
    void function_right(SReturnsParams* rpar)
    {
        SVariable*  varString   = rpar->ip[0];
        SVariable*  varCount    = rpar->ip[1];
        s32         lnStart, lnLength;
        u32         errorNum;
        bool        error;
        SVariable*  result;


        //////////
        // Parameter 1 must be character
        //////
            rpar->rp[0] = NULL;
            if (!iVariable_isValid(varString) || iVariable_getType(varString) != _VAR_TYPE_CHARACTER)
            {
                iError_report_byNumber(_ERROR_P1_IS_INCORRECT, iVariable_get_relatedComp(varString), false);
                return;
            }


        //////////
        // Parameter 2 must be nmumeric
        //////
            if (!iVariable_isValid(varCount) || !iVariable_isTypeNumeric(varCount))
            {
                iError_report_byNumber(_ERROR_P2_IS_INCORRECT, iVariable_get_relatedComp(varCount), false);
                return;
            }


        //////////
        // Find out how long they want our string to be
        //////
            lnLength = iiVariable_getAs_s32(varCount, false, &error, &errorNum);
            if (error)
            {
                iError_report_byNumber(errorNum, iVariable_get_relatedComp(varCount), false);
                return;
            }


        //////////
        // Create our return result
        //////
            result = iVariable_create(_VAR_TYPE_CHARACTER, NULL, true);
            if (!result)
            {
                iError_report(cgcInternalError, false);
                return;
            }


        //////////
        // Copy as much of the source string as will fit
        //////
            if (lnLength >= varString->value.length)
            {
                // Copy only the length of the current string
                iDatum_duplicate(&result->value, &varString->value);

            } else if (lnLength > 0) {
                // We can do an extraction
                lnStart = varString->value.length - lnLength;
                iDatum_duplicate(&result->value, varString->value.data_u8 + lnStart, lnLength);
            }


        //////////
        // Return our converted result
        //////
            rpar->rp[0] = result;

    }
Répondre
Fil
Voir

Click here to load this message in the networking platform