Results 1 to 11 of 11

Thread: 'If' Question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2004
    Posts
    279

    Question 'If' Question

    What I'm trying to do is hard to explain but I'll give it my best shot.


    Quick example:
    VB Code:
    1. Public Localcheat As String
    2.  
    3. If FindWindow("blahblah", vbNullString) Then Localcheat = "BanReason"
    4. End If
    Now here's the printing of the ban above:
    VB Code:
    1. Dim blah As String
    2.  
    3. blah = BanReason
    4. Dim Fnum As Integer
    5. Fnum = FreeFile
    6. Open "C:\blahblah.txt" For Output As Fnum
    7. Print #Fnum, "" & blah & ""
    8. Close Fnum
    I don't think that's how to do it but that's why I'm here, again . Hopefully you get my point when reading those.
    Last edited by Tantrum3k; Nov 8th, 2004 at 11:54 AM.

  2. #2
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762
    Sorry, I don't really understand what your're trying to do.
    kevin
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    You haven't explained anything at all. What is the problem?
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106
    Adding "" will not actually do anything. If you are trying to enclose the string 'blah' in quotes, use write instead of print, or add Chr(34). If you are trying to add a space, you might add Chr(32).
    My usual boring signature: Nothing

  5. #5
    Frenzied Member
    Join Date
    May 2003
    Location
    So Cal
    Posts
    1,564
    You can also use 4 quotes to inclue a quote.

    """"

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Should that be

    blah = "BanReason"
    or
    blah = Localcheat

    ?


    And no, you make no sense.

  7. #7
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    Print #Fnum, "" & blah & ""

    could just as easily be

    write #Fnum, blah

  8. #8
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    Also use a naming convention...it's much easier to read:
    VB Code:
    1. Public mstrLocalcheat As String
    2.  
    3. Dim lngFNum As Long
    lng = Long
    str = String

    and the 'm' in the mstr bit means that it's decalred at the top of a module, and not in a function.

    Woka

  9. #9
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106
    I'm kind of opposed to warting, but slowly coming around to it because it is pretty convenient as long as you have consistent system. MS has a prefered style (Hungarian Notation), and apparently the badger has a style too....gee, I am SO surprised at that. However, which system is best probably depends on your personality and work environment.

    There's no rule to it, it's just an idea that might make it easier to maintain your code.
    My usual boring signature: Nothing

  10. #10
    New Member
    Join Date
    May 2004
    Posts
    5
    Are you trying to have your program look for a window handle and if its open display the message? not sure if thats what you are after if so its simple if you know the windows handle. Hwnd

  11. #11
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Resolved

    Add the Checkmark and the word [RESOLVED] to the subject of the first post in your thread
    if your question has been answered satisfactorily.

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