Advertisement
| 11.30.2008 at 10:35PM PST, ID: 23945959 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: |
#include <ctype.h>
#include <string>
#include <sstream>
#include <ctype.h>
#include <stdlib.h>
#include "edisnb.h"
#include "ediccb.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct WORKAREA worka;
struct WORKAREA
{
char working[4096];
};
int main (snb *snbdata, ccb *ccbdata, char *flddata, long *fldoffset, long *fldlength, worka *permarea,
char *temparea, long *templength){
std::string newValue;
std::string result;
std::string chrSign, convertedValue, strTemp;
std::ostringstream buffer;
int sign=1, intTemp=1;
for(int i=0;i<*fldlength;i++){
strTemp=flddata[i];
if(strTemp.compare("è")==0){
newValue=newValue+"e";
}else{
newValue=newValue+flddata[i];
}
}
for(unsigned int i=0;i<newValue.length();i++){
if(isalpha(newValue[i])){
sign=1;
strTemp=newValue[i];
if(strTemp.compare("{")==0){
convertedValue="0";
}else if(strTemp.compare("A")==0){
convertedValue="1";
}else if(strTemp.compare("B")==0){
convertedValue="2";
}else if(strTemp.compare("C")==0){
convertedValue="3";
}else if(strTemp.compare("D")==0){
convertedValue="4";
}else if(strTemp.compare("E")==0){
convertedValue="5";
}else if(strTemp.compare("F")==0){
convertedValue="6";
}else if(strTemp.compare("G")==0){
convertedValue="7";
}else if(strTemp.compare("H")==0){
convertedValue="8";
}else if(strTemp.compare("I")==0){
convertedValue="9";
}else if(strTemp.compare("e")==0){
sign=-1;
convertedValue="0";
}else if(strTemp.compare("}")==0){
sign=-1;
convertedValue="0";
}else if(strTemp.compare("J")==0){
sign=-1;
convertedValue="1";
}else if(strTemp.compare("K")==0){
convertedValue="2";
sign=-1;
}else if(strTemp.compare("L")==0){
convertedValue="3";
sign=-1;
}else if(strTemp.compare("M")==0){
convertedValue="4";
sign=-1;
}else if(strTemp.compare("N")==0){
convertedValue="5";
sign=-1;
}else if(strTemp.compare("O")==0){
convertedValue="6";
sign=-1;
}else if(strTemp.compare("P")==0){
convertedValue="7";
sign=-1;
}else if(strTemp.compare("Q")==0){
convertedValue="8";
sign=-1;
}else if(strTemp.compare("R")==0){
convertedValue="9";
sign=-1;
}
newValue=newValue.replace(i,1,convertedValue);
}
}
intTemp=atoi(newValue.c_str());
buffer.str("");
if(sign>0){
if(intTemp<0){
intTemp=intTemp*-1;
}
}else if(sign<0){
if(intTemp>0){
intTemp=intTemp*-1;
}
}
buffer<<intTemp;
newValue=buffer.str();
*templength=newValue.length();
for(unsigned int i=0;i<newValue.length();i++){
temparea[i]=newValue[i];
}
ccbdata->zccbrc=0;
return(0);
}
#ifdef __cplusplus
}
#endif
|
| Answered By: | Infinity08 |
| Expert Since: | 07/08/2003 |
| Accepted Solutions: | 3105 |
| Computer Expertise: | Advanced |
Advertisement