setAnswerFieldOrder
I solved my last problem with tony and woodys help thanx, (they solved it) I have searched the web and the other paradox BB's looking for another way than restructure, drag and paste to change the field order of a table.
I have been trying to use "setAnswerFieldOrder"
In the P10 OBJpal Reference, the code is as follows
var
qVar Query
arFields Array[] String
endVar
qVar.readFromFile( "myquery.qbe" )
qVar.getAnswerFieldOrder( arFields )
if arFields.size() > 0 then ; swap the first and third fields
; in the answer table.
arFields.exchange(1,3)
qVar.setAnswerFieldOrder( arFields )
qVar.executeQBE()
endif
I added an extra line:
if not qVar.executeQBE() then errorShow()
endIf
the error say "string is empty" and I'm not sure why because line "qVar.getAnswerFieldOrder( arFields )"
should populate the string. (?)
Bertl's site says @
"In P10, a query with an alias specified will cause a IPF on setAnswerFieldOrder()."
I'm not useing an alias and it seems to difficult to move a few fields around so I must be doing things the hard way? I suspect it's not "setAnswerFieldOrder" problem but the help file is wrong?
PS I have taken the keys off and PDOX 10.0.663 build
Thanks for any help
kim
kjjj
I solved my last problem with tony and woodys help thanx, (they solved it) I have searched the web and the other paradox BB's looking for another way than restructure, drag and paste to change the field order of a table.
I have been trying to use "setAnswerFieldOrder"
In the P10 OBJpal Reference, the code is as follows
var
qVar Query
arFields Array[] String
endVar
qVar.readFromFile( "myquery.qbe" )
qVar.getAnswerFieldOrder( arFields )
if arFields.size() > 0 then ; swap the first and third fields
; in the answer table.
arFields.exchange(1,3)
qVar.setAnswerFieldOrder( arFields )
qVar.executeQBE()
endif
I added an extra line:
if not qVar.executeQBE() then errorShow()
endIf
the error say "string is empty" and I'm not sure why because line "qVar.getAnswerFieldOrder( arFields )"
should populate the string. (?)
Bertl's site says @
"In P10, a query with an alias specified will cause a IPF on setAnswerFieldOrder()."
I'm not useing an alias and it seems to difficult to move a few fields around so I must be doing things the hard way? I suspect it's not "setAnswerFieldOrder" problem but the help file is wrong?
PS I have taken the keys off and PDOX 10.0.663 build
Thanks for any help
kim
kjjj