Sorry, I guess I over simplified my example and poorly explained it! Actually I was looking to be able to use a variable to change the field I look up in a result... In some cases, I was hoping to use a concatenated string to get various results from the database.
It seems this has been answered in a subsequent response to use the form of "ResultName[String]" in lieu of "ResultName!ResultField". Thanks! Jeff H Tokyo On Wed, 2011-04-13 at 10:19 +1000, richard terry wrote: > On Wednesday 13 April 2011 09:51:05 Jeff Halverson wrote: > > I have something that is puzzling me that seems easy to do, but I can't > > figure it out... I was hoping somebody might be able to help. > > > > If I have the following available from a resultset: > > > > DataSummary!InvestmentName > > DataSummary!BrokerName > > DataSummary!ManagementCompanyName > > DataSummary!RegionName > > > > And I want to be able to use each of those fields above in a function, > > such as the example below: > > > *********************************************************** > > IF TextToSearchFor = DataSummary!RegionName THEN > > ' Do a bunch of stuff > > END IF > ************************************************************ > Not sure what your problem is as the lines above this should work fine as > long > as the database field data is text, can you describe what happens when you > try > this to give us more clues? > > Regards > > Richard > > > Is there a way to replace the "DataSummary!RegionName" within the > > function with a variable that will evaluate to the resultset value? > > Maybe something like: > > > > FieldToSearchFor = "DataSummary!RegionName" > > IF TextToSearchFor = Evaluate(FieldToSearchFor) THEN > > ' Do a bunch of stuff > > END IF > > > > Obviously the above doesn't work, but is there some means in Gambas to > > achieve this result? > > > > Any help is greatly appreciately. > > > > Jeff H > > Tokyo > > --------------------------------------------------------------------------- > > --- Forrester Wave Report - Recovery time is now measured in hours and > > minutes not days. Key insights are discussed in the 2010 Forrester Wave > > Report as part of an in-depth evaluation of disaster recovery service > > providers. Forrester found the best-in-class provider in terms of services > > and vision. Read this report now! http://p.sf.net/sfu/ibm-webcastpromo > > _______________________________________________ > > Gambas-user mailing list > > Gambas-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > ------------------------------------------------------------------------------ > Forrester Wave Report - Recovery time is now measured in hours and minutes > not days. Key insights are discussed in the 2010 Forrester Wave Report as > part of an in-depth evaluation of disaster recovery service providers. > Forrester found the best-in-class provider in terms of services and vision. > Read this report now! http://p.sf.net/sfu/ibm-webcastpromo > _______________________________________________ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > ------------------------------------------------------------------------------ Forrester Wave Report - Recovery time is now measured in hours and minutes not days. Key insights are discussed in the 2010 Forrester Wave Report as part of an in-depth evaluation of disaster recovery service providers. Forrester found the best-in-class provider in terms of services and vision. Read this report now! http://p.sf.net/sfu/ibm-webcastpromo _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user