Results 1 to 4 of 4

Thread: Void Process to bool

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2004
    Posts
    97

    Void Process to bool

    Hello Everybody:
    Can any one tell me how to convert a Void Process to bool.. Pls guide...

    if (ClientProcess()=true)

    {


    }

    Thanks,

    Rahil

  2. #2
    Lively Member JAtkinson's Avatar
    Join Date
    Feb 2004
    Location
    Richmond, VA
    Posts
    68
    First off... you need to use == instead of one =.
    Visual Studio .net 2003 EA
    VB .net
    C#

  3. #3
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131
    If its a void method then its not returning a value. Therefore you need to change the method:
    e.g.
    public void ClientProcess()

    to

    public bool ClientProcess()

    you also need to add return statements throughout the method to ensure a result (of type bool) is returned.

    HTH

    DJ

  4. #4
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    Code:
    public bool ClientProcess()
    {
    if(whatever)
    return true;
    else
    return false;
    }
    
    //......................
    
    if(ClientProcess()) //assumes true
    {
    //??? code if true
    }
    else //if it was false...
    {
    //??? code if false
    }
    Last edited by wossname; Mar 18th, 2004 at 05:46 AM.
    I don't live here any more.

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