Copy link to clipboard
Copied
I'm running some script using the charAt() function, that is supposed to return the character at specific indexes in a string, however for some reason it is returning ASCII values. Any ideas of why this might be?
thanks
Copy link to clipboard
Copied
copy and paste enough of your code to see your string's definition and your charAt() method.
Copy link to clipboard
Copied
Well thats where it gets a little nasty. This code is beign run on a smartfox server, and its pulling from a .mdb database cell, via SQL and jdbc-odbc driver. The cell has a 25 characters in it. And this data is in the object queryRes. The only thing that I can think of is that maybe oldString is being set to something other than a string somehow, but i havent gotten around to messing with checking that out yet.
function processUpdate(params, queryRes, obj)
{
var tempRow = queryRes.get(params.mp-1);
var newStringValue = "";
var oldString = tempRow.getItem([params.mpy]);
for( i = 0; i < 25; i++)
{
if(i != params.mpx)
{
newStringValue += oldString.charAt(i);
}else if(i == params.mpx){
if(obj == true){
newStringValue += params.dato;
}else{
newStringValue += params.dat;
}
}
}
return newStringValue;
}
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more