Mike,

I have used functions in the past for doing this kind of update, but i always called 
the column by its column number  see the code below>

tis v fast and handy, but you have to watch some updates because they all occurr 
concurrently, so in the example below, i also update column3, but it gets updated with 
the OLD values from column 2, not the new ones being calculated by the function in teh 
first part of the update.





include "mapbasic.def"
declare sub main()
declare function mysquare(byval mycolumnum as integer) as float



sub main
Open Table "D:\tableone.TAB" as mytest 
' now i update column two by calling the function against column 1
Update mytest Set Field2 =  mysquare(1), Field3 = str$(Field2/3)
browse * from mytest
end sub


' my function to return the square of the first column 
Function mysquare(byval mycolumnum as integer) as float
mysquare = mytest.col(mycolumnum) * mytest.col(mycolumnum) 
end function 


hth

r


*********************************************************************
This  e-mail  message,  and  any  files  transmitted  with  it, are
confidential  and intended  solely for the  use of the  addressee. If
this message was not addressed to  you, you have received it in error
and any  copying,  distribution  or  other use  of any part  of it is
strictly prohibited. Any views or opinions presented are solely those
of the sender and do not necessarily represent  those of the British
Geological  Survey. The  security of e-mail  communication  cannot be
guaranteed and the BGS accepts no liability  for claims arising as a
result of the use of this medium to  transmit messages from or to the
BGS. .                            http://www.bgs.ac.uk
*********************************************************************


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 11545

Reply via email to