>void FAR fllProbeSearch(ParamBlk FAR *parm) >{ > > long arraypos, probeArrayLen; // Starting value of Loop (index into array) > int probeno; // probe number > int probepos; // position of probe in array string > Value val; // Create Value structure. > Locator probearr_locator; // Create Locator structure for probe[]. > char FAR * probesetstring; // points to one string in the probeset array > int probesetlen = 0; // the length of a probesetstring > > char Message[801]; // holds debug messages for output > char probeseq[26]; // holds an individual probe sequence for use by strstr() > > char FAR * seq = NullTerminate1(&parm->p[1].val); // consensus sequence (have to get it from VFP) > char revseq[14000]; // buffer for flipped sequence > int seqlen; // length of consensus sequence > > int subgoodFwd, subgoodRev; // holds the number found fwd, rev > char vname[11]; // for var name passed to putNumVar > > > _PutStr("Step 1"); > > _Load(&parm->p[0].loc, &val); > > >// &parm->p[2].val.ev_type = 'L'; > > probearr_locator = parm->p[0].loc; // Store the contents of the FoxPro array in the Locator structure. > probearr_locator.l_subs = 1; // Must be set to 1 for one dimensional array > > probeArrayLen = _ALen(parm->p[0].loc.l_NTI, AL_ELEMENTS); // get array length (# of elements) > > sprintf( Message, "\nsubscripts %u p[2].val.ev_type = %c\n", probeArrayLen, parm->p[2].val.ev_type); > _PutStr( Message ); //print the message > > > // ---- FOR loop to get the array elements. ---- > // This loop dies after 1022 times. You can set the starting > // arraypos higher and it will still die after 1022 times. > for(arraypos=0; arraypos < probeArrayLen ; arraypos ++){ > > probearr_locator.l_sub1 = (arraypos+1); > > _HLock(val.ev_handle); // Do I need this here? > /* Store the contents of an individual FoxPro array element into a Value Structure.*/ > _Load(&probearr_locator,&val); > > probesetstring = (char FAR *) _HandToPtr(val.ev_handle); // get a pointer to the string (goes to null after 1022 loops) > probesetlen = val.ev_length; > > sprintf( Message, " %u ", arraypos); // this goes from 0 to 1021 and fails with a null pointer > _PutStr( Message ); > > if (probesetstring == 0) _UserError("probesetstring pointer is null"); > >// --- Lots of inner loop stuff would go here > > _HUnLock(val.ev_handle); // Do I need this here? > > > } // bootom of probe array scan loop >} > >FoxInfo myFoxInfo[]={ > {"fllProbeSearch",(FPFI)fllProbeSearch,3,"RCL"}, >}; > > >extern "C" { >FoxTable _FoxTable={ > (FoxTable FAR*)0, sizeof(myFoxInfo) / sizeof(FoxInfo), myFoxInfo }; >}