Obj string_greaterp (Obj string_or_symbol_1, Obj string_or_symbol_2) { unsigned char *string1; unsigned char *string2; sint32 length1, length2, min_length, index; unsigned char char1, g, char2, g_1; string1 = coerce_to_string(string_or_symbol_1); string2 = coerce_to_string(string_or_symbol_2); length1 = (sint32)(StrHDR(string1)->fill_length); length2 = (sint32)(StrHDR(string2)->fill_length); if (length1<length2) min_length = length1; else min_length = length2; index = 0; for (;index<min_length;index = (index+1)) { g = (string1[index]); if (('a'<=g) && (g<='z')) char1 = (unsigned char)(((sint32)g)-32); else char1 = g; g_1 = (string2[index]); if (('a'<=g_1) && (g_1<='z')) char2 = (unsigned char)(((sint32)g_1)-32); else char2 = g_1; if (char1>char2) return (Obj)(&T); else if (char1<char2) return (Obj)NULL; } return (length1>length2) ? ((Obj)(&T)) : (Obj)NULL; }
Obj string_equal (Obj string_or_symbol_1, Obj string_or_symbol_2) { unsigned char *string1; unsigned char *string2; sint32 length1, length2, index; unsigned char arg_temp, g, if_result_temp, g_1, if_result_temp_1; string1 = coerce_to_string(string_or_symbol_1); string2 = coerce_to_string(string_or_symbol_2); length1 = (sint32)(StrHDR(string1)->fill_length); length2 = (sint32)(StrHDR(string2)->fill_length); if (length1==length2) { index = 0; for (;index<length1;index = (index+1)) { g = (string1[index]); if (('a'<=g) && (g<='z')) if_result_temp = (unsigned char)(((sint32)g)-32); else if_result_temp = g; arg_temp = if_result_temp; g_1 = (string2[index]); if (('a'<=g_1) && (g_1<='z')) if_result_temp_1 = (unsigned char)(((sint32)g_1)-32); else if_result_temp_1 = g_1; if (arg_temp!=if_result_temp_1) return (Obj)NULL; } return (Obj)(&T); } else return (Obj)NULL; }
void operator=(xloper *p_op) { if(m_zStr) free(m_zStr); if(!coerce_to_string(p_op, m_zStr)) m_zStr = NULL; }
//------------------------------------------------------------------- cpp_xloper::operator char *(void) { char *p; if(coerce_to_string(&m_Op, p)) return p; return NULL; }
char *zStr(const xloper *p_op) { free(m_zStr); if(!coerce_to_string(p_op, m_zStr)) m_zStr = NULL; return m_zStr; }
void rd_tree_node::check() { // Now, check the semantics switch(type) { case ASSIGN_EXPR: // coerce expression to string if(!coerce_to_string(0)) error("=: Can't coerce to string"); break; } }
//------------------------------------------------------------------- bool cpp_xloper::GetArrayElement(WORD row, WORD column, char *&text) { text = 0; xloper *p_op = GetArrayElement(row, column); if(!p_op) return false; return coerce_to_string(p_op, text); }
//------------------------------------------------------------------- bool cpp_xloper::ConvertToString(bool ExceltoFree) { if(m_Op.xltype == xltypeStr) { m_DLLtoFree = !(m_XLtoFree = ExceltoFree); return true; } char *text; if(coerce_to_string(&m_Op, text) == false) return false; if(ExceltoFree) m_XLtoFree = true; Free(); set_to_text(&m_Op, text); m_DLLtoFree = true; return true; }
//------------------------------------------------------------------- bool cpp_xloper::GetArrayElement(DWORD offset, char *&text) { return coerce_to_string(GetArrayElement(offset), text); }
xlString(xloper *p_op) { if(!coerce_to_string(p_op, m_zStr)) m_zStr = NULL; m_zwcStr = NULL; }