MI Updating columns in Mapbasic
Hi all, I'm (slowly) learning mapbasic and I'm trying to update the value of _col2 based on the number in _col3 * _col1. To this end I have tried 2 different ways of achieving this. 1. Select all the records in Tablename that fall within certain parameters and then update Tablename from that selection. (the batch approach) i.e. Select * From Tablename Where _col1< 15 Fetch First From Selection Do While Not EOT(Selection) Update Selection Set _col1 = _col2 Loop This doesn't work 2. so I tried to loop through all the records in the table updating _col2 based on the value in Tablename._col1 ie Fetch First from Tablename Do While Not EOT(Tablename) If (Tablename._col1<=15) Then Update Tablename Set _col2=_col3 ElseIf Tablename._col1>15 and Tablename._col1<=16 Then Update Tablename Set _col2=(_col3-((_col3/100)*1.2)) ElseIf Tablename._col1>16 Then Update Tablename Set _col2=(_col3-((_col3_col2/100)*17)) End If Fetch Next From Tablename Loop This doesn't work either! I know this must be a very simple thing to try and do - so could anyone please point me in the right direction? Thanks, Jim Wilson
MI Standard deviation
hi all, I'm trying to write a MB application to automate a routine to filter some data and i need to calculate the standard deviation of a column of data. In the past when I was doing it manually I found the SD by Query/Calculate Statistics Does anyone know how I can get the SD of a column in mapbasic? TIA Jim Wilson
MI Opening and reading binary files
Hi all, Can anyone help with this one? I'm out of my depth here. I have a binary file created by a logging device containing lat and long, date, time, year, and several readings. The data is logged at 1 hertz so I have multiple readings in the same format in the same file. The string length logged every second is 22 bytes and I would like to endup with the complete file in the 14 columns that the data relates to. (I have opened the file in a hex editor and can see the data structure) I am slowly trying to learn mapbasic and have opened the file as a binary type - see below Include "MENU.DEF" Include "MAPBASIC.DEF" Dim Lat as float Open File "a:\1.Bin" For BINARY As #1 Get 1,2630,Lat Print "Hex Value is " = Lat to see if I could open the file and read the value at position 2630 as a first stage to reading the entire file. The .mb compiles ok with no error messages but on running it i get a data mismatch error. Could anyone help and suggest a way forward please? Should I be trying to do this in eg Excel or is there an easier way to get the data into a usable format? Thanks, Jim -- To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
MI Subtotalling Records
Hi all, Can anybody help with this please? I have a table of approx 2 records recording data collected with a GPS receiver and an automatic logging device. The structure of the table is Lat, Lon, and then 50 columns of automatic readings ie Lat,Long, Reading1,Reading2,Reading3,etc,etc,etc,Reading50. The readings are integers between 10 and 29998 and I need to count the number of times the reading in that row falls into (say) 1000 unit bands eg 10 to 1000, 1001 to 2000 etc. Obviously the sum of the bands will add up to 50 I have tried the COUNT() aggregate function but can't pick the required band and update column doesn't give me the option of COUNT() Anybody any ideas? I'm afraid I am running out of them! Jim Jim Wilson, Hilton of Fern, By Brechin, Angus, Scotland -- To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
MI .adf Grid Files
Hi All, I have several files with .adr extensions that I believe were created in arcview's spatial analyst. I need to use these files in Mapinfo/VM and would be grateful if anyone could confirm that they were indeed created with spacial analyst and suggest how to get them into Mapinfo. TIA Jim Jim Wilson, Hilton of Fern, By Brechin, Angus, Scotland -- To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]