Post Reply 
Error Msg : Unmatch control word
01-05-2015, 02:13 AM
Post: #1
Error Msg : Unmatch control word
I received an error message
"Unmatch control word"

What does that mean?
Is there a listing of error message definitions somewhere?

I tried running the program in Debug and it just crashes the Prime.

The main program was running when I had all Subroutines as separate files. (about 80)
That was until I restored the Prime, then it forgot how to access them.
Then I attempted to paste them all into one big program file. Now this.
Find all posts by this user
Quote this message in a reply
01-05-2015, 03:00 PM
Post: #2
RE: Error Msg : Unmatch control word
That looks like a missing closure keyword (example, some unclosed FOR block, etc). Post your code here.

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
01-05-2015, 07:25 PM (This post was last modified: 01-05-2015 07:39 PM by bobkrohn.)
Post: #3
RE: Error Msg : Unmatch control word
Thanks for your concern.
Let me look into that possible problem first before posting source.

The main program is a work in progress.
77 declared functions
2663 lines of code
It's a Land Surveying App

I've just about lost my patience with the Prime as it's so bug filled.
Calculator, Emulator and Connectivity Kit.
Lack of proper programming documentation.
Driver problems for connecting to PC.
The list goes on and on. Apparently it's not even a Beta version after being on the market for a year.
I just bought it a month ago.
I'll wait for the next overall update before smashing it with a hammer.

I've been programming in VB6 (on PC) since it came out.
Wrote some commercial programs too. Not a novice.
In 15 years there were only, at most, 2-3 bugs discovered in my programs.
HP is not HP anymore.
Find all posts by this user
Quote this message in a reply
01-05-2015, 08:19 PM (This post was last modified: 01-05-2015 08:20 PM by Tim Wessman.)
Post: #4
RE: Error Msg : Unmatch control word
You don't have to put everything in one file. Generally that will be easier though.

What really is critical is that the parser needs to know if something is a function when it hits it for the first time. Putting something like:

MyFunc(a,b,c);


At the top of a file works fine.


What happens when you press the CHECK button in your program editor? Normally it goes to the exact location the error is at or begins.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
01-06-2015, 12:06 AM (This post was last modified: 01-06-2015 12:09 AM by bobkrohn.)
Post: #5
RE: Error Msg : Unmatch control word
I originally had all Subroutines as separate entities.

But, when I did a BackUp then Restore, all the calls to the Subroutines would not work.
They all worked fine before the BackUp then Restore.
Apparently, they all need to be "recompiled", or whatever it's called in HP.
My understanding is that there are "hidden" executables attached to each listed program. You have to open and close each one to "recompile".
That would require manually visiting each of the 70+ subs/programs.
Someone suggested including all the subroutines into one big file.
That's what I did. In the Connectivity Kit.
I Copied/Pasted each one and wrote name down on paper to check myself.
Low and behold, random subroutines would go missing from the big file as I tried to run the big main "Mother Program".
Was able to recover them from previous BackUps, make a new .zip file and Restore that.
Did it at least 3 times for three different Subs. (No way did I drop 3 on my own)
The "Mother Program" seems to call the Subs OK however, so that's good.

I get no errors when I do the Check in Program Editor.

I may have located the source of the "Unmatch control word" msg.
Another Sub that had gone missing. It was on my handwritten check list.
I was able to locate the Call by observing what the program was attempting to do when it bombed. Yup, missing Sub.
Error WAS NOT located by an informative HP-Prime generated error message showing line number, etc.

The other immediate problem now is the capricious way that String Variable Input is working.
I've gone around and around with this.
Soon as I gather some steam I'll try a different tack on that too.
Don't use String Variables for input.

I had to do that with the same silly buggy behavior of the Shift DMS key for input.
I gave up and wrote some Subs to take the old "HP-41" input style, i.e. 45.15301234 for 45° 15’ 30.1234”. Actually, it's less trouble to key in now.
(Yes, I know you can use the Template Menu Key)

What I'm scared of is the "missing Subs" problem may be a symptom of something more evil. Random scrambling/deleting of code within a Sub.

Program Editors sure could use a Find and a Find-Replace features.
Especially in the Connectivity Kit.
Anyone with even a beginners level of expertise would know that that is a necessary function.
Find all posts by this user
Quote this message in a reply
01-06-2015, 12:27 AM (This post was last modified: 01-06-2015 12:40 AM by compsystems.)
Post: #6
RE: Error Msg : Unmatch control word
sorry for my bad English

Error Msg : Unmatch control word this happens sometimes when a function is not defined, and tries to call or function that not belongs to HOME or CAS mode

Is hard build n programs or subrutines in a single file, it is best to create separates functions. but this requires an external editor

PrimeComm is a external program editor project, which is stopped = (.

/!\ some instructions do not operate in certain modes (CAS/HOME), the good thing is that you can now specify CAS (#cas ... #end) and not CAS in a single file


An example

Code:
#cas

    // © complex algebra library
    // © complex numbers and functions
    // © version 0.01 January 2015
    // © By JaiMeza 

    cplxA := 3+4*i; // numeric complex
    cplxB := x+y*i; // symbolic complex

    // © modulus of a complex number given in standard form
    modulus(z)
    begin
        return abs(z);
    end;

    // © real part of a complex number given in standard form
    realPart(z)
    begin
        return re(z);
    end;

    // © imaginary part of a complex number given in standard form
    imagPart(z)
    begin
        return im(z);
    end;

    // © conjugate of a complex number given in standard form
    conjugat(z)
    begin
        return conj(z);
    end;

    // © argument of a complex number given in cartesian form (x,y)
    cartArg(x,y)
    begin
        // © arguments x, y
        if getMode_angle() == "RADIAN" then
            return ((π/2)*sign(y) - atan(x/y));
        else
            return ((90)*sign(y) - atan(x/y));
        end;
    end;

    //  © argument of a complex number given in cartesian form
    argument(z)
    begin
        Return arg(z)
    end;

    // © conversion from polar to cartesian form
    polarRθtoCartXY(r,θ)
    begin
        return ( [[ r*cos(θ), r*sin(θ) ]] )
    end;

    exeSample()
    begin
        cplx1 := 3+4*i;
        cplx2 := x+y*i;
        print();
        print( "*** Examples ***" ); freeze;
        print( "cplx1 = " + cplx1 );
        print( "cplx2 = " + cplx2 );
        
        print("");
        print( "modulus( " + cplx1 + ") = " + modulus(cplx1) );
        print( "modulus( " + cplx2 + ") = " + modulus(cplx2) );
        
        print("");
        print( "realpart( " + cplx1 + ") = " + realPart(cplx1) );
        print( "realpart( " + cplx2 + ") = " + realPart(cplx2) );
        
        print("");
        print( "imagpart( " + cplx1 + ") = " + imagPart(cplx1) );
        print( "imagpart( " + cplx2 + ") = " + imagPart(cplx2) );
        print("");
        print( "conjugat( " + cplx1 + ") = " + conjugat(cplx1) );
        print( "conjugat( " + cplx2 + ") = " + conjugat(cplx2) );
        
        print("");
        print("RADIAN");
        setMode_angle( "RADIAN" );
        print( "polarRθtoCartXY( 5, 0.927295218002_r ) = " + polarRθtoCartXY( 5, 0.927295218002) );
        print( "cartArg( 3, 4 ) = " + cartArg( 3, 4 ) );
        print( "argument( " + cplx1 + ") = " + approx( argument(cplx1) ) );
        
        print("");
        print("DEG");        
        setMode_angle( "DEG" );
        print( "polarRθtocartXY( 5, 53.1301023542_° ) = " + polarRθtoCartXY( 5, 53.1301023542) );
        print( "cartArg( 3, 4 ) = " + cartArg( 3, 4) );
        print( "argument( " + cplx1 + ") = " + approx( argument(cplx1) ) );
        
        freeze;
        
        return "Done";
    end;

#end // endCAS

//#home //  no CAS functions
    export getMode_angle()
    begin
        if AAngle == 1 then
            return( "RADIAN" );
        else
            if AAngle == 2 then
                return( "DEG" );
            else 
              return( "SYS_ANGLE" );
            end;
        end;
    end;
    
    export setMode_angle( angle_mode )
    begin
        if angle_mode == "RADIAN" then
            AAngle := 1
        else
            if angle_mode == "DEG" then
                AAngle := 2
            else 
              AAngle := 0
            end;
        end;
    end;
//#end;


/!\ The getMode_angle function can not be defined in CAS MODE, requires be outside, in the above code if I move the instruction (#end) to end, the code generates an error and does not say that part, I take long time to discover.


I'm happy with the evolution of the HP-Prime =), the issue is time.

I think the more power is more complex programming
Find all posts by this user
Quote this message in a reply
01-06-2015, 01:20 PM
Post: #7
RE: Error Msg : Unmatch control word
I have a slightly different work flow that works well for me, if you would like to give it a try. Rather than relying on the connectivity software, I do most of my development on the virtual calculator. Or if the project is really large and I need a bigger window to view the code, I type my code using a text editor. Then I simply copy the code into the virtual calculator, use CHECK, and then run it from there. Once all is done, I send directly from virtual calculator to the real hardware. I also copy from virtual calculator back to my text editor to update any changes I made on the virtual calculator that were needed in order to compile correctly.

Even if the virtual calculator somehow crashes, you should still have your code in one of the HP Prime folders where it stores all its data. On Windows, a crash will restart the virtual calc using a different state; just close it out and re-run the virtual calculator and it should start with the previous state.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)