parameters

How do you pass an array by reference in Delphi?

I already read up about passing by reference and so procedure test(var x:integer); begin x:=x+5; end; so the above code updates 5 by reference. I assumed if I was updating an array by reference I could declare var X: array of blah... having some bound bugs and just wanted to know if I should be using the type of data for the pointer...

Defining types from other units in Delphi

Var A : Array [1..4] of Integer; B : Array [1..4] of Integer; Begin A := B; Won't work as loren-pechtel said here the problem is A and B for me are in different units. So, is there a way to define a type definition from a existing one in another class? ...

Why do I get a "Too many input arguments" error when not passing any?

I am working on some simple object-oriented code in MATLAB. I am trying to call one of my class methods with no input or output arguments in its definition. Function definition: function roll_dice Function call: obj.roll_dice; When this is executed, MATLAB says: ??? Error using ==> roll_dice Too many input arguments. Error in ==> ...

Creating URL query parameters from NSDictionary objects in ObjectiveC

With all the URL-handling objects lying around in the standard Cocoa libraries (NSURL, NSMutableURL, NSMutableURLRequest, etc), I know I must be overlooking an easy way to programmatically compose a GET request. Currently I'm manually appending "?" followed by name value pairs joined by "&", but all of my name and value pairs need to be...

How do I pass multiple parameters in Objective-C?

I have read several of the post about Objective-C method syntax but I guess I don't understand multiple names for a method. I'm trying to create a method called getBusStops with NSString and NSTimeInterval parameters and a return type of NSMutableArray. This is how I have constructed the method but it obviously gets errors at runtime: ...

Reporting Services - hide table column based upon report parameter

I have a report in Reporting Services 2005, and I want to hide or show a single table column based upon a report parameter. Does anyone have any idea how to do that? Thanks! ...

parameters in MySQLi

Hi - I'm using PHP with MySQLi, and I'm in a situation where I have queries like SELECT $fields FROM $table WHERE $this=$that AND $this2=$that2 So far I've written some code that splices up an array that I give it, for example: $search = array(name=michael, age=20) //turns into SELECT $fields FROM $table WHERE name=michael AND age=2...

problems with generics in C# in parameter

I have class like this: Class foo<T> { anotherfoo<T>; foo(){} foo(foo<T> aFoo) { anotherfoo = aFoo; } } void main() { foo<string> obj1 = new foo<string>(); foo<int> obj2 = new foo<int>(obj1); } This time I get a error: cannot convert from foo<string> to foo<int>. But I need have in this class "foo" another obj foo of anoth...

Pass to python method based on length of a list.

I have a list called 'optionlist' which may change length from day to day, but I want a tkinter dropdown box to be able to select something from it. Here's an example of how to define a tkinter optionmenu: opt1 = OptionMenu(root, var1, 'A', 'B', 'C') A, B, and C are the options you can select. The problem presented here is that whil...

Problem passing parameter to WebMethod with jQuery Ajax

Hello - I have a simple web method and ajax call and continue to recieve an error that saying that it can't convert a string to an IDictionary object??? Here is the ajax call: var params = '{"ID":"' + rowid + '"}'; $.ajax({ url: 'EDI.asmx/GetPartnerDetails', type: "POST", ...

C#: How to pass null to a function expecting a ref?

I've got the following function: public static extern uint FILES_GetMemoryMapping( [MarshalAs(UnmanagedType.LPStr)] string pPathFile, out ushort Size, [MarshalAs(UnmanagedType.LPStr)] string MapName, out ushort PacketSize, ref Mapping oMapping, out byte PagesPerSector);...

How do I access form properties with Invoke, but with object parameter in C#?

Hello, I couldn't describe the title of my question the best,I'm sorry. Currently,I use Invoke to access the properties on my form,It works perfect,but I have a function for each property,which is quite not comfortable. public static void EnableLogin(int enabled) { var form = Form.ActiveForm as FormMain; if (for...

How do I provide a string of Ids in a Select statement's IN clause even though the column is an integer

I'm paging data using an ObjectDataSource and I have the following method: public int GetNumberOfArticles(string employeeIds) { System.Data.DataTable dataTable; System.Data.SqlClient.SqlDataAdapter dataAdapter; System.Data.SqlClient.SqlCommand command; int numberOfArticles = 0; command = new System.Data.SqlClient.S...

Programatically determining amount of parameters a function requires - Python

I was creating a simple command line utility and using a dictionary as a sort of case statement with key words linking to their apropriate function. The functions all have different amount of arguments required so currently to check if the user entered the correct amount of arguments needed for each function I placed the required amoun...

Determine the name of the variable used as a parameter to a method

How would you, in C#, determine the name of the variable that was used in calling a method? Example: public void MyTestMethod1() { string myVar = "Hello World"; MyTestMethod2(myVar); } public void MyMethod2(string parm) { // do some reflection magic here that detects that this method was called using a variable called 'myVar' } ...

Is it good to send stack allocated object as a pointer parameter to some other function?

Is it good to send stack allocated object as a pointer parameter to some other function? ...

How do you call a Stored Procedure in SSIS?

I am trying to create an SSIS package that queries data from a table, and calls a stored procedure in another database with each row. In my old DTS package, I was doing this: EXEC myStoredProcedure ?, ?, ? ...and then I mapped the parameters. However, in SSIS, I can't figure out how to make this work. I have a Data Flow task, which...

How to store per-user parameters - opinions sought

Sorry this is quite an open-ended question! I am looking to enable users on my site to be able to modify html/css parameters for templates they use for their profiles - a bit like myspace (really, really sorry about using that as an example...). • There is a library of "themes" that can be selected by the user • Some themes can be cus...

C# - Syntactic sugar for out parameters?

Let us say for a moment that C# allowed multiple return values in the most pure sense, where we would expect to see something like: string sender = message.GetSender(); string receiver = message.GetReceiver(); compacted to: string sender, receiver = message.GetParticipants(); In that case, I do not have to understand the return val...

Publish crystal reports with htm-based parameter page to the intranet

Is there a way to publish my crystal reports and call them throuh html-based parameter page (preferably jsp) to our intranet? We have developed reports using Crystal Reports, and we want users to be able to call these reports through an HTML-based page through our itnranet. Any advice? ...