473,395 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

isdefined / isobject?

Rob
Just wondering, is there a way to see if a Function is defined and only
conditionally execute it?

Something like:

try {
FormPostBack();
}
catch { }

The above will fail with a compilation error, so it never even runs.

cheers,

Rob
Nov 19 '05 #1
1 1251
use reflection:

MethodInfo method = ths.GetType().GetMethod("FormPostBack");
if (method != null)
{
method.Invoke(this, new Object[]);
}

-- bruce (sqlwork.com)
"Rob" <ro*@nospamforme.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Just wondering, is there a way to see if a Function is defined and only
conditionally execute it?

Something like:

try {
FormPostBack();
}
catch { }

The above will fail with a compilation error, so it never even runs.

cheers,

Rob

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Christian Blackburn | last post by:
Hi Gang, I want to test and find out whether or not a particular variable object has been defined. I need to know whether or not a recordset has already been defined in the current script. ...
4
by: Andrew Clark | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** hello, i am trying to create a login page to my website. there are the usual fields for name and password, but i want 2 more: a...
3
by: valued customer | last post by:
Is there a more concise way to do something like the the desired code below? The gripe is with the try-catch syntax. It takes *way* too many lines of code to evaluate a conditional expression...
23
by: Michel Bany | last post by:
I am trying to parse responseXML from an HTTP request. var doc = request.responseXML; var elements = doc.getElementsByTagName("*"); the last statement returns an empty collection when running from...
5
by: Mike Randall | last post by:
How do you test for the existance of session variables? I use session variables to keep open file handles. In ASP I could use IsObject(Session("var")) . What can be used in webforms to do...
5
by: joseph.paterson | last post by:
Hello, I'm having some trouble with accessing members of a structure i've defined... I've got something like this: #define bool short int #define TRUE 1 #define FALSE 0 #define...
2
by: swapnagg | last post by:
I am using cold fusion 8 to develop forms. I need to check if user has entered a value of type "text". If not then a message has to Cfoutput. i am using the following code: <cfif not...
1
by: cumupkid | last post by:
II am trying to create a form that will allow me to upload photos to a folder in the site root directory and add the information to the mysql db at the same time. I have created two forms, one...
5
by: reddem0n | last post by:
Hello, I've been working on trying to figure out how to script something where if a user enters more then one search term in the same fieldbox, it would query both of them and output it to a cf...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.