Search Results

Search found 15081 results on 604 pages for 'passing by reference'.

Page 69/604 | < Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >

  • VBScript: Passing Object to Function?

    - by ioplex
    The below example generates an error: VBScript compilation error: Cannot use parentheses when calling a Sub This error does not occur if all parameters are not objects. Is there a special way to pass object parameters to VBScript functions? Option Explicit Dim obj Function TestFunc(obj) WScript.Echo "Why doesn't this work?" End Function Set obj = CreateObject("Scripting.Dictionary") obj.Add("key", "val") TestFunc(obj) ' Error here!

    Read the article

  • opening a new page and passing a parameter to it with Javascript

    - by recipriversexclusion
    I have a JS function that processes XML I GET from a server to dynamically create a table as below // Generate table of services by parsing the returned XML service list. function convertServiceXmlDataToTable(xml) { var tbodyElem = document.getElementById("myTbody"); var trElem, tdElem; var j = 0; $(xml).find("Service").each(function() { trElem = tbodyElem.insertRow(tbodyElem.rows.length); trElem.className = "tr" + (j % 2); // first column -> service ID var serviceID = $(this).attr("service__id"); tdElem = trElem.insertCell(trElem.cells.length); tdElem.className = "col0"; tdElem.innerHTML = serviceID; // second column -> service name tdElem = trElem.insertCell(trElem.cells.length); tdElem.className = "col1"; tdElem.innerHTML = "<a href=javascript:showServiceInfo(" + serviceID + ")>" + $(this).find("name").text() + "</a>"; j++; }); // each service } where showServiceInfo retrieves more detailed information about each service from the server based on the serviceID and displays it in the same page as the services table. So far so good. But, it turns out that I have to display the detailed service information in another page rather than the same page as the table. I have creates a generic service_info.html with an empty layout template, but I don't understand how to pass serviceID to this new page so that it gets customized with the detailed service info. How can I do this? Or, is there a better way to handle these situations? Thanks!

    Read the article

  • Problem passing variables in php form.

    - by Joshxtothe4
    I have the following php form. I am trying to make it so that when the form is loaded, the values will be assigned the appropriate check- variable. This variable will contain either "checked or "". If it contains checked, the way it is displayed with the html should cause the relevant checkbox to be checked. As it is, the variables do not seem to be being passed. When I echo out $deleted or $notice from within the submitinfo branch, they are blank. Furthermore, nothing is being inserted into the database, and I am not getting any database error. How can I check this? <?php if (isset($_GET["cmd"])) $cmd = $_GET["cmd"]; else if (isset($_POST["cmd"])) $cmd = $_POST["cmd"]; else die("Invalid URL"); if (isset($_GET["pk"])) { $pk = $_GET["pk"]; } if (isset($_POST["deleted"])) { $deleted = $_POST["deleted"]; } if (isset($_POST["notice"])) { $notice = $_POST["notice"]; } $con = mysqli_connect("localhost","user","password", "db"); if (!$con) { echo "Can't connect to MySQL Server. Errorcode: %s\n". mysqli_connect_error(); exit; } $con->set_charset("utf8"); $getformdata = $con->query("select * from STATUS where ARTICLE_NO = '$pk'"); $checkDeleted = ""; $checkNotice = ""; while ($row = mysqli_fetch_assoc($getformdata)) { $checkDeleted = $row['deleted']; $checkNotice = $row['notice']; } if($cmd=="submitinfo") { $statusQuery = "INSERT INTO STATUS VALUES (?, ?)"; if ($statusInfo = $con->prepare($statusQuery)) { $statusInfo->bind_param("ss", $deleted, $notice); $statusInfo->execute(); $statusInfo->close(); echo "true"; } else { echo "false"; } print_r($con->error); } if($cmd=="EditStatusData") { echo "<form name=\"statusForm\" action=\"test.php\" method=\"post\" enctype=\"multipart/form-data\"> <h1>Editing information for auction: ".$pk."</h1> Löschung Ebay: <input type=\"checkbox\" name=\"deleted\" value=\"checked\" ".$checkDeleted." /> <br /> Abmahnung: <input type=\"checkbox\" name=\"notice\" value=\"checked\" ".$checkNotice." /> <br /> <input type=\"hidden\" name=\"cmd\" value=\"submitinfo\" /> <input name=\"Submit\" type=\"submit\" value=\"submit\" /> </form>"; } else { print_r($con->error); }

    Read the article

  • Passing values from action class to model class in symfony

    - by THOmas
    I have a action class for saving some data to a database.In action class iam getting a id through url.I have to save the id in table. I am getting the id by $request-getParameter('id') I used this code for saving $this-form-bind($request-getParameter('question_answers')); if ($this-form-isValid()) { $this-form-save(); $this-redirect('@homepage'); } in model class i used a override save method to save extra field public function save(Doctrine_Connection $conn = null) { if ($this-isNew()) { $now=date('Y-m-d H:i:s', time()); $this->setPostedAt($now); } return parent::save($conn); so i want to get the id value here . So how can i pass id value from action class to model class is any-other way to save the id in action class itself Thanks in advance

    Read the article

  • Passing session data to ModelForm inside of ModelAdmin

    - by theactiveactor
    I'm trying to initialize the form attribute for MyModelAdmin class inside an instance method, as follows: class MyModelAdmin(admin.ModelAdmin): def queryset(self, request): MyModelAdmin.form = MyModelForm(request.user) My goal is to customize the editing form of MyModelForm based on the current session. When I try this however, I keep getting an error (shown below). Is this the proper place to pass session data to ModelForm? If so, then what may be causing this error? TypeError at ... Exception Type: TypeError Exception Value: issubclass() arg 1 must be a class Exception Location: /usr/lib/pymodules/python2.6/django/forms/models.py in new, line 185

    Read the article

  • passing self data into a recursive function

    - by user272689
    I'm trying to set a function to do something like this def __binaryTreeInsert(self, toInsert, currentNode=getRoot(), parentNode=None): where current node starts as root, and then we change it to a different node in the method and recursivly call it again. However, i cannot get the 'currentNode=getRoot()' to work. If i try calling the funcion getRoot() (as above) it says im not giving it all the required variables, but if i try to call self.getRoot() it complains that self is an undefined variable. Is there a way i can do this without having to specify the root while calling this method?

    Read the article

  • Passing Data of WebView to Another Activity

    - by meygraph
    I've designed a training program and Html texts and image put into training. I want to address my html file by an activity to sent another activity. This is MainActivity /* * ListView item click listener. So we'll have the do stuff on click of * our ListItem */ listViewArticles.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { switch (position) { case 0: Intent newActivity0 = new Intent(TrickPage.this,a_Dotted_Lines.class); startActivity(newActivity0); break; case 1: Intent newActivity1 = new Intent(TrickPage.this,TutorialsPage.class); startActivity(newActivity1); break; case 2: Intent newActivity2 = new Intent(TrickPage.this,TutorialsPage.class); startActivity(newActivity2); break; case 3: Intent newActivity3 = new Intent(TrickPage.this,TutorialsPage.class); startActivity(newActivity3); break; default: // Nothing do! } and this SecondActivity (show WebView) public class a_Dotted_Lines extends Activity { private WebView webView; @SuppressLint("SetJavaScriptEnabled") @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.a_dotted_lines); // Button HOME ImageButton ImageButton_home = (ImageButton) findViewById(R.id.ImageButton_home); ImageButton_home.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(); intent.setClass(a_Dotted_Lines.this, Main.class); startActivity(intent); overridePendingTransition(R.anim.fadein, R.anim.fadeout); } }); //Button Previous ImageButton ImageButton_previus = (ImageButton) findViewById(R.id.ImageButton_previus); ImageButton_previus.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //Closing SecondScreen Activity finish(); } }); webView = (WebView) findViewById(R.id.webview_compontent); webView.getSettings().setJavaScriptEnabled(true); webView.loadUrl("file:///android_asset/html/article.htm"); } } I want Send "file:///android_asset/html/article.htm" or other addres from MainActivity Is it possible? Sorry My English is not good

    Read the article

  • Passing a formula field value into a Crystal Reports command

    - by DarkDeny
    Hello eveybody! I have a report, in which I calculate starting date via Formula Fields. Then I need to pass calculated value into a subreport, where I can use it as one of the parameters for the stored procedure in my database. The problem is that for some reason value of the corresponding parameter when the database is queried is empty (or null, I am not sure exactly). What can be wrong in my report template? The formula I use is: ToText( ShiftDateTime ({@StartDate}, {?TimeZone}, "UTC,0")) Name of this formula field is StartDate I pass it into subreport as a Pm-?@StartDateUTC (also tried Pm-@StartDateUTC). I am sure, that @StartDate has correct value (tested in preview with this field in report), also Pm-?@StartDateUTC does has a value, but when CR is accessing DB - the result is empty field value...

    Read the article

  • Passing parameter to pthread

    - by Andrei Ciobanu
    Hello, i have the following code: #include <stdlib.h> #include <stdio.h> #include <pthread.h> #define NUM_THREADS 100 struct thread_param { char *f1; char *f2; int x; }; void *thread_function(void *arg){ printf("%d\n", ((struct thread_param*)arg)->x); } int main(int argc, char *argvs[]){ int i, thread_cr_res = 0; pthread_t *threads; threads = malloc(100 * sizeof(*threads)); if(threads == NULL){ fprintf(stderr,"MALLOC THREADS ERROR"); return (-1); } for(i = 0; i < NUM_THREADS; i++){ struct thread_param *tp; if((tp = malloc(sizeof(*tp))) == NULL){ fprintf(stderr,"MALLOC THREAD_PARAM ERROR"); return (-1); } tp->f1 = "f1"; tp->f2 = "f2"; tp->x = i; thread_cr_res = pthread_create(&threads[i], NULL, thread_function, (void*)tp); if(thread_cr_res != 0){ fprintf(stderr,"THREAD CREATE ERROR"); return (-1); } } return (0); } What i want to achieve, is to print all the numbers from 0 to 99, from threads. Also i am experimenting a way to pass a structure as a thread input parameter. What i am finding curios, is that not all the numbers are shown, eg: ./a.out | grep 9 9 19 29 39 49 And sometimes some numbers are shown twice: ... 75 74 89 77 78 79 91 91 Can you please explain me why is this happening ? No errors are shown.

    Read the article

  • Passing arguments stored in a file when running projects in Netbeans

    - by oderebek
    My problem is that I can't remember how I can pass the arguments when running a project in netbeans. There is not enough documentation on web if anybody could help it would be highly appreciated. Here is what I know, you can change the run configurations under run Set Project Configuration Default Configuration there there is a entry space where zou can enter the arguments to be passed. I have a file called "AsciiShop.java" which to be runned and I need to pass the arguments stored in a file called "asciishop-A04-PP.i1". When I am using terminal or cmd.exe I can run the program with java AsciiShop < asciishop-A04-PP.i1 and it works perfect. I want to be able to the same on netbeans. I have placed the file in the default working directory which contains src and bin folders. What should I write in the arguments entry field on the project configurations window, so that it works same like java AsciiShop < asciishop-A04-PP.i1

    Read the article

  • Problem with passing parameters to SQL procedure using VBA

    - by Stefan Åstrand
    Hi, I am trying to pass @intDocumentNo and @intCustomerNo to a stored procedure using VBA but only @intCustomerNo is updated in dbo.tblOrderHead. I don't think the problem is with the procedure because if I enter the values manually it runs properly. What am I doing wrong? VBA Code: Private Sub intCustomerNo_Click() Dim cmdCommand As New ADODB.Command With cmdCommand .ActiveConnection = CurrentProject.Connection .CommandType = adCmdStoredProc .CommandText = "uspSelectCustomer" '@intDocumentNo .Parameters("@intDocumentNo").Value = Forms![frmSalesOrder].[IntOrderNo] '@intCustomerNo .Parameters("@intCustomerNo").Value = Me![intCustomerNo] .Execute End With DoCmd.Close Forms![frmSalesOrder].Requery End Sub Procedure: UPDATE dbo.tblOrderHead SET dbo.tblOrderHead.intCustomerNo = @intCustomerNo , dbo.tblOrderHead.intPaymentCode = dbo.tblCustomer.intPaymentCode, dbo.tblOrderHead.txtDeliveryCode = dbo.tblCustomer.txtDeliveryCode, dbo.tblOrderHead.txtRegionCode = dbo.tblCustomer.txtRegionCode, dbo.tblOrderHead.txtCurrencyCode = dbo.tblCustomer.txtCurrencyCode, dbo.tblOrderHead.txtLanguageCode = dbo.tblCustomer.txtLanguageCode FROM dbo.tblOrderHead INNER JOIN dbo.tblCustomer ON dbo.tblOrderHead.intCustomerNo = dbo.tblCustomer.intCustomerNo AND dbo.tblOrderHead.intOrderNo = @intDocumentNo

    Read the article

  • Apache + Passenger not passing on custom status codes

    - by harm
    I'm currently building an API. This API communicates with the client via status codes. I created several custom status codes (as per http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6) in order to inform the client on certain things. For example I introduced the 481 status code to signify a specific client error. The Rails app I wrote works like a charm. But when Apache and Passenger are serving it things run aground. When I provoke a 481 error the response header looks like this: HTTP/1.1 500 Internal Server Error Date: Wed, 19 May 2010 06:37:05 GMT Server: Apache/2.2.9 (Debian) Phusion_Passenger/2.2.5 mod_ssl/2.2.9 OpenSSL/0.9.8g X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 2.2.5 Cache-Control: no-cache X-Runtime: 1938 Set-Cookie: _session_id=32bc259dc763193ad57ae7dc19d5f57e; path=/; HttpOnly Content-Length: 62 Status: 481 Content-Type: application/json; charset=utf-8 As you can see the original Status header is still there almost a the end. But the 'true' status header (the very first line) is quiet different. It seems that Apache doesn't like Status headers it has no knowledge of and thus assumes an error. Is there anyway to fix this? Maybe via the mod_headers ( http://httpd.apache.org/docs/2.2/mod/mod_headers.html) module? I don't know enough of Apache to figure this out on my own. Thanks,

    Read the article

  • passing url in parameters mvc4

    - by user516883
    I have a site that collects urls. A full http url is enter into a texbox. I am getting a 400 error when a url is being passed in the parameter, It works fine with regular text. Using jquery how can I pass the full URL in my application. Thanks for any help. MVC Routing Config routes.MapRoute("UploadLinks", "media/upload_links/{link}/{albumID}", new { controller = "Media", action = "WebLinkUpload" }); Controller Action public ActionResult WebLinkUpload(string link, string albumID){} Jquery ajax call $('#btnUploadWebUpload').click(function () { $.ajax({ type: "GET", url: "/media/upload_links/" + encodeURIComponent($('#txtWebUrl').val().trim()) + "/" + currentAlbumID, contentType: "application/json; charset=utf-8", dataType: "json", success: function (result) { } }); });

    Read the article

  • richfaces suggestionBox passing additional values to backing bean

    - by Martlark
    When using the rich faces suggestionBox how can you pass more than one id or value from the page with the text input to the suggestionBox backing bean. ie: to show a list of suggested cities within a selected state? Here is my autoComplete method. public List< Suburb > autocomplete(Object suggest) { String pref = (String) suggest; ArrayList< Suburb > result = new ArrayList< Suburb >(); Iterator< Suburb > iterator = getSuburbs().iterator(); while( iterator.hasNext() ) { Suburb elem = ((Suburb) iterator.next()); if( (elem.getName() != null && elem.getName().toLowerCase().indexOf( pref.toLowerCase() ) == 0) || "".equals( pref ) ) { result.add( elem ); } } return result; } As you can see there is one value passed from the page, Object suggest, which is the text of the h:inputText (in the faceLets m:textFormRow ) <m:textFormRow id="suburb" label="#{msgs.suburbPrompt}" property="#{bean[dto].addressDTO.suburb}" required="true" maxlength="100" size="30" /> <rich:suggestionbox height="200" width="200" usingSuggestObjects="true" suggestionAction="#{suburbsMBean.autocomplete}" var="suburb" for="suburb" fetchValue="#{suburb.name}" id="suggestion"> <h:column> <h:outputText value="#{suburb.name}" /> </h:column> </rich:suggestionbox> Earlier in the page you can select a state which I'd like to use to pare down the list of suburbs that the suggestion box displays.

    Read the article

  • Asp.net error object not set to a reference

    - by Frank
    Hi all, Because I rush in development (a lot of whip cracking here) and declare my objects at the top of the function and instantiate inside my try-catch block, I get a lot of the good old "object not set to an instance of an object" errors while doing TDD, and later if I do miss a branch that object was used in (doing VB now, would prefer C#) or just in every day coding, object not set to an instance of an object is a bit vague. Sure the stack trace sends me to the line the error occured at, but it would be nice if I could modify my logging to either name the object or its type because sometimes I have multiple objects on the same line. It's not the end of the world, but in the end it would save me a few minutes each day. Any ideas on how I can pass the info on which object wasn't set? Thanks

    Read the article

  • Passing Variable or Something to Iframe Parent PHP/JS/Html

    - by Belgin Fish
    Alright, well this is the deal. I have a page, and then it loads an iframe. When anything inside the iframe is clicked, the main page (iframe parent) just reloads. How can I have it, so that if the iframe parent is reloaded from a click inside the iframe that a certain boolean or something is passed, displaying something different. Thanks

    Read the article

  • Javascript: Passing large objects or strings between function considered a bad practice

    - by Mr. Smee
    Is it considered a bad practice to pass around a large string or object (lets say from an ajax response) between functions? Would it be beneficial in any way save the response in a variable and keep reusing that variable? So in the code it would be something like this: var response; $.post(url, function(resp){ response = resp; }) function doSomething() { // do something with the response here } vs $.post(url, function(resp){ doSomething(resp); }) function doSomething(resp) { // do something with the resp here } Assume resp is a large object or string and it can be passed around between multiple functions.

    Read the article

  • Trouble passing a string as a SQLite ExecSQL command

    - by Hackbrew
    I keep getting the ERROR: near "PassWord": syntax error when trying to execute the ExecSQL() statement. The command looks good in the output of the text file. In fact, I copied & pasted the command directly into SQLite Database Browser and the commend executed properly. Here's the code that's producing the error: procedure TForm1.Button1Click(Sender: TObject); var i, iFieldSize: integer; sFieldName, sFieldType, sFieldList, sExecSQL: String; names: TStringList; f1: Textfile; begin //Open Source table - Table1 has 8 fields but has only two different field types ftString and Boolean Table1.TableName:= 'PWFile'; Table1.Open; //FDConnection1.ExecSQL('drop table PWFile'); sFieldList := ''; names := TStringList.Create; for i := 0 to Table1.FieldCount - 1 do begin sFieldName := Table1.FieldDefList.FieldDefs[i].Name; sFieldType := GetEnumName(TypeInfo(TFieldType),ord(Table1.FieldDefList.FieldDefs[i].DataType)); iFieldSize := Table1.FieldDefList.FieldDefs[i].Size; if sFieldType = 'ftString' then sFieldType := 'NVARCHAR' + '(' + IntToStr(iFieldSize) + ')'; if sFieldType = 'ftBoolean' then sFieldType := 'INTEGER'; names.Add(sFieldName + ' ' + sFieldType); if sFieldList = '' then sFieldList := sFieldName + ' ' + sFieldType else sFieldList := sFieldList + ', ' + sFieldName + ' ' + sFieldType; end; ListBox1.Items.Add(sFieldList); sExecSQL := 'create table IF NOT EXISTS PWFile (' + sFieldList + ')'; // 08/18/2014 - Entered this to log the SQLite FDConnection1.ExecSQL Command to a file AssignFile(f1, 'C:\Users\Test User\Documents\SQLite_Command.txt'); Rewrite(f1); Writeln(f1, sExecSQL); { insert code here that would require a Flush before closing the file } Flush(f1); { ensures that the text was actually written to file } CloseFile(f1); FDConnection1.ExecSQL(sFieldList); Table1.Close; end; Here's the actual command that gets executed: create table IF NOT EXISTS PWFile (PassWord NVARCHAR(10), PassName NVARCHAR(10), Dept NVARCHAR(10), Active NVARCHAR(1), Admin INTEGER, Shred INTEGER, Reports INTEGER, Maintain INTEGER)

    Read the article

  • passing parameters to javacsript using php

    - by ayush
    i have the following line of code - <a href="javascript:;" onClick="tweeet('myid')">My Tweets!</a> Now while this is working perfectly fine the following line is not - <a href="javascript:;" onClick="tweeet(<?php echo 'myid'; ?>)">My Tweets!</a> Can anyone help me out why it is not working and suggest any changes. The variable i want to pass to the javascript function is a php variable. also i have tried the php with single quotes and double quotes but it is not working.

    Read the article

  • Passing Values to Controllers

    - by Dru
    I'm trying to allow users to 'favorite' links (that is, create a new Favorite record with their user_id and the link_id) This is what I have so far.. When I click favorite (as a user), the new record is assigned to the user_id but the link_id field is nil. How can I pass the link_id into my FavoritesController? My View Code Added Link Model Code class FavoritesController < ApplicationController def create @user = User.find(session[:user_id]) @favorite = @user.favorites.create :link_id => params[:id] redirect_to :back end end The Favorite model belongs to :user and :link Note: I've also tried this but when I click 'favorite', there's an error "Couldn't find Link without an ID." Update <%= link_to "Favorite", :controller => :favorites, :action => :create, :link_id => link.id %> with class FavoritesController < ApplicationController def create @user = User.find(session[:user_id]) @favorite = @user.favorites.create :link_id => :params[:link_id] redirect_to :back end end Returns "can't convert Symbol into Integer" app/controllers/favorites_controller.rb:4:in [] app/controllers/favorites_controller.rb:4:in create I've tried forcing it into an Integer several ways with .to_i

    Read the article

  • Problem in passing arrays from C# to C++

    - by Rakesh K
    Hi, I have an application in which I need to pass an array from C# to a C++ DLL. What is the best method to do it? I did some search on Internet and figured out that I need to pass the arrays from C# using ref. The code for the same: status = IterateCL(ref input, ref output); The input and output arrays are of length 20. and the corresponding code in C++ DLL is IterateCL(int *&inArray, int *&outArray) This works fine for once. But if I try to call the function from C# in a loop the second time, the input array in C# is showing up as an array of one element. Why is this happening and please help me how I can call this function iteratively from C#. Thanks, Rakesh.

    Read the article

  • How do I reference sqlite db column to use in update statement

    - by user244190
    I am trying to update a datetime column in an android sqlite db to use international date format (yyyy-mm-dd) instead of the current format (mm/dd/yyyy). I want to use the sqlite date() function to reformat the current value of the column. I thought it would be as simple as the following: update tblename set thedate = date(thedate) but the above does not work. How would i write the sql statement to accomplish this? thanks patrick

    Read the article

  • How can I programmatically construct the object reference?

    - by Bryan
    Lets just say that I have three textboxes: TextBox1, TextBox2, TextBox3. Normally if I wanted to change the text for example I would put TextBox1.Text = "Whatever" and so on. For what I'm doing right now I would like to something like (TextBox & "i").Text. That obviously isn't the syntax I need to use I'm just using it as an example for what I need to do. So how can I do something like this? The main reason I'm doing this is to reduce code with a loop. Please keep in mind that I'm not actually changing the text of the textboxes I'm simply using that as an example to get the point across.

    Read the article

  • VB.NET template instance - passing a variable data type

    - by FerretallicA
    As the title suggests, I'm tyring to pass a variable data type to a template class. Something like this: frmExample = New LookupForm(Of Models.MyClass) 'Works fine Dim SelectedType As Type = InstanceOfMyClass.GetType() 'Works fine repoGeneric = New Repositories.Repository(Of SelectedType) 'Ba-bow! repoGeneric = New Repositories.Repository(Of InstanceOfMyClass.GetType()) 'Ba-bow! I'm assuming it's something to do with the template being processed at compile time but even if I'm off the mark there, it wouldn't solve my problem anyway. I can't find any relevant information on using Reflection to instance template classes either. (How) can I create an instance of a dynamically typed repository at runtime?

    Read the article

< Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >