I have attached code to a program I am working on. My problem is that I I
can't get the input in the EditText box into the Sub Procedure that I need to
do several queries on. I have tried to change the text to a value using the
"Val" command but when I test it using a Print statement, it always comes back
as a 0. Any suggestions?
TIA,
John
Include "mapbasic.def"
Include "icons.def"
Include "menu.def"
define x*8
define y*8
Declare Sub main
Declare Sub fillcolumnlist
Declare Sub Process
Dim strTablelist(), strTabName, strColList() as string
Dim intTableid, intColnum, intCounter, intTabnum, intColumnid as Integer
Dim strBox1, strBox2 as string
Dim one, two, three, four as Alias
Dim matrix_table as string
Sub main
intTabnum = Numtables()
redim strTableList(intTabnum)
for intCounter = 1 to intTabnum
strTablelist(intCounter) =Tableinfo(intCounter, TAB_INFO_NAME)
next
intColnum = NumCols(strTablelist(1))
redim strColList(intColnum)
for intCounter = 1 to intColnum
strColList(intCounter) = ColumnInfo(strTablelist(1), "COL"+intCounter,
COL_INFO_NAME)
next
intTableid = 1
Dialog
Title "Risk Matrix"
Width 40x Height 53y
Control GroupBox
Title "Step 1 - Select Table, Columns, and Ranges:"
Position 1x, 1y
Width 37x Height 13y
Control StaticText
Title "Select Table:"
Position 2x, 2.5y
Control PopupMenu
ID 1
Position 12x, 2.5y
Title from variable StrTablelist
calling fillcolumnlist
Width 12x
into one
Control StaticText
Title "Select Actual Value:"
Position 2x, 5.5y
Control PopupMenu
ID 2
Position 12x, 5.5y
Title from Variable strColList
Width 12x
into two
Control StaticText
Title "Select Model Value:"
Position 2x, 8.5y
Control PopupMenu
ID 3
Position 12x, 8.5y
Title from Variable strColList
Width 12x
Control StaticText
Title "Select # of Ranges:"
Position 2x, 11.5y
Control PopupMenu
Title "10;15;20"
ID 4
Value 3
Position 12x, 11.5y
Width 12x
Control GroupBox
Title "Select High Value for Range:"
Position 1x, 15y
Width 37x Height 34y
Control StaticText
Title "Range 1:"
Position 2x, 16.5y
Control StaticText
Title "Range 2:"
Position 2x, 18.5y
Control EditText
Position 7.5x, 16.5y
ID 5
Into strBox1
Width 10x
Control EditText
Position 7.5x, 18.5y
ID 6
Into strBox2
Width 10x
Control OKButton
Position 12x, 50y
ID 25
Calling Process
Control CancelButton
Position 19x, 50y
ID 26
End Sub
Sub FillColumnlist
intTableid = ReadControlValue(1)
strTabname = Tableinfo(strTablelist(intTableid), TAB_INFO_NAME)
intColnum = NumCols(strTabname)
redim strColList(intColnum)
for intCounter = 1 to intColnum
strColList(intCounter) = ColumnInfo(strTablelist(intTableid),
"COL"+intCounter, COL_INFO_NAME)
next
Alter Control 2 Title from Variable strColList
Alter Control 3 Title from Variable strColList
End Sub
Sub Process
matrix_table = TableInfo(intTableid, TAB_INFO_NAME)
intColumnid = ReadControlValue(2)
two = ColumnInfo(strTableList(intTableid),"COL"+intColumnid,COL_INFO_NAME)
'**********At this point I would like to select the records from the table
that are above and/or below a certain value
'like the example below***************
'Select * from matrix_table where two > strBox1 and two < strBox2
End Sub
_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l