PA won't recognize char using char accessor code

Discuss OrbForms Designer and PocketC Architect

PA won't recognize char using char accessor code

Postby haines on Sat Dec 06, 2008 2:06 am

I need help. The following code is supposed to read a pdb file char by char. When it reaches a '0x0A' it should insert a null char, advance the strArr string array and begin with a new string. For some reason, the if statement (at the arrow below) won't recognize the LF char, therefore, string str doesn't get reset and str eventually is just a replication of rStr. The file I am reading is a palm doc file. Can someone tell me what's going on. Why don't I use PA's StringList? I couldn't get it to accept more than 160 strings. I need 41,000 strings. file data is included below the code.
haines

void stringList(string rStr){
int i = 0, j = 0, numStrgs;
str = "\0";
strArr[0] = '\0';
while (i < strlen(rStr)) {
if(rStr[i] != '0x2c') { //<-- ---------
str = str + rStr[i];
i++;
}
else {
str[strlen(str)] = '0x00';
strArr[j]= str;
str = "\0";
j++;
i++;
}
}
numStrgs = j-1;
}


unsigned char rawData[160] = {
0x61, 0x72, 0x6B, 0x20, 0x0A, 0x61, 0x62, 0x61, 0x63, 0x69, 0x20, 0x0A,
0x61, 0x62, 0x61, 0x63, 0x6B, 0x20, 0x0A, 0x61, 0x62, 0x61, 0x63, 0x75,
0x73, 0x20, 0x0A, 0x61, 0x62, 0x61, 0x66, 0x74, 0x20, 0x0A, 0x61, 0x62,
0x61, 0x6C, 0x6F, 0x6E, 0x65, 0x20, 0x0A, 0x61, 0x62, 0x61, 0x6E, 0x64,
0x6F, 0x6E, 0x20, 0x0A, 0x61, 0x62, 0x61, 0x6E, 0x64, 0x6F, 0x6E, 0x65,
0x64, 0x20, 0x0A, 0x61, 0x62, 0x61, 0x6E, 0x64, 0x6F, 0x6E, 0x6D, 0x65,
0x6E, 0x74, 0x20, 0x0A, 0x61, 0x62, 0x61, 0x73, 0x65, 0x20, 0x0A, 0x61,
0x62, 0x61, 0x73, 0x65, 0x6D, 0x65, 0x6E, 0x74, 0x20, 0x0A, 0x61, 0x62,
0x61, 0x73, 0x68, 0x20, 0x0A, 0x61, 0x62, 0x61, 0x73, 0x68, 0x65, 0x64,
0x20, 0x0A, 0x61, 0x62, 0x61, 0x73, 0x68, 0x65, 0x64, 0x6C, 0x79, 0x20,
0x0A, 0x61, 0x62, 0x61, 0x73, 0x68, 0x6D, 0x65, 0x6E, 0x74, 0x20, 0x0A,
0x61, 0x62, 0x61, 0x74, 0x65, 0x20, 0x0A, 0x61, 0x62, 0x61, 0x74, 0x65,
0x6D, 0x65, 0x6E, 0x74, 0x20, 0x0A, 0x61, 0x62, 0x61, 0x74, 0x74, 0x6F,
0x69, 0x72, 0x20, 0x0A
};
haines
 
Posts: 29
Joined: Fri Feb 15, 2002 8:55 pm
Location: USA

Re: PA won't recognize char using char accessor code

Postby haines on Sat Dec 06, 2008 4:03 am

Forget it. I figured it out. Thanks.
haines
 
Posts: 29
Joined: Fri Feb 15, 2002 8:55 pm
Location: USA


Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 3 guests

cron