Hi John

I have not check your code but here is my way of altering a object style.
It is faster than using the select or fetch.

The trick is to split your code in a procedure and a function, and then use
the function in a Update statement.


Sub Main
    Dim stName

    stName = "MyTable"

    set table stName fastedit on
    update sTName set Obj = NewSymbol(obj, OBJEKT_KODE)
    commit table stName
    set table stName fastedit off
End sub

Function NewSymbol(byval o as object, byval k as smallint)as object
   dim tPkt as object,
       SymbolGrå, fStyle, iStation as integer,
       sNewSymbol as symbol

   NewSymbol = o
   SymbolGrå = RGB(60,60,60)
   fStyle    = 256
   iStation  = RGB(190, 0,0)

   Do Case k
      CASE 3211
           sNewSymbol = MakeFontSymbol(65,SymbolGrå,4,"TOP100DK", fStyle,0)
      CASE 4153
           sNewSymbol = MakeFontSymbol(61,SymbolGrå,5,"TOP100DK", fStyle,0)
      Case 4161, 4162
           sNewSymbol = MakeFontSymbol(68,SymbolGrå,6,"TOP100DK", fStyle,0)
      .......
      .......

   End Case

   alter object tPkt Info Obj_Info_symbol, sNewSymbol
   NewSymbol= tPkt
End function





John Chioles <[EMAIL PROTECTED]> - 2000 07 14 03:05:18

Til:    "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc:      (bcc: Peter Laulund/MI/KMS)
Vedrørende:    MI alter obj symbol in loop



Hello:

I am trying to alter a symbol style in a for loop.

Here's the relevant MB:

     dim NewSymbol as symbol
     dim objSelection as object
     set table newTab fastedit on
     for i = 1 to TableInfo(newTab, TAB_INFO_NROWS)
          select * from newTab into selSingleRec where RowId = i
          '
          'multiple criteria to set the symbol style parameters
          '
          NewSymbol =
MakeFontSymbol(nShape,nColor,14,"MapInfoSymbols",nFontStyle,0)
          set style symbol NewSymbol
          NewSymbol = CurrentSymbol()
          objSelection = selSingleRec.obj
          alter object objSelection Info OBJ_INFO_SYMBOL, NewSymbol
          update selSingleRec set obj = objSelection where rowid = i
          commit table newTab
     next

I drummed up some old messsages to the list, to use as examples but
couldn't
get them to work.
Any help is appreciated.

-John

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]


Reply via email to