Hello Vera,

Thursday, March 21, 2002, 12:44:40 AM, you wrote:

VB> Is there a way in MapBasic to create a list of branch numbers within the
VB> page and have it go through that list and do the above commands by
VB> specifying variables instead of having a set of commands for each
VB> branch?
VB> Sort of like a While In ("#","#","#"...) command.
VB> Thanks

VB> I am trying to avoid having a program that continues onto 6 pages with
VB> the same command of select, commit, close through a list of branch
VB> numbers.

There is no direct way, but I hope this code helps you:


Dim i, iCount As Integer
Dim branches(0) As String
'You may fill array manualy like this:
' iCount = 10
' Redim branches(iCount)
' branches(1) = "0327"
' branches(1) = "0384"
' ... and so on
'or use text file where each line contains single branch value
iCount = 0
ReDim branches(iCount)
Open File "branches.txt"  For Input  As #1
 Do While Not EOF(1)
    iCount = iCount + 1
    Redim branches(iCount)
    Line Input #1, branches(iCount)
 Loop
'now start such loop
Open Table "H:\Pack2001\FCTABLES\REG1601.TAB" Interactive
Browse * From REG1601
Dim FN As String
For i = 1 To iCount
 Select * from REG1601 where branch = branches(i) order by GEOCODE into temp_tab
 FN = "H:\Pack2001\FCTABLES\FC"+branches(i)+".TAB"
 Commit temp_tab as fn
 Close Table temp_tab Interactive
Next
Run Menu Command M_FILE_CLOSE_ALL





-- 
Best regards,
Vladimir Lashin
MBBuilder COD mailto:[EMAIL PROTECTED]
microOLAP Technologies LLC
http://www.microolap.com/gis/  - GIS related products



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

Reply via email to