CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 1999
    Location
    Israel
    Posts
    26

    Does VB have an equivelant to VC's '#define' statement?

    Hi!
    I need something that look likes to #define in VC:
    #define DEF1 some_variable

    How can I write this in VB?
    Thanks!
    Alexandra



  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Does VB have an equivelant to VC's '#define' statement?

    VB does NOT have a precompiler, but you can use the

    #CONST DEF1 = some_value
    #if DEF1 = some_value then
    ..
    #end if



    syntax.


  3. #3
    Join Date
    Sep 1999
    Location
    Israel
    Posts
    26

    Re: Does VB have an equivelant to VC's '#define' statement?

    Hi!
    The idea is to change this code:

    dim x
    dim val1

    x = val1
    if x = ... then
    '...
    endif




    to

    ' x not declared
    dim val1

    x = val1
    if x = ... then

    endif



    I don't want to declare variable twice!
    I the C-code I have lot of defines!(It look likes
    [vccode]
    #define factorsblender cnt.PIDFctors[10]
    #define factorschargeblender cnt.PIDFctors[16]
    #define factorsplc5 cnt.PIDFctors[94]
    ...
    [/vccode]
    It explain me what a data is.
    Have you any idea?
    Thanks!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured