Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

charAt is returning ASCII values

Explorer ,
Feb 20, 2011 Feb 20, 2011

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

TOPICS
ActionScript
968
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 20, 2011 Feb 20, 2011

copy and paste enough of your code to see your string's definition and your charAt() method.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2011 Feb 20, 2011
LATEST


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;
}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines