Hi Hannah,

I guess you'll have to do it the hard way:

c(1) = "a"
c(2) = "b"
c(3) = "c"

Unless you make your own function that can initialize a araay using a
semicolon separated string list:

'
************************************************************************************
Function ARRInitialize(arrValues() As String, ByVal szStrList As String) As
Logical

Dim  nBeg, nEnd, nCount As Integer

ARRInitialize = FALSE

OnError GoTo ErrorOccured

     nBeg      = 0
     nCount         = 0
     nEnd      = InStr(

     'Here you loop thru the szStrList and retrieves the single elements
     Do While nEnd <= Len(szStrList)
          nBeg = nEnd + 1
          nEnd = InStr(nBeg, szStrList, ";")
          If nEnd = 0 Then
               nEnd = Len(szStrList) + 1
          End If

          nCount         = nCount + 1
          ReDim arrValues(nCount)
          If nBeg = nEnd Then
               arrValues(nCount)   = ""
          Else
               arrValues(nCount)   = LTrim$(RTrim$(Mid$(szStrList, nBeg,
nEnd - nBeg)))
          End If
     Loop

     ARRInitialize = TRUE
     Exit Function
'---------------------
ErrorOccured:
     Note Error$()

End Function
'
************************************************************************************

I hope this will work I have tested it !

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 - 08-02-02 08:12 -----
                                                                                       
                                            
                    Hannah Birch                                                       
                                            
                    <[EMAIL PROTECTED]>          Til:    
[EMAIL PROTECTED]                                 
                    Sendt af:                            cc:                           
                                            
                    [EMAIL PROTECTED]        Vedr.:  MI-L initialising 
string array in MapBasic                        
                    onsmag.com                                                         
                                            
                                                                                       
                                            
                                                                                       
                                            
                    07-02-02 16:20                                                     
                                            
                    Besvar venligst til Hannah                                         
                                            
                    Birch                                                              
                                            
                                                                                       
                                            
                                                                                       
                                            



I would like to initialise a string array in MabBasic but can't see how to
do this without  looping through each of the strings in the array. Is there
a way to do this similar to C? eg
char c[] ={"A","B","C"}



_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to