seqTest = Module1.CorbaTests.SeqTest("SeqTest")
stringSeq = [ "1", "2", "3", "4", "5", "6", "7", "8",
"9", "10", "11" ]
boundStringSeqOp seqTest using
aBoundStringSeq = stringSeq returning stringSeq
display stringSeq
Exception: Sequence size is incorrect, it is 11 and should have been 10. line=5 column=1
Any of the primitive types shown in Primitive types can be used to create a sequence. The following example shows how to create a string sequence.
seqTest = Module1.CorbaTests.SeqTest("SeqTest")
stringSeq = ["one", "two", "three"]
stringSeqOp seqTest using aStringSeq = stringSeq
returning stringSeq
display stringSeq
ts = 'now' // timestamp
seqTest = Module1.CorbaTests.SeqTest("SeqTest")
// create the first struct
structOne = Module1.CorbaTests.SeqTest.TestStruct()
structOne.longMember = 10
structOne.stringMember = String(ts)
// create the second struct
structTwo = Module1.CorbaTests.SeqTest.TestStruct()
structTwo.longMember = 20
structTwo.stringMember = String(ts)
// the array of structures
structSeq = [structOne, structTwo]
testStructSeqOp seqTest using
aTestStructSeq = structSeq
ts = 'now' // timestamp
seqTest = Module1.CorbaTests.SeqTest("SeqTest")
unionOne = Module1.CorbaTests.SeqTest.TestUnion()
unionOne.longMember = 10
unionTwo = Module1.CorbaTests.SeqTest.TestUnion()
unionTwo.stringMember = String(ts)
unionSeq = [unionOne, unionTwo]
testUnionSeqOp seqTest using
aTestUnionSeq = unionSeq
seqTest = Module1.CorbaTests.SeqTest("SeqTest")
// union is instantiated
testUnion = Module1.CorbaTests.SeqTest.TestUnion()
testUnion.stringMember = "aString"
testUnionSeqOutOp seqTest returning
// union will be received in the sequence
testUnionSeq = aTestUnionSeq
unionOne = testUnionSeq[0]
unionTwo = testUnionSeq[1]