home *** CD-ROM | disk | FTP | other *** search
/ Dan Appleman's Visual Bas…s Guide to the Win32 API / Dan.Applmans.Visual.Basic.5.0.Programmers.Guide.To.The.Win32.API.1997.Ziff-Davis.Press.CD / VB5PG32.mdf / vbpg32 / samples4 / ch04 / ch04.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-05-06  |  1.2 KB  |  48 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Conditional Compilation Demo"
  4.    ClientHeight    =   3180
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1515
  7.    ClientWidth     =   6345
  8.    Height          =   3585
  9.    Left            =   1035
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   3180
  12.    ScaleWidth      =   6345
  13.    Top             =   1170
  14.    Width           =   6465
  15.    Begin VB.CommandButton Command1 
  16.       Caption         =   "Command1"
  17.       Height          =   615
  18.       Left            =   3600
  19.       TabIndex        =   0
  20.       Top             =   840
  21.       Width           =   1695
  22.    End
  23. Attribute VB_Name = "Form1"
  24. Attribute VB_Creatable = False
  25. Attribute VB_Exposed = False
  26. Option Explicit
  27. ' Compile time constant
  28. #Const UCASECTCONSTANT = True
  29. ' Runtime constant
  30. Dim UCASERTVARIABLE As Boolean
  31. Private Sub Command1_Click()
  32. Dim a$, b$
  33. UCASERTVARIABLE = True
  34. a$ = "This Was A Mixed Case String"
  35. b$ = "This Was Another Mixed Case String"
  36. #If UCASECTCONSTANT Then
  37.     a$ = UCase$(a$)
  38. #Else
  39.     a$ = LCase$(a$)
  40. #End If
  41. If UCASERTVARIABLE Then
  42.     b$ = UCase$(b$)
  43.     b$ = LCase$(b$)
  44. End If
  45. Print a$
  46. Print b$
  47. End Sub
  48.