select - Maple Help

Expseq.select

return an element store within an expression sequence

 Calling Sequence Algebraic select( int i ) throws MapleException

Parameters

 i - index of the entry to return

Description

 • The select function returns the Algebraic object stored in index i of the Expseq.
 • Valid values of i are $1..n$ where $n$ is the length of the expression sequence.  The length can be obtained by calling numElements.

Examples

 import com.maplesoft.openmaple.*; import com.maplesoft.externalcall.MapleException; class Example { public static void main( String notused[] ) throws MapleException { String[] mapleArgs = { "java" }; Engine engine = new Engine( mapleArgs, new EngineCallBacksDefault(), null, null ); Expseq e = (Expseq)engine.evaluate( "seq( evalf[78](7^(1/i)), i=1..10 ):" ); int i; for ( i = 1; i <= 10; i++ ) { System.out.println( e.select(i) ); } try { e.select(11); } catch ( MapleException me ) { System.out.println( me.getMessage() ); } try { e.select(0); } catch ( MapleException me ) { System.out.println( me.getMessage() ); } } }

Executing this code produces the following output.

 7. 2.64575131106459059050161575363926042571025918308245018036833445920106882323028 1.91293118277238910119911683954876028286243905034587576621064764044723427617923 1.62657656169778574321123234549376017301827079226949761818745558348867674117268 1.47577316159455206927691669563224410654409361374020356777090416888452176749921 1.38308755426848849264065851353482259087704273621025114871908429253975875945491 1.32046924775612379180932733150026308273660015197335825180266128835467174365289 1.27537310685845408538600975045879227345370475539677042755236132296950696193994 1.24136581701520867757662639129509362296759670055153242237508942386018682338140 1.21481404403906693939874738140509129071838803506412754355625118059503365822372 Error, bad index, 11, into expression sequence Error, bad index, 0, into expression sequence