Home AMX User Forum NetLinx Studio

Why am I getting this warning?

Hi everyone,

Maybe it's lack of sleep, but I can't figure out why I'm getting this warning:

WARNING: DVDO VP50 Module\DVDO_VP50_Comm.axs(784): C10570: Converting a string to a [INTEGER]

(***********************************************************)
(*               VARIABLE DEFINITIONS GO BELOW             *)
(***********************************************************)
DEFINE_VARIABLE
STRUCTSTATUS strDVDOSTATUS
CHAR sQUEUE [110]
CHAR sRESPONSE[18]
CHAR sRESPONSE_QEUE[100]


(***********************************************************)
(*        SUBROUTINE/FUNCTION DEFINITIONS GO BELOW         *)
(***********************************************************)
DEFINE_CALL 'PARSE01' (sRESPONSE) //command response
{
  SEND_STRING 0,"'sRESPONSE=',sRESPONSE"
  SELECT
  {
   ACTIVE (sRESPONSE="'01051',$00,'30',$00,'5C',$03"):  //CMD Received O.K.
	 {
	  SEND_STRING 0,'Command Received O.K.;'
	 }
	 
  }
}


(***********************************************************)
(*                THE EVENTS GO BELOW                      *)
(***********************************************************)
DEFINE_EVENT
DATA_EVENT [dvSCALER]//RESPONSE STRINGS RECEIVED FROM DEVICE
  {
   STRING:
	 {
		STACK_VAR INTEGER nPACKET_TYPE
		sRESPONSE_QEUE="sRESPONSE_QEUE,data.text"
		IF (FIND_STRING (sRESPONSE_QEUE,"$03",1))
		{
		  IF (FIND_STRING(sRESPONSE_QEUE,"$02",1))
		  {
			 REMOVE_STRING(sRESPONSE_QEUE,"$02",1)
			 sRESPONSE="REMOVE_STRING(sRESPONSE_QEUE,"$03",1)"
			 CLEAR_BUFFER sRESPONSE_QEUE
			 nPACKET_TYPE=ATOI(LEFT_STRING("sRESPONSE",2))
			 SWITCH(nPACKET_TYPE)
			 {
(*line784*)  	          CASE 1: //THIS IS A CMD RECV'D RESPONSE
				{CALL 'PARSE01' (sRESPONSE)}
				
			  CASE 2: //THIS IS AN ERROR RESPONSE
				{CALL 'PARSE02' (sRESPONSE)}
			  
                          CASE 21: //THIS IS A RESPONSE TO A QUERY
				{CALL 'PARSE21' (sRESPONSE)}
			 }
		  }
		}
	 }
  }


The program works o.k., but I get the same warning for each of the CALLs. I'm just wondering why.

Thanks.


--John

Comments

  • mpullinmpullin Posts: 949
    DEFINE_CALL 'PARSE01' (sRESPONSE) //command response

    Your function header does not specify a data type for the sRESPONSE parameter, so NetLinx assumes it is an integer. (If it were an array NetLinx would assume it is an array of chars) So when you send the character array sRESPONSE to this call, it thinks you're passing a string into an integer position:

    CALL 'PARSE01' (sRESPONSE)

    You're confusing yourself by using a global variable sRESPONSE which is a string and a local variable with the same name that is an integer by default. Just use different names for these variables and you'll be doin' fine.
  • Doh!

    Thanks Matt.

    Looked at it for 20 minutes and didn't catch that I did that.
    This of course after spending 2 hours the night prior not noticing that I forgot to enclose a variable in quotes in another parsing statement in this module : sERROR=MID_STRING("sRESPONSE",5,1)
    Forgetting to put sRESPONSE in quotes caused all kinds of problems.

    So happy today's Friday. It is Friday isn't it? :)

    DEFINE_CALL 'PARSE01' (char sPARSE_RESPONSE[]) //command response
    {
      SEND_STRING 0,"'sPARSE_RESPONSE=',sPARSE_RESPONSE"
      SELECT
      {
       ACTIVE (sPARSE_RESPONSE="'01051',$00,'30',$00,'5C',$03"):  //CMD Received O.K.
    	 {
    	  SEND_STRING 0,'Command Received O.K.;'
    	 }
    	 
      }
    }
    


    --John
  • DHawthorneDHawthorne Posts: 4,584
    Looked at it for 20 minutes and didn't catch that I did that.

    If I had a dollar for every time I did something like that, I could retire early (well, at least a day or two early :)). Sometimes the most productive thing to do when spinning your wheels is to work on something else for a while and come back to it (preferably, the next morning). It's too bad deadlines aren't always so flexible.
Sign In or Register to comment.