function

Custom Functions in Crystal Reports 8.5 ?

Hi all... I could've sworn there was a way to do this (without DLLs), but going through the first several pages of google, I can't find it. Maybe I'm thinking of something else. I'm having to do some development in Crystal Reports 8.5. I thought there was a way to write custom functions. Something like creating a custom formula then wr...

C++ how to test the function to make it throw an error?

The function that needs to be tested is: int hire(Payroll * p) throw(out_of_range, logic_error) { // error if no holes left if (staffcount == MAX_EMPLOYEES) throw (out_of_range("Hire: Too many employees")); // spin down holes looking for a hole. for (int i = 0; i < MAX_EMPLOYEES; ++i) { ...

Throw a logic error for this function

This the function. I dealt with throwing an out_of_range error and can't think of any logic error for this. Any suggestions? Thank you. int hire(Payroll * p) throw (out_of_range, logic_error){ // error if no holes left if (staffcount == MAX_EMPLOYEES) throw (out_of_range("Hire: Too many employee...

SQL: Using Where in a query with a function

SELECT col1, col2, dbo.myFunc(@param1, @param2, col1, col2) FROM theTable how do I add a "WHERE" here to the result of the function dbo.myFunc, like WHERE resultOfMyFunc > 10 for example? ...

Add a second Address line into this custom function (Filemaker Pro)

I want to add a second Address field into this custom function (ie. Apt. #101). If you wanted, you could explain how the Case(not IsEmpty works and I would be willing to attempt to add the second address field in myself... Let( [ x1 = Name; x2 = x1 & Case(not IsEmpty(Address); Case(not IsEmpty(x1); "¶") & Address); x3 = Case...

MATLAB function for 'does matrix contain value X?' (ala php's in_array())

Is there a built in matlab function to find out if a matrix contains a value? Thanks ...

Map strings to numbers maintaining the lexicographic ordering

I'm looking for an algorithm or function that is able to map a string to a number in such way that the resulting values correspond the lexicographic ordering of strings. Example: "book" -> 50000 "car" -> 60000 "card" -> 65000 "a longer string" -> 15000 "another long string" -> 15500 "awesome" -> 16000 As a function it should be somet...

Pass by reference in C

I'm trying to use pass by reference in C so that the function can modify the values of the parameters passed to it. This is the function signature: int locate(char *name, int &s, int &i) However when I try to compile it I get this error that refers specifically to the above line: error: expected ‘;’, ‘,’ or ‘)’ before '&' token...

JavaScript: Find out if function is anonymous or is defined in a object

I'm trying to write a helper method in JavaScript. It should act differently if one sends in a function or an reference to a function. I want to like to use it like this: helper('div', function () { return false; }) helper('div', obj.fn) What I can't figure out is: how to inside the helper function tell the difference between the two...

Template type deduction in C++ for Class vs Function?

Why is that automatic type deduction is possible only for functions and not for Classes? ...

Declaring functions in JavaScript

Possible Duplicate: Javascript: var functionName = function() {} vs function functionName() {} What's the difference between these two ways of declaring a function? function someFunc() { ... } var someFunc = function() { ... } I'm not asking in the technical sense. I'm not asking which is better for readability, or which sty...

JQuery shortcut for callbacks like function(){ mycallback() }

Hi javascript developers, Is there a way to reduce the boilerplate required to define a function in jquery? (My example is with a callback but it could apply to any anon function.) $('#dialog').load('/index.cgi',{p:'myform'}, function(){ ajaxify_form() }); What I would like is to do $('#dialog').load('/index.cgi',{p:'myform'}, ...

How to reuse custom functions across multiple Crystal Reports? (Visual Studio 2005)

I'm using Crystal Reports within Visual Studio 2005 and I have a few custom functions that I'd like to use in all my reports. Is there a way I can add these to all the reports without simply copying & pasting? I think perhaps in other versions of CR there is a Repository for functions but I don't see it in VS2005. If not, is there a way...

how to define functions in jquery?

I've the code below that works great in my ready function in jquery, when i fill the form and change focus from the input element to another run the ajax check and assign a css class to the element, showing if is validated or not. everything ok. id' like to define with this code a function so i can call it also when the page is just lo...

JSP Problem ussing implicit object (session) in a function

Can the object of type HttpSession called session be accessed from a function? In a simple jsp page I have a function(see below) defined in the header of the page, and set to an onclick handle of for a button. When I press this button, I'll never see the second alert message. If I do something in the body of the page (like Session ID...

C++ allocating dynamic memory in a function - newbie question

I'm investigating a memory leak and from what I see, the problem looks like this: int main(){ char *cp = 0; func(cp); //code delete[] cp; } void func(char *cp){ cp = new char[100]; } At the //code comment, I expected cp to point to the allocated memory, but it still is a null pointer meaning I never delete the mem...

importance of function wrappers in javascript

Can someone explain to me the importance of using function wrappers (ie: when assigning onclick functionality)? I know I should, but I don't fully understand why... Example: It's my understanding that this: $(callingImg)[0].setAttribute("onclick", "function(){removeChildren(this);}"); is better than this: $(callingImg)[0].setAttribu...

Hash Object problem in C++

Hello, In some C++ program I have two classes - Abc and Xyz. The Abc class contains an integer member Foo, like in the following listing: class Abc { public: int Foo; Abc(int f) { Foo = f; } }; class Xyz{}; I'm using a map<Abc, Xyz> but the performance is extremly poor. That's why I'd like to use a hash_map<Abc, Xyz> (Dev-Cp...

ESP Error when I call an API function?

platform : win32 , language : c++ I get this error when I call an imported function I declared: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different c...

Getting ruby function object itself

In Ruby, everything is supposed to be an object. But I have a big problem to get to the function object defined the usual way, like def f "foo" end Unlike in Python, f is the function result, not the function itself. Therefore, f(), f, ObjectSpace.f are all "foo". Also f.methods returns just string method list. How do I access th...