No compiler error? The second switch is with in the same brace as the case's.
vining
Posts: 4,368
DEFINE_FUNCTION fnJSON_Process_Actions(CHAR iAddAction[],CHAR iAction[],CHAR iObjTag[],CHAR iCopy[],INTEGER iFBIndx) {//note iCopy is already a copy duh STACK_VAR INTEGER i; STACK_VAR INTEGER nLVL; STACK_VAR _FB_Single sMyFB; STACK_VAR INTEGER nRecognized; nRecognized = 1; nLVL = sSBS.sBrowseState.nLevel; sMyFB.cTopTag = iAddAction; sMyFB.cTag = iAction; sMyFB.cObjTag = iObjTag; WHILE(find_string(iCopy,'":',1)) { STACK_VAR INTEGER nFBS; sMyFB.cFB_Tag = REMOVE_STRING(iCopy,'":',1); sMyFB.cFB_Tag = fnJSON_TrimLeadChars('"}{[,',sMyFB.cFB_Tag); sMyFB.cFB_Tag = fnJSON_TrimEndChars('":',sMyFB.cFB_Tag); SWITCH(iCopy[1]) { CASE '"': { GET_BUFFER_CHAR(iCopy); nFBS = find_string(iCopy,'"',1); if(nFBS) { sMyFB.cFB_VAL = GET_BUFFER_STRING(iCopy,nFBS); sMyFB.cFB_VAL = fnJSON_TrimLeadChars('"',sMyFB.cFB_VAL); sMyFB.cFB_VAL = fnJSON_TrimEndChars('"',sMyFB.cFB_VAL); } } CASE '{': { GET_BUFFER_CHAR(iCopy); nFBS = fnJSON_FindEndTag(iCopy,'{','}',1); sMyFB.cFB_VAL = GET_BUFFER_STRING(iCopy,nFBS); } CASE '[': { nFBS = fnJSON_FindEndTag(iCopy,'[',']',1); sMyFB.cFB_VAL = GET_BUFFER_STRING(iCopy,nFBS); } DEFAULT://an interger? { STACK_VAR INTEGER n; nFBS = 0; for(n=1;n<=10;n++) { if(iCopy[n] >= '0' && iCopy[n] <= '9') { nFBS = n; } else { BREAK; } } if(nFBS) { sMyFB.cFB_VAL = GET_BUFFER_STRING(iCopy,nFBS); sMyFB.cFB_VAL = fnJSON_TrimLeadChars('"',sMyFB.cFB_VAL); sMyFB.cFB_VAL = fnJSON_TrimEndChars('",',sMyFB.cFB_VAL); } } SWITCH(sMyFB.cFB_Tag) { CASE 'cmd': {sLevelList[nLVL].cCmd[iFBIndx] = sMyFB.cFB_VAL;} CASE 'params': {sLevelList[nLVL].cParams[iFBIndx] = sMyFB.cFB_VAL;} DEFAULT: { nRecognized = 0; fnJSON_DEBUG("'Process_Actions, !!, AddAction-[ ',sMyFB.cTopTag,' ], Action-[ ',sMyFB.cTag,' ], FBTAG-[ ',sMyFB.cFB_Tag,' ], VAL-[ ',sMyFB.cFB_Val,' ], FBIndx-[ ',itoa(iFBIndx),' ] :DEBUG<',ITOA(__LINE__),'>'",3); } } } if(length_string(iCopy)) { fnJSON_DEBUG("'Process_Actions, ERROR, AddAction-[ ',sMyFB.cTopTag,' ], Action-[ ',sMyFB.cTag,' ],DUMPING-[ ',iCopy,' ], FBIndx-[ ',itoa(iFBIndx),' ] :DEBUG<',ITOA(__LINE__),'>'",1); } if(nRecognized) { fnJSON_DEBUG("'Process_Actions, $$, AddAction-[ ',sMyFB.cTopTag,' ], Action-[ ',sMyFB.cTag,' ], FBTAG-[ ',sMyFB.cFB_Tag,' ], VAL-[ ',sMyFB.cFB_Val,' ], FBIndx-[ ',itoa(iFBIndx),' ] :DEBUG<',ITOA(__LINE__),'>'",3); nRecognized = 0; } } }
0
Comments