Results 1 to 5 of 5

Thread: Few very Basic Questions need quick advice

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2003
    Location
    Malaysia
    Posts
    13

    Talking Few very Basic Questions need quick advice

    I am kinda new in VB, appreciate somebody's advice on these few simple (may be idiot) questions.

    1. How do trap user's input from common dialog box message? said user click a "Cancel" or "Yes" on the printing dialog, how could it trap the user's input and make decision accordingly?

    2. I save some string onto text file in this way

    Print #1, string1, string2, string3

    I wish to read the string1, 2 and 3 back to string array individually with split function. What is the delimiter I should use? I used to use "Write", instead of "Print", the 3 strings was separated by "," This is easy to split with "," as the delimiter. But to make the output text file look better, I change to use "Print" instead, then the 3 strings became separated by some space/tab. I tried to use vbTab as the delimiter, but it seems does not work. Please help

    3. This is an real idiot question, how do it print " You & Me" on the caption box? The "&" seems like a special character.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    #1 Set the CancelError property of the commondialog control to True. Trap for an error, and if the cancel button is clicked, you will know.

    #3 Try "You && Me"

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    1) Look into the .FileName property... (if using for file open or file save) If = "", the User selected cancel...

    2) VB Example - Basic Textfile Example

    3) Msgbox "You && Me"
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Re: Well

    Originally posted by James Stanich
    1) Look into the .FileName property... (if using for file open or file save) If = "", the User selected cancel...
    Careful here. The FileName property can carry over between calls to Showxxxx.. Unless you set the property back to "" after each call, this method is unreliable.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Re: Re: Well

    Originally posted by crptcblade
    Careful here. The FileName property can carry over between calls to Showxxxx.. Unless you set the property back to "" after each call, this method is unreliable.

    Sorry. This is true. I had problems with this in the pass, but always set to "" before showing the CD. Good point, though...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

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