The agent is sending the IMP a string similar to this: V02000:B,V02001:B,V02000:D
I need to remove the V, the : from each and save the 2000 in 1 blob and the letter B in a different blobs. When I do the parsing, I can user server.log to see the result of the letter B being parsed out, then I write it to the blob, then later down then line when I read the blob, instead of the letter B, I get the value 16…???
`
agent.on(“vmem”, function(value) { //receive data from agent
local v = split(value.tostring(),",");
numvmems = 0;
local a = 0;
dlog1.flush();
dlog1t.flush();
dlog1.seek(0,'b');
dlog1t.seek(0,'b');
for (a = 0; a <= 3 ; a++){
//try{
local j = split(v[a].tostring(),":");
dlog1t.writen(j[1],'b');
server.log(j[1]);//Here server logs the letter B or D or R
local k = split(j[0].tostring(),"V");
local ak = k[0];
local vmem = (ak[0] & 7)<<12;
vmem += (ak[1] & 7)<<9;
vmem += (ak[2] & 7)<<6;
vmem += (ak[3] & 7)<<3;
vmem += (ak[4] & 7);
dlog1.writen(vmem,'w');
numvmems++;
//}
//catch(e){
// break;
//}
}
gotdlog1 = 1;
dlog1.seek(0,'b');
for (a = 0; a < numvmems; a++){
server.log(dlog1.readn('w'));
}
local tt = " ";
dlog1t.seek(0,'b');
for (a = 0; a < numvmems; a++){
tt = dlog1t.readn('b');//HERE server logs 16 Should be the letter B or D or R
server.log(tt);
}
});
`