Getting a String from an applet method

I'm writing a page where a user enters the location of a local file and lets an applet calculate a binary hash of the file contents. I want the applet to give the hash string back to an empty textfield.
The code I'm using is:
<script language="JavaScript">
function hash() {
var test;
test = document.FtpApplet.hash('E:\downloadz\mysql-4.0.12-win.zip');
document.form.hash.value = test;
</script>
<FORM name="FTForm" method="post" action="#">
<input type="button" value="Send" onClick="document.FtpApplet.upload();"><br>
<input type="button" value="Hash" onClick="hash()"><br>
<input type="text" name="hash"> ...
My applet contains a ordinary public method giving back a string.
In IE6 I get a runtime error pointing to the hash() function. In Netscape7/Mozilla 1.3 nothing happens at all. I'm using the latest version of the java plug-in in all my browsers.
Could anyone help me out?

You should try to find a javascript forum.

Similar Messages

  • Is it possible to pass a string from an applet to the web site?

    Hi, everybody!
    Is it possible to pass a String from an applet to a web site (as a field value in a form, an ASP variable, or anything else). Basically, I have a pretty large String that is being edited by an applet. When a user clicks on the submit button, a different page will show up which has to display the modified string. The String is pretty large so it doesn't fit into the URL variable.
    Please, help!
    Thank you so much!

    Why do you want to do this in Java?
    Javascript is the correct language for these type of situations.
    for instance:
    in the head of your html document:
    <script language=javascript type="text/javascript">
    createWindow(form){
    if(form.text.value!=""){
    newDoc = new document
    newDoc.write(form.text.value)
    newWin = window.open(document,'newWin','width=200;height=150')
    </script>
    in the body:
    <form onSubmit="createWindow(this)">
    <p>
    Enter a String:<input type=text size=30 name="text">
    </p><p>
    <input type=submit value="submit"> 
    <input type=reset value="reset">
    </p>
    </form>

  • Getting current directory from an applet

    Hi. How can I get the current directory of my applet running on web without having to worry about permissin. I used the one below:
    curDir = System.getProperty("user.dir");
    but I get this error:
    ava.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
    any substiture for this? Thanks.

    You should be using URLs or similar approaches, and avoiding File, which will
    never work with an ordinary applet.
    InputStream in = this.getClass().getResourceAsStream("file.txt");That assumes the txt file is in the same place as the current classes .class file.
    For example, the same folder or that they are jarred in the same "folder" in the jar.
    You can also use a URL directly:
    URL url = ...
    InputStream in = url.openStream();and you can construct that URL with the help of Applet methods getDocumentBase or getCodeBase:
    URL url = new URL(this.getDocumentBase(), "file.txt");That assumes the txt file is in the same folder as the html file in which the applet is embedded.

  • Get specific Strings from File

    Good morning to every one.
    I 've got a text file which contains a customer number and an order number, coded as we see in the picture below:
    I am trying to develop a tool in Visual Studio, which it reads the file line-by-line and fills a listbox, with the order_number and the customer number. From the file above, I know that the order number are the digits on the first 'column' after the leading-zeros,
    until '/', and the customer number are the digits without zeros in the 'third' column before 'CUSTOMER_NUMBER'. My form looks like:
    The problem is, that the number of before the fields in file, are not equal in every line.
    So, my question is how I can retrieve the 'order number' and 'customer number' from the text file and copy the results to list box, after clicking on 'Get Strings' button, like:
    359962656   2238914
    359562804   2238914
    etc...
    I attach my code here:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;
    namespace ReadStringFileApp
    public partial class frmMain : Form
    public frmMain()
    InitializeComponent();
    OpenFileDialog openfile = new OpenFileDialog();
    //openfiledialog to pickup filename
    private void btnFindFile_Click(object sender, EventArgs e)
    openfile.Filter = "Text|*.txt";
    if (openfile.ShowDialog() == DialogResult.OK)
    lbxResults.Items.Clear();
    txtFilepath.Text = openfile.FileName.ToString();
    //get strings from file
    private void btnGetStrings_Click(object sender, EventArgs e)
    //check if there is a file path on textbox
    if (txtFilepath.Text == "")
    MessageBox.Show("No File Select. Please select a file", "Error File Name", MessageBoxButtons.OK, MessageBoxIcon.Error);
    btnFindFile.Focus();
    return;
    //create list for all lines inside file
    List<string> lines = new List<string>();
    string line;
    using (StreamReader r = new StreamReader(@txtFilepath.Text))
    while ((line = r.ReadLine()) != null)
    string ordernum;//string for order number
    string customer;//string for customer number
    //line = ordernum + "\t" + customer; //concatenate results to fill the list box
    lbxResults.Items.Add(line);
    r.Close(); //close file
    private void btnExportToFIle_Click(object sender, EventArgs e)
    //check if listbox is empty
    if (lbxResults.Items.Count == 0)
    MessageBox.Show("Result List is empty! Choose a file to proceed.", "Error Result List", MessageBoxButtons.OK, MessageBoxIcon.Error);
    btnGetStrings.Focus();
    return;
    //read listbox contents and parse to a list object
    List<string> list = new List<string>();
    foreach (String i in lbxResults.Items)
    list.Add(i);
    //Create a file in c: with results
    File.WriteAllLines(@"C:\export-test.txt", list, Encoding.Default);
    MessageBox.Show("File export completed!", "File Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
    Thank you in advanced

    @ Joel Engineer
    and@
    Val10
    I combined your responses and I get my results correctly. I attached the code I rewrite for further use:
    private void btnGetStrings_Click(object sender, EventArgs e)
    //check if there is a file path on textbox
    if (txtFilepath.Text == "")
    MessageBox.Show("No File Select. Please select a file", "Error File Name", MessageBoxButtons.OK, MessageBoxIcon.Error);
    btnFindFile.Focus();
    return;
    //create list for all lines inside file
    List<string> lines = new List<string>();
    string line;
    using (StreamReader r = new StreamReader(@txtFilepath.Text))
    while ((line = r.ReadLine()) != null)
    string order_customer;
    Regex reg = new Regex("0*");
    //set an string array, to split the file in columns positions, defining the characters
    string[] daneio = line.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    //get order number from the first column
    var ordernum_zeros = reg.Match(daneio[0]).Value;
    daneio[0] = daneio[0].Replace(ordernum_zeros, String.Empty);
    daneio[0] = daneio[0].Substring(0, daneio[0].IndexOf("/"));
    //get customer column, without zeros
    var customer_zeros = reg.Match(daneio[5]).Value;
    daneio[2] = daneio[2].Replace(customer_zeros, String.Empty);
    daneio[2] = daneio[2].Substring(0, daneio[5].IndexOf("CUSTOMER_NUMBER"));
    //combine the result in listbox
    order_customer = daneio[0] + "\t" + daneio[2];
    lbxResults.Items.Add(order_customer);
    r.Close(); //close file
    Thank you for your help!

  • Trying to get the string from javax.xml.transform.Source

    I have a SOAP client that will submit a string of data to a url and return an xml string back. It works ok besides that last part.
    I found on another site someone took the returned XML and printed it to the system print box. I want to just get the string out to a variable to pass back..
    This chunk works:
    TransformerFactory tff = TransformerFactory.newInstance();
    Transformer tf = tff.newTransformer();
    Source sc = rp.getSOAPPart().getContent();
    StreamResult result = new StreamResult(System.out);
    tf.transform(sc, result);
    System.out.println();Instead of this I just want to catch the XML string in a String variable. Thanks for the help.

    Instead of giving your StreamResult System.out, give it a StringWriter. You can then call toString on the StringWriter, and get what you're after
    StringWriter output = new StringWriter();
    TransformerFactory.newInstance().newTransformer().transform(source, new StreamResult(output));
    String xmlResult = output.toString();

  • Getting mulitiple certs from card applet

    Sir
    Actually i got some confusion in the java card applet. But now i want to also store the CA cert on the card.
    But on the process () method i just getting the instruction of get data and it returns the user certificate to the java card.
    case INS_GET_DATA:
    case INS_GET_RESPONSE:
    sendCertificate( apdu );
    break;
    Now i will have two certificates on the card. And i will have to retrieve them explicitly. What should i do now ???

    storing code is:
                   case INS_PUT_DATA:
                        if ( buffer[ISO7816.OFFSET_P1] == 0x06)
                             storeUserCertificate(buffer, ISO7816.OFFSET_CDATA, offset[OFFSET_RECV], len);     
                             if ((cla & 0x10) != 0x00)
                              offset[OFFSET_RECV] += len;
                             else
                              // last command in the chain
                                  userCertSize = (short) (offset[OFFSET_RECV] + len);
                              offset[OFFSET_RECV] = 0;
                        if ( buffer[ISO7816.OFFSET_P1] == 0x07)
                             storeCACertificate(buffer, ISO7816.OFFSET_CDATA, offset[OFFSET_RECV], len);     
                             if ((cla & 0x10) != 0x00)
                              offset[OFFSET_RECV] += len;
                             else
                              // last command in the chain
                                  caCertSize = (short) (offset[OFFSET_RECV] + len);
                              offset[OFFSET_RECV] = 0;
                   break;
         private void storeUserCertificate( byte[] source, short sourceOff, short destOff, short len )
               if ((short) (destOff + len) > FILE_SIZE)
                    ISOException.throwIt(ISO7816.SW_FILE_FULL);
              Util.arrayCopy(source, sourceOff, userCertBuffer, destOff, len);
         private void storeCACertificate( byte[] source, short sourceOff, short destOff, short len )
               if ((short) (destOff + len) > FILE_SIZE)
                    ISOException.throwIt(ISO7816.SW_FILE_FULL);
              Util.arrayCopy(source, sourceOff, caCertBuffer, destOff, len);
    /*********************************************************************/Getting code is:
                   case INS_GET_DATA:
                        if( buffer[ISO7816.OFFSET_P1] == 0x06)
                             sendCACertificate(apdu);
                        else if( buffer[ISO7816.OFFSET_P1] == 0x07)
                             sendUserCertificate(apdu);
                        break;
         private void sendUserCertificate(APDU apdu)
         try{
            // work out how many bytes to send this time and how many will be left
            short remain = (short) (userCertSize - offset[OFFSET_SENT]);
            boolean chain = remain > MAX_APDU;
            short sendLen = chain ? MAX_APDU : remain;
            // Get ready to send
            apdu.setOutgoing();
            apdu.setOutgoingLength(sendLen);
            apdu.sendBytesLong(userCertBuffer, offset[OFFSET_SENT], sendLen);
            // Check to see if there are more APDU's to send
            if (chain) {
                offset[OFFSET_SENT] += sendLen; // count the bytes sent
                ISOException.throwIt(ISO7816.SW_BYTES_REMAINING_00); // indicate there are more bytes to come
            } else {
                offset[OFFSET_SENT] = 0; // no more bytes to send
         catch( APDUException ex)
              ISOException.throwIt(ex.getReason());
         private void sendCACertificate(APDU apdu)
              try
                 // work out how many bytes to send this time and how many will be left
                 short remain = (short) (caCertSize - offset[OFFSET_SENT]);
                 boolean chain = remain > MAX_APDU;
                 short sendLen = chain ? MAX_APDU : remain;
                 // Get ready to send
                 apdu.setOutgoing();
                 apdu.setOutgoingLength(sendLen);
                 apdu.sendBytesLong(caCertBuffer, offset[OFFSET_SENT], sendLen);
                 // Check to see if there are more APDU's to send
                 if (chain)
                     offset[OFFSET_SENT] += sendLen; // count the bytes sent
                     ISOException.throwIt(ISO7816.SW_BYTES_REMAINING_00); // indicate there are more bytes to come
                 else
                     offset[OFFSET_SENT] = 0; // no more bytes to send
              catch( APDUException ex)
                   ISOException.throwIt(ex.getReason());
         }And the output is:
    CA certificate Endoding before sending: 
    In HEX (30820283308201ec020900f730a523693d4eeb300d06092a864886f70d0101050500308185310b300906035504061302504b310f300d06035504080c0650756e6a61623112301006035504070c0949736c616d61626164310e300c060355040a0c055345454353310b3009060355040b0c0249543110300e06035504030c0769766f69746e673122302006092a864886f70d01090116136d2e756d65724073656563732e6564752e706b301e170d3131303332353130313031315a170d3132303332343130313031315a308185310b300906035504061302504b310f300d06035504080c0650756e6a61623112301006035504070c0949736c616d61626164310e300c060355040a0c055345454353310b3009060355040b0c0249543110300e06035504030c0769766f69746e673122302006092a864886f70d01090116136d2e756d65724073656563732e6564752e706b30819f300d06092a864886f70d010101050003818d0030818902818100c72ee8ae34047681fa90e150c7f9ba36c6165cba6d907f7ce1ff29c810661b04b6e531d866842dceac910e969e84eabe5083d635e6fe91a0417e44971c30771ac051a6853fdbb090635d6063081ac8228f7b9bfdf8eb7622403bc5a15425f71307af75b56f27b5f51a1a88c9d43e3b1012b41e0d5e472df17a79b7d486fb707d0203010001300d06092a864886f70d0101050500038181005df2b166258a0af02aa816045be159d8072fe19a4cd2780dbe235220c6328c6ee5540d12720f0a797ea0cb86ca343bf64fb35c1d733e394421209f8a49192046199b321aa17042c34f90947f2a142dd637fbc3c812bdcfc95f6eeee32fa6712c5296781e2398c85b5fcd69010a86bf1e9321fa7b40a5dc1adeef8bf0367426c3)
    total size of the CA certificate is: 647
    In HEX (30820283308201ec020900f730a523693d4eeb300d06092a864886f70d0101050500308185310b300906035504061302504b310f300d06035504080c0650756e6a61623112301006035504070c0949736c616d61626164310e300c060355040a0c055345454353310b3009060355040b0c0249543110300e06035504030c0769766f69746e673122302006092a864886f70d01090116136d2e756d65724073656563732e6564752e706b301e170d3131303332353130313031315a170d3132303332343130313031315a308185310b300906035504061302504b310f300d06035504080c0650756e6a61623112301006035504070c0949736c616d61626164)255 bytes received::Response from card (cert):28416::6f00
    java.security.cert.CertificateException: Could not parse certificate: java.io.EOFException
         at sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:109)
         at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:305)
         at smarcard.host.app.SmartCardHostApp.getCACertificate(SmartCardHostApp.java:571)
         at smarcard.host.app.SmartCardHostApp.main(SmartCardHostApp.java:676)
    Caused by: java.io.EOFException
         at java.io.DataInputStream.readFully(DataInputStream.java:180)
         at java.io.DataInputStream.readFully(DataInputStream.java:152)
         at sun.security.util.DerValue.init(DerValue.java:374)
         at sun.security.util.DerValue.<init>(DerValue.java:302)
         at sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:104)
         ... 3 moreEdited by: Muhammad Umer on Apr 29, 2011 3:16 PM

  • Get PricingConditions values from PricingConditionPanel class method?

    Hi,
    The class PricingConditionPanel returns the arraylist of the pricing onditions on the item with method getPricingConditions(); through the interface PricingContainer.
    I am able to get the values in the arraylist returned by the class. It actually i think points to the object of the class PricingCondtion. It returns the size of the array same as it it there in the pricing panel in Order.jsp page. Two inetfaces are there linked:
    IPCPricingConditionSet
    IPCPricingCondition[]
    I want to get the value of Discount added to the item due to the campaign key addded to the item of sales order.
    constructors for both the classes are:
    PricingConditionPanel(   PricingContainer  pricingContainer, 
                                         boolean isSAPEventActive, 
                                         UIContext uiContext)
    PricingCondition(PricingConditionPanel pricingConditionPanel,
                             IPCPricingCondition ipcPricingCondition, UIContext uiContext)
    Kindly help me to link with the both the Classes.
    Please find the code below:
    ipcItemReference.setDocumentId(docID);
    ipcItemReference.setItemId(itemID);
    ipcItemReference.setConnectionKey(connectionKey);
    IPCItem ipcItem = ipcClient.getIPCItem(ipcItemReference);
    PricingContainer prContainer = new PricingItem(ipcItem);
    UIContext uiContextObj = new  UIContext();                              
    PricingConditionPanel priceCondPanel = new PricingConditionPanel(prContainer, true, uiContextObj);
    IPCPricingConditionSet IPCPricingCondSet = prContainer.getPricingConditions();
    IPCPricingCondition[] ipcPricingCond = IPCPricingCondSet.getPricingConditions();
    log.error("Pricing cond set: "+IPCPricingCondSet.getAvailableConditionTypeNames().getDescriptions());
    ArrayList alPriceCondPanel = new ArrayList();
    alPriceCondPanel = priceCondPanel.getPricingConditions();
    int alPriceSize = alPriceCondPanel.size();
    log.error("Size of array for prices: "+alPriceSize);
    Iterator itrPriceCondPanel = alPriceCondPanel.iterator();
    int m = 0;
    int n = 0;
    while (itrPriceCondPanel.hasNext()) {
         m++;
         log.error("Element" + m + " is : " + itrPriceCondPanel.next().toString());
         log.error("Element "+n+" value is: "+alPriceCondPanel.get(n).toString());     
    Thanks
    Ekta
    Edited by: ET on Jan 21, 2009 3:47 PM

    Thanks a lot Ram!
    Please find the code below, useful for others who visit SDN for Pricing conditions details!
                   for (int i = 0; i < ipcPricingCond.length; i++) {
                        IPCPricingCondition ipcCondition = ipcPricingCond<i>;
                        log.error("Condition description for element "+i+" is: "+ipcCondition.getDescription());
                        log.error("Condition type name for element "+i+" is :"+ipcCondition.getConditionTypeName());
                        if (ipcCondition.getConditionTypeName().equalsIgnoreCase("ZCM1"))
                          String condValue = ipcCondition.getConditionValue();
                          String condTypeName = ipcCondition.getConditionTypeName();
                          String ipcCondRate = ipcCondition.getConditionRate();
                          String ipcCondDesc = ipcCondition.getDescription();
                          log.error("Condition value: "+condValue);
                          log.error("Condition type name: "+condTypeName);
                          log.error("Condition rate: "+ipcCondRate);
                          log.error("Condition Description: "+ipcCondDesc);
    Thanks a lot!
    Ekta

  • How could java get two strings from c function?

    As title! I want to let a java code call C function. And the C funtion returns two unsigned char pointers.
    Thanks a lot.

    I have the other problem. When compile the code with jnienv, it always shows errors...It's because the code I posted is for C compiler, not C++.
    Here is a complete example in C++.
    Just compile the Java part, then the C++ part, then run it at the console:
    java TestCStringIt should give you:
    Hello
    World!
    // TestCString.java
    class TestCString
        static
            System.loadLibrary("testcstring");
        native String[] getStrings();
        public static void main(String[] args)
            TestCString test = new TestCString();
            String[] strArray = test.getStrings();
            System.out.println(strArray[0]);
            System.out.println(strArray[1]);
    // testcstring.h
    #ifndef _Included_TestCString
    #define _Included_TestCString
    #include <jni.h>
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class:     TestCString
    * Method:    getStrings
    * Signature: ()[Ljava/lang/String;
    JNIEXPORT jobjectArray JNICALL Java_TestCString_getStrings(JNIEnv * env, jobject obj);
    #ifdef __cplusplus
    #endif
    #endif /* _Included_TestCString */
    // testcstring.cpp
    #include "testcstring.h"
    static char * g1 = "Hello";
    static char * g2 = "World!";
    static void myCFunc(unsigned char ** pp1, unsigned char ** pp2)
        *pp1 = (unsigned char *)g1;
        *pp2 = (unsigned char *)g2;
    * Class:     TestCString
    * Method:    getStrings
    * Signature: ()[Ljava/lang/String;
    JNIEXPORT jobjectArray JNICALL Java_TestCString_getStrings(JNIEnv * env, jobject obj)
        unsigned char * p1;
        unsigned char * p2;
        jstring str1;
        jstring str2;
        jclass strCls;
        jobjectArray strArray;
        myCFunc(&p1, &p2); // call the c function
        str1 = env->NewStringUTF((const char *)p1); // create java string with first pointer
        str2 = env->NewStringUTF((const char *)p2); // create java string with second pointer
        strCls = env->FindClass("java/lang/String");
        strArray = env->NewObjectArray(2, strCls, NULL); // create java string array
        env->SetObjectArrayElement(strArray, 0, str1); // set first element
        env->SetObjectArrayElement(strArray, 1, str2); // set second element
        return strArray; // return java string array
    }Regards

  • Get only strings from Varchar2 Column

    Hi,
    How can I extract only strings form varchar2 type column?
    I have data like below.
    25-Abc xy
    233-xyz jj
    x23A
    9-dd
    5-aaa(pp)
    I need following outputs (- also be removed)
    Abc xy
    xyz jj
    xA
    dd
    aaa(pp)
    Thanks,
    Sujnan

    Maybe...
    API> WITH t AS (SELECT '25-Abc xy' AS col FROM DUAL
      2          UNION
      3          SELECT '233-xyz jj' FROM DUAL
      4          UNION
      5          SELECT 'x23A'  FROM DUAL
      6          UNION
      7          SELECT '9-dd'  FROM DUAL
      8          UNION
      9          SELECT '5-aaa(pp)'  FROM DUAL)
    10    SELECT TRANSLATE(col, '1234567890-', ' ') AS RES
    11    FROM t;
    RES
    xyz jj
    Abc xy
    aaa(pp)
    dd
    xA
    Transcurrido: 00:00:00.93

  • Getting a String from a web page

    HI there, i want to store a String on a web page as a String in my Java program to manipulated, here is the web page:
    ftp://weather.noaa.gov/data/observations/metar/stations/EGBB.TXT
    Does anybody have an idea where i should start with such an operation, is it even possible?
    Thank you!
    oookiezooo

    1) If you have a server, you can put a server side script up
    that
    returns the time quite easily. From Director, you would use
    getNetText() to pull it down
    2) If you click on the stage where there are no sprites,
    there will be,
    in the Property Inspector, a Display Template tab. There are
    your
    Titlebar options. Uncheck the ones you don't want to see
    (like for
    example "Close Box")

  • SQL Query to get match string from table

    Hi Experts,
    BANNER                                                                         
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production         
    PL/SQL Release 11.1.0.7.0 - Production                                         
    CORE     11.1.0.7.0     Production                                                     
    TNS for 32-bit Windows: Version 11.1.0.7.0 - Production                        
    NLSRTL Version 11.1.0.7.0 - Production                                         
    5 rows selected.
    WITH T AS
    SELECT 'JOHN' FIRSTNAME,'PLAYER' LASTNAME FROM DUAL UNION ALL
    SELECT 'MICHEAL','SMITH' LASTNAME FROM DUAL UNION ALL
    SELECT 'SCOTT','MANAGER' LASTNAME FROM DUAL UNION ALL
    SELECT 'FIRST NAME','LAST NAME' LASTNAME FROM DUAL
    )SELECT * FROM T;
    Input String to my Query will be "JOHN NAME SMITH"
    I need to match the input string to provide result based on Firstname OR Lastname from table.
    How can i acheive this?
    Thanks,

    what the problem in constructing??
    you can use something like this....
    declare
    vStrng varchar2(100) := 'JOHN NAME SMITH';
    v_temp varchar2(1000):= 'SELECT  DISTINCT  firstname,lastname FROM employees,
      (SELECT regexp_substr('''||vStrng||''',''[[:alpha:]]+'',1,level) parsedstr
         FROM dual
        CONNECT BY level<=LENGTH(regexp_replace('''||vStrng||''',''[[:alpha:]]'',''''))+1
      ) WHERE instr(firstname,parsedstr)>0 OR instr(lastname,parsedstr)      >0';
    vSQL varchar2(1000):= 'SELECT ENAME,EMPNO,DEPT.DEPTNO FROM EMP,DEPT WHERE EMP.DEPTNO=DEPT.DEPTNO AND (firstname,lastname) in ('||v_temp||')';
    begin
    --rest of your code....
    end;edit: In the same way...you can use any of the above mentioned solutions..
    Ravi Kumar
    Edited by: ravikumar.sv on Apr 6, 2010 4:12 PM

  • Getting the string from an NSTextField

    Hi there,
    I am trying to get and log (to ensure) the text of a text field in my app.
    NSString * whatYouSaid;
    whatYouSaid = [inputA objectValue];
    NSLog (@"%c", whatYouSaid);
    //[outputA setObjectValue:whatYouSaid];
    This will not log anything. What am I doing wrong?
    TIA,
    Ricky.

    And third of all...
    since NSLog expects an NSString * as it's first parameter you don't really need to specify a format string.
    NSString * whatYouSaid;
    whatYouSaid = [inputA stringValue];
    // No format string needed if you're logging an NSString *
    NSLog(whatYouSaid);
    // If you want to include a format string use %@ where your NSString goes
    NSLog(@"The value of whatYouSaid is "%@"", whatYouSaid);
    // In addition, since [inputA stringValue] returns an NSString * you
    // don't even need your variable unless you're going to use
    // the variable for some other purpose. You can just log the
    // message result directly like this...
    NSLog([inputA stringValue]);
    // or
    NSLog(@"Value of text field is "%@"", [inputA stringValue]);
    Steve

  • How we get all string from substring,.,.

    Hi,
    I am doing one application . In that i have to enter substrubg in search user inputfield and then i click on search . Not i want to show all user which contain that substring . So please guide in that.
    Example...
    Like i am writing "ab*" then all users comes which contain ab substring.
    Regards,
    Gurprit Bhatia

    Hi,
    Try this logic.
    String searchString="ab*";
    searchString=searchString.subString(0,searchString.length-2);
    String[] matchedArray=new matchedArray(100);
    int j=0;
    //Let your compare strings be in an array strArray
    for(int i=0;i<strArray.length;i++){
    String temp=strArray<i>.subString(0,searchString.length-2);
    if(temp.equals(searchString)){
      matchedArray[j]=strArray<i>;
      j++;
    Then display the matched String array.
    Hope it helps.
    Regards,
    Srinivasan Subbiah

  • How to get IP address from java applet

    is there anyway to find the IP address of a person who is on java applet on some chatting website (not me, but the other users)...... well, this question may sound stupid, but am actually new to this, so please help.
    :)

    >
    is there anyway to find the IP address of a person who is on java applet on some chatting website (not me, but the other users)...... >Sure. Ask whoever it is you are chatting to.. "wots ur ip?". Do not be surprised when they 'tell you where to go'.

  • Sumwun mus no !! Getting NT domain from within applet

    You can get the NT users name using System.getProperty("user.name") but is there a way of getting the NT domain that the user is logged on to ?

    Yo my brother, dont ya think dis is not da right plaze 4 using ghetto slang ?
    Anyway, i dont think you can do this for security reasons - you have to use JNI to call system properites out of a win32 dll.

Maybe you are looking for

  • Tns-12560: TNS protocol adapter error on linux

    I've installed an oracle 10g database on linux 4.6 in a VMWare image. After opening an x term window within the image, I'm getting a tns-12560 error when both running tnsping and opening a sqlplus session as a database user. The listener and database

  • Decimal places in double value

    I am sending a number to my program - 99999999.99 and parsing it as double. double d = Double.parseDouble("99999999.99"); When I print this out, it prints - 9.999999999E7 The problem is, my database won't accept it unless I provide this value exactly

  • How to get and display only some items out of an xml source

    hi everybody,<br /><br />i have a designer-pdf based on a xsd. from within this pdf i call a second one and pass global variables to it. i want to use these vars to get specifics items out of an xml source. example:<br /><br />say that my xml is buil

  • Output catalog name on large product layout

    Has anyone come across a way to output the catalog name on the large product layout? The nearest I can see getting is using jQuery to parse the breadcrumbs or the url. Ideally I want to do this so I can make some css changes on the product page depen

  • PAPI WSDL IS NOT

    I am using Oracle BPM 10.3 MP2 Enterprise Edition Version: 10.3.2 Build: #100486 We have 4 engines namely alengine, alengine2, alengine3, alengine4. In Process Admin, For alengine : Oracle® BPM PAPI Web Services EAR and Oracle® BPM Engine EAR are bot