I think the problem might be the declaration of your TimeToTarget() function. If you have to be able to "send" a column name to the funtion it should take the parameters ByVal, like this declaration:
Declare Function TimeToTarget(ByVal fDist As Float, ByVal fSpeed As Float) As Date HTH, Peter Horsb�ll M�ller GIS Developer Geographical Information & IT COWI A/S Odensevej 95 DK-5260 Odense S. Denmark Tel +45 6311 4900 Direct +45 6311 4908 Mob +45 5156 1045 Fax +45 6311 4949 E-mail [EMAIL PROTECTED] http://www.cowi.dk -----Original Message----- From: Robert Crossley [mailto:[EMAIL PROTECTED] Sent: Monday, July 05, 2004 7:53 AM To: MapInfo List Subject: Re: MI-L Use fields in functions You may have to declare Vessels.Speed as an alias. eg. Dim speedAlias As Alias speedAlias = "Vessels.Speed" Print TimeToTarget(DistToTarget, speedAlias) At least you don't have to assign it every time. r On Mon, 5 Jul 2004 13:37:28 +0800, SCISOFT <[EMAIL PROTECTED]> wrote: > Just as suggestion - Try enclosing the Vessels.Speed in [], within the > command calling the function. eg, Print TimeToTarget(DistToTarget, > [Vessels.Speed]) > > Ian Thomas > GeoSciSoft - Perth, Australia > >> -----Original Message----- >> From: David Baker [mailto:[EMAIL PROTECTED] >> Sent: Monday, 5 July 2004 1:24 PM >> To: [EMAIL PROTECTED] >> Subject: MI-L Use fields in functions >> >> I'm hoping someone can clarify whether I am doing something wrong or >> whether I have run into a limitation of MapInfo. >> >> I am trying to include a field name as a parameter of a function >> call. However, I get an >> error: >> >> "Subroutine argument Vessels not defined. Found [.] while looking for >> [)]. >> >> >> The error line looks like this: >> >> Print TimeToTarget(DistToTarget, Vessels.Speed) >> >> Obviously it is looking for a variable name as the 2nd parameter, but >> finding a field name instead. >> >> If I do it like this: >> >> VesselsSpeed = Vessels.Speed >> Print TimeToTarget(DistToTarget, VesselsSpeed) >> >> everything works fine. However, this is an extra line & more mess, so >> I just want to clarify whether it should actually be possible to use >> a field name as a parameter for a >> function or not, possibly by some other declaration that I haven't >> thought >> about? >> >> Thanks, >> >> Dave >> >> >> --------------------------------------------------------------------- >> List hosting provided by Directions Magazine | www.directionsmag.com >> | To unsubscribe, e-mail: >> [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> Message number: 12441 > > > > --------------------------------------------------------------------- > List hosting provided by Directions Magazine | www.directionsmag.com | > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > Message number: 12442 > -- Robert Crossley Agtrix P/L 9 Short St PO Box 63 New Brighton 2483 Far Southern Queensland AUSTRALIA 153.549004 E 28.517344 S P: 02 6680 1309 F: New Connection M: 0419 718 642 E: [EMAIL PROTECTED] W: www.agtrix.com W: www.wotzhere.com --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 12443 --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 12444
