
Comment faut-il s'y prendre pour récupérer les éléments chaines de caractère d'une liste, une fois que j'ai un pointeur vers elle ?
#define USE_TI89 // Produce .89z File #define USE_TI92PLUS // Produce .9xz File #define RETURN_VALUE // Return Pushed Expression #define OPTIMIZE_ROM_CALLS // Use ROM Call Optimization #include <tigcclib.h> void _main(void) { ESI argptr=EX_getArg(0); ESI arg2=EX_getArg(1); char *str; int compteur=0; str=GetStrnArg(arg2); argptr--; while (GetArgType(argptr)!=END_TAG) { compteur++; if (GetArgType(argptr)==STR_TAG) { if (strcmp(GetStrnArg(argptr),str)==0) { push_longint(compteur); return; } } else argptr=next_expression_index(argptr); } push_longint(0); }
#define USE_TI89 // Produce .89z File #define USE_TI92PLUS // Produce .9xz File #define RETURN_VALUE // Return Pushed Expression #define OPTIMIZE_ROM_CALLS // Use ROM Call Optimization #include <tigcclib.h> int search_in_list(char *variable); void _main(void) { push_longint(search_in_list($(abc))); // recherche dans la variable abc } int search_in_list(char *variable) { SYM_ENTRY *var_sym=SymFindPtr(variable,0); ESI liste; int compteur=0; if(peek(liste=HToESI(var_sym->handle))==217) { liste--; while (GetArgType(liste)!=END_TAG) { compteur++; if (GetArgType(liste)==STR_TAG) { if (strcmp(GetStrnArg(liste),"ma")==0) { // search chaine "ma" return compteur; } } else liste=next_expression_index(liste); } return 0; } return 0; }