/******************************************************************************** Func:按名索号 Date:2014-11-3 Note: ********************************************************************************/ uint16 Tos_GetTaskIDByName(uint8 *Name) { uint16 i=0; while(1) { if(CompareWithString(Name,(uint8 *)Tos_TaskTcb[i].Task_Name))return i; if(++i>=Tos_TaskTotal)return Tos_TaskNull; } }
Variable::commandPrompResults Variable::CompareWith(const Variable &aVariable) const { Variable::Type type = aVariable.getType(); if (type == FLOAT || type == FLOAT) { return CompareWithFloat(aVariable.getFloat()); } else if (type == INT && type == INT) { return CompareWithInt(aVariable.getInteger()); } else if (type == STRING || type == STRING) { return CompareWithString(aVariable.getString()); } return UNDEFCMP; }