Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example prefixes all data read into column 2 with an asterisk (*). When the data is written back to the database, all the asterisks are replaced by tilde characters (~).

Visual Basic

Sub SS_DataFill (Col As Long, Row As Long, DataType As Integer, fGetData As Integer, Cancel As Integer)
Dim v As Variant
Dim buf As String
Dim ret As Integer
If fGetData Then
    If Col = 2 Then
        fpSpread1.Col = Col
        fpSpread1.Row = Row
        ret = fpSpread1.GetDataFillData(v, 8)
        v = "*" + v
        fpSpread1.Text = v
        Cancel = True
    End If
Else If Col = 2 Then
    fpSpread1.Col = Col
    fpSpread1.Row = Row
    v = fpSpread1.Text
    Do
    ret = InStr(v, "*")
    If ret Then
        Mid(v, 1, 1) = "~"
    Else
        Exit Do
    End If
Loop
ret = fpSpread1.SetDataFillData(v)
Cancel = True
End If
End If
End Sub

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.