Tip Dönüşüm Fonksiyonları

CInt / Int

  • Dönüş Tipi: Integer
  • Parametreler:
  • - value (Variant): Değer
  • Açıklama: Değeri integer'a çevirir

Örnek Kullanım:

Sub Makro1()
    Dim Deger, Sayi
    Deger = "123"
    Sayi = Doc.CInt(Deger)
    Doc.MsgBox "Sayı: " & Sayi
    
    ' Veya Int fonksiyonu ile
    Deger = 123.7
    Sayi = Doc.Int(Deger)
    Doc.MsgBox "Tam sayı: " & Sayi  ' Sonuç: 123
End Sub

Cdbl

  • Dönüş Tipi: Double
  • Parametreler:
  • - value (Variant): Değer
  • Açıklama: Değeri double'a çevirir

Örnek Kullanım:

Sub Makro1()
    Dim Deger, Sayi
    Deger = "123.45"
    Sayi = Doc.Cdbl(Deger)
    
    Dim Toplam
    Toplam = Sayi * 1.18  ' KDV hesaplama
    Doc.MsgBox "Orijinal: " & Sayi & Chr(13) & "KDV Dahil: " & Toplam
End Sub

CStr

  • Dönüş Tipi: Variant (String)
  • Parametreler:
  • - value (Variant): Değer
  • Açıklama: Değeri string'e çevirir

Örnek Kullanım:

Sub Makro1()
    Dim Sayi, Metin
    Sayi = 123.45
    Metin = Doc.CStr(Sayi)
    
    Dim Mesaj
    Mesaj = "Sayı: " & Metin
    Doc.MsgBox Mesaj
    
    ' Alan değerine string olarak atama
    Doc.SetFieldValue "TABLO1", "ACIKLAMA", 0, Doc.CStr(Sayi)
End Sub

---