"unmatch control word" error message
|
12-24-2013, 03:47 AM
(This post was last modified: 12-24-2013 04:14 AM by Han.)
Post: #8
|
|||
|
|||
RE: "unmatch control word" error message
(12-24-2013 02:02 AM)Bob Frazee Wrote: Han; So you changed the how the program InputPgm was defined from InputPgm() -- no arguments -- to InputPgm(DegF, Mph) which takes two arguments. Did you realize that DegF and Mph as used are now also a local variable to the InputPgm, and distinct from the non-exported global variables of the same name? Quote:Next I got an "invalid input" error message. Well of course you would. You just changed the how InputPgm was defined, so that it now requires two input values. The program that called InputPgm was called as: InputPgm() -- without arguments -- so that is why you got the invalid input error. Quote:Went to the "WindChillPgm", and added DegF,Mph in the parenthesis of that InputPgm() statement. Now I have no errors in either program, but the values I enter into the INPUT statement, are not being returned to the main "WindChillPgm". Because you created an instance of local variables in InputPgm having the same name as global variables that you declared at the top of your source file. Local variables have highest priority in the case of variables of the same name but of different types overlapping in scope. Quote:Actually, I'm not sure how to get the variables back to the main program. I tried {DegF,Mph}:=InputPgm(DegF,Mph); in the main program but that gave me an invalid information(green i) input error as soon as I hit the check button, but it did allow me to exit the program and run it again. When I ran it, it gave me an error "bad argument type", and dumped me out of the program. Hope this helps. I'm still curious as to what "unmatch control word" is. InputPgm was not coded to return anything! Moreover, programs can only return a single object. So if you want multiple results returned, you must return a list containing each result. This list object must then be saved under a single variable within the calling program. You are completely misusing variables. You declared several non-exported global variables: Code: DegF;Mph;wct;wcto;ft; Code: WindChillIntroDisplay(DegF,Mph); Code:
None of your subroutines should need to pass global variables around. That would defeat the purpose of global variables. You simply declare them at the top and then just use them just like you would use any of the upper case variables A through Z. So WindChillIntroDisplay and all other programs should only be called (and defined) without arguments unless you are passing values not stored in a global variable. Graph 3D | QPI | SolveSys |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
"unmatch control word" error message - Bob Frazee - 12-23-2013, 09:49 PM
RE: "unmatch control word" error message - Han - 12-23-2013, 10:32 PM
RE: "unmatch control word" error message - Bob Frazee - 12-24-2013, 02:02 AM
RE: "unmatch control word" error message - Han - 12-24-2013 03:47 AM
RE: "unmatch control word" error message - Michael de Estrada - 12-23-2013, 11:19 PM
RE: "unmatch control word" error message - Bob Frazee - 12-24-2013, 02:10 AM
RE: "unmatch control word" error message - Damien - 12-23-2013, 11:42 PM
RE: "unmatch control word" error message - Bob Frazee - 12-24-2013, 02:25 AM
RE: "unmatch control word" error message - Bob Frazee - 12-24-2013, 08:44 PM
RE: "unmatch control word" error message - Han - 12-25-2013, 12:53 AM
|
User(s) browsing this thread: 3 Guest(s)