Hi Warren,
You are right. The date might be handled more intelligent than I have shown
here, but I'm not sure if the FormatDate$() does the job.
I look it up in my MapBasic 6.5 help file, and I was surpriced to see that
it returns a pen pattern ????? I guess that's not true ;-)
I sure would like to see the algoritme behind this function !
***************************************************
Purpose
Returns a pen pattern.
Syntax
FormatDate$ ( value )
value is a number representing the date in a YYYYMMDD format.
Return Value
String
***************************************************
Peter
------------------------------------------------------------------------------------------------
Peter Horsb�ll M�ller, GIS Udviklingskonsulent / GIS-Developer
Kampsax A/S - GIS Software & Solutions
Rugaardsvej 55, 5000 Odense, DK
tel: +45 6313 5013, dir:+45 6313 5008, fax: +45 6313 5090
mailto:[EMAIL PROTECTED]
www.kampsax-gis.dk and www.kampsax.dk
Authorized MapInfo Partner & Distributor in Denmark and Norway.
------------------------------------------------------------------------------------------------
Klik ind p� http://www.kortal.dk og se det hele lidt fra oven!
"Warren Vick,
Europa Til: <[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]>
Technologies cc: <[EMAIL PROTECTED]>
Ltd." Vedr.: RE: MI-L Getting values from the
selected row into an Array
<wvick@europa
-tech.com>
25-04-2002
12:23
Besvar
venligst til
wvick
Hello Peter, Thomas,
In your code below, note that you'll probably need a special case for
handling date types too, using formatdate$().
Regards,
Warren Vick
Europa Technologies Ltd.
http://www.europa-tech.com
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 2:39 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: MI-L Getting values from the selected row into an Array
Try this:
************************************************************
Include "MapBasic.def"
Function GetValuesFromSelectedRow(arrValues() As String) As Logical
Dim i, nCols As Integer,
szSelTab, szCol As String,
aCol As Alias
GetValuesFromSelectedRow = FALSE
If SelectionInfo(SEL_INFO_NROWS) <> 1 Then
Note "Please select exactly ONE record!"
Exit Function
End If
szSelTab = SelectionInfo(SEL_INFO_SELNAME)
nCols = TableInfo(Selection, TAB_INFO_NCOLS)
ReDim arrValues(nCols)
For i = 1 To nCols
szCol = ColumnInfo(szSelTab, "COL" + i, COL_INFO_NAME)
aCol = szSelTab + "." + szCol
If ColumnInfo(szSelTab, szCol, COL_INFO_TYPE) = COL_TYPE_CHAR
Then
arrValues(i) = aCol
Else
arrValues(i) = Str$(aCol)
End If
Next
GetValuesFromSelectedRow = TRUE
End Function
************************************************************
HTH,
Peter
----------------------------------------------------------------------------
--------------------
Peter Horsb�ll M�ller, GIS Udviklingskonsulent / GIS-Developer
Kampsax A/S - GIS Software & Solutions
Rugaardsvej 55, 5000 Odense, DK
tel: +45 6313 5013, dir:+45 6313 5008, fax: +45 6313 5090
mailto:[EMAIL PROTECTED]
www.kampsax-gis.dk and www.kampsax.dk
Authorized MapInfo Partner & Distributor in Denmark and Norway.
----------------------------------------------------------------------------
--------------------
Klik ind p� http://www.kortal.dk og se det hele lidt fra oven!
----- Videresendt af Peter M�ller/Kampsax - 24-04-2002 15:31 -----
Thomas Brix Lyng
<brixlyng@frederi Til:
"'[EMAIL PROTECTED]'"
kshavn.dk>
<[EMAIL PROTECTED]>
cc:
24-04-2002 12:26 Vedr.: MI-L Getting values
from the selected row into an Array
Hi Listers
I'm trying to design a loop that fills an array with the values of the
columns of the selected row in a table. I have tried this:
Dim NumCols,k as integer
Dim ColValue(1), EvalString as String
NumCols=TableInfo(MyTable, TAB_INFO_NCOLS)
Redim ColValue(NumCols)
for k=1 to Numcols
EvalString="Colvalue("+k+")=MyTable.COL"+k
Run Command EvalString
Next
I doesn't work and I can't figure the solution out.
Please help
Thanks
Thomas Brix Lyng
Frederikshavn Munincipal Administration
Denmark
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]