2

I am getting this weird error.

This is my code.

String AUD_Value, INR_Value;
Double AUD_d, INR_d, ftor;

HTTPRequest req = new HTTPRequest();
req.setEndPoint('http://api.fixer.io/latest?base=USD');
req.setMethod('GET');

HTTP h = new HTTP();
HTTPResponse resp = h.send(req);
System.debug('Response Status : '+resp.getStatus());
System.debug('Response Status Code : '+resp.getStatusCode());
System.debug('Response Body : '+resp.getBody());
String response_string = String.ValueOf(resp.getBody());

JSONParser parser = JSON.createParser(response_string);
while(parser.nextToken() ! = null)
{

    if(parser.getCurrentToken == JSONToken.FIELD_NAME)
    {
        if(parser.getText() == 'AUD')
        {
         parser.nextToken();
         AUD_Value = parser.getText();
        }
        if(parser.getText() == 'INR')
        {
            parser.nextToken();
            INR_Value = parser.getText();
        }
    }
}

AUD_d = Double.valueOf(AUD_Value);
INR_d = Double.valueOf(INR_Value);

ftor = INR_d/AUD_d;

System.debug('AUD_Value : '+AUD_Value);
System.debug('INR_Value : '+INR_Value);
System.debug('AUD_D : '+AUD_D);
System.debug('INR_D : '+INR_D);
System.debug('ftor : '+ftor);

When I try to Execute the above code in Anon Apex, I am getting the following error

enter image description here

I checked my code and do not find any "!" mark at all. Not sure why I am getting this error.

Can someone take a peek at this ?

  • 6
    You have ! = null that should be != null in your code. – Keith C Jan 21 '16 at 3:36
  • You are right..tx – Rainmaker Jan 21 '16 at 3:39
  • @KeithC Do you want to add an answer for this? – Daniel Ballinger Apr 8 '16 at 10:02
  • @DanielBallinger Done. – Keith C Apr 8 '16 at 11:52
2

You have ! = null that should be != null in your code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.