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
