Code: Select all
{{"MSEQ" ,"N",2,0},;
{"MAGENT" ,"C",dwAgtNoFieldLen,0},;
{"MAGTPCT" ,"N",5,1},;
{"MAGTLVL" ,"C",dwAgtLvlFieldLen,0},;
{"MAGTOR" ,"C",2,0},;
{"MHCOMMIP" ,"L",1,0}}
Code: Select all
LOCAL oAgentServer AS bArrayServer
oAgentServer := SELF:Owner:oDCBB_EditAgent:Server
Here come the weird part. In the same method, we have an array (LOCAL aAgents AS ARRAY) that contains the data that we need for oAgentServer. In the debugger, I can see the data of aAgents array. In this instance there are three agents. Each agent percent is 100.0 in aAgents array. To populate oAgentServer we have this loop:
Code: Select all
FOR i := j UPTO ALen(aAgents)
oAgentServer:Append()
oAgentServer:FIELDPUT( #MSEQ, SELF:siSeq )
oAgentServer:FIELDPUT( #MAGENT, aAgents[i, kAGENT] )
oAgentServer:FIELDPUT( #MAGTPCT, aAgents[i, kAGENT_PCT] ) //<---My main focus
oAgentServer:FIELDPUT( #MAGTLVL, aAgents[i, kAGENT_LVL] )
oAgentServer:FIELDPUT( #MAGTOR, aAgents[i, kAGENT_OR] )
oAgentServer:FIELDPUT( #MHCOMMIP, aAgents[i, kAGENT_IP] )
SELF:siSeq++
NEXT i
Code: Select all
oAgentServer:FIELDPUT( #MAGTPCT, (long)aAgents[i, kAGENT_PCT] )
Is this something we should be mindful of when assigning value to bArrayServer element? I found it odd that a field that is defined as "N", 5,1 as a long. Or is this a bug in XSharp that can be fixed? Thanks.
Boonnam