×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Mar 2006
    Location
    Somewhere, England
    Posts
    15

    Another error...

    This program is going to be the death of me i swear....

    Anyway, i've just written a method that converts a location string that's in the format xxyy.zzzz into xx.yyyyyy using a conversion formula that i've been given. when i compile the code i'm getting cannot resolve symbol errors and i havent a clue why.... can anyone help me?

    Code:
      public double convert (String data){ //example of data "5115.1234 N"
    
           splitData = new String[2];
           String xs;
           String ys;
           int i, length, j=7, post=0;
           double x, y, z, result;
           double ten=10, power;
           char direction;
    
           for(i=0; i<2; i++)
           {
               post = data.indexOf(".", j); //split the data in two at the dot
               splitData[i] = data.substring(j, post);
               j=post+1;
           }
           xs = splitData[0].substring(0, 4);
           ys = splitData[0].substring(4);
           x = Double.parseDouble(xs);
           y = Double.parseDouble(ys);
    
           length = splitData[1].length();
           direction = splitData[1].charAt(length);
           StringBuffer sb = new StringBuffer(splitData[1]);
           sb.deleteCharAt(length);  //the string needs to be put in a buffer to remove the last element
           splitData[1] = sb.toString();
           z = java.lang.Double.parseDouble(splitData[1]);
           power = length - 1;
           z = z / Math.pow(ten, power); //change z to 0.z
           y = (y+z)/60; // conversion formula
           result = x+y;
           return result;
    
      }
    i get the errors on the lines that i've made bold

  2. #2
    Super Contributor
    Join Date
    Mar 2006
    Location
    Phoenix, AZ. USA
    Posts
    556

    Re: Another error...

    aaannndeeeeee!!!

    you are importing java.lang.*;
    maybe also java.lang.Math.*;

    I think all of java.lang is imported by default but maybe not all the math methods, not sure.

    But the S60_2nd_FP3_MIDP_SDK

    does not have pow as a method of Math

    maybe your using a later edition?

    plugging in your code, i get an error/warning on
    splitData = new String[2];
    as it should be "String[] splitData = new String[2];"

    are you using cldc 1.0? as double is only in cldc 1.1

    I SWITCHED THE IDE, sorry, to cldc 1.1, and resolved the double errors, but i have import java.lang.*; like i said, dont know whether you need it or not

    it is still erroring on pow, saying unresloved symbol

    you may have to implement it manually, creating your own pow method

    good luck
    Jason Glass
    http://IChiBanComputers.Com

  3. #3
    Registered User
    Join Date
    Mar 2006
    Location
    Somewhere, England
    Posts
    15

    Re: Another error...

    cheers jason, i'll have a look tomorrow to see if this fixes it all. i'll have to check the cldc that my fone is using cos it might give me some problems down the line if it doesnt like doubles... and i've made my own power method aswell now. cheers for the help

  4. #4
    Super Contributor
    Join Date
    Mar 2006
    Location
    Phoenix, AZ. USA
    Posts
    556

    Re: Another error...

    thats cool man, lemme know if it works. and as far as cldc support, not sure on the percentage of devices with or without, but I know for Motorola, or most motorola, or, thats what I was told to do, we have to use cldc 1.0, so if your trying to get out on as many devices as psosoible, keep it in mind
    Jason Glass
    http://IChiBanComputers.Com

  5. #5
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: Another error...

    Hi,

    Just for your information, there is no need to explicitly include java.lang.*;

    The entire namespace is imported by default, in Java.

    BR

  6. #6
    Super Contributor
    Join Date
    Mar 2006
    Location
    Phoenix, AZ. USA
    Posts
    556

    Re: Another error...

    cool, was wondering whether or not, thanks juarez, and congrats on poster of the month award!
    Jason Glass
    http://IChiBanComputers.Com

  7. #7
    Registered User
    Join Date
    Mar 2006
    Location
    Somewhere, England
    Posts
    15

    Re: Another error...

    yeah it works, cheers jason. getting yet another runtime error now which will be fun to get rid of.....

  8. #8
    Super Contributor
    Join Date
    Mar 2006
    Location
    Phoenix, AZ. USA
    Posts
    556

    Re: Another error...

    Your welcome andybeeeeee
    Jason Glass
    http://IChiBanComputers.Com

  9. #9
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: Another error...

    Hi Jason,

    "cool, was wondering whether or not, thanks juarez, and congrats on poster of the month award!"


    It's very kind of you Jason, thanks a lot!

    BR,

    Juarez Junior

Similar Threads

  1. problem with Code Warrior 5.2
    By mayankkedia in forum Symbian
    Replies: 4
    Last Post: 2006-06-22, 08:26
  2. help !! about SIP errors
    By wgarnett in forum Symbian
    Replies: 3
    Last Post: 2006-05-17, 05:30
  3. S80 Platform SDK and Visual Studio .NET Linking Error
    By jayantjain in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2005-10-07, 22:14
  4. problem with codewarrior 5.2
    By mayankkedia in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2004-09-27, 16:08
  5. Cannot compile SDK's examples for 7650 platform...
    By midletsoft in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2003-08-12, 19:11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×