Re: Translate attempt



francan00@xxxxxxxxx wrote:
String $inf [];

RedGrittyBrick wrote:
Unless this is some variant of Java I am unfamiliar with, variable names should not be prefixed with a dollar sign.

They should not be, but it's legal, strictly speaking.

<http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.8>
The Java letters include uppercase and lowercase ASCII Latin letters A-Z (\u0041-\u005a), and a-z (\u0061-\u007a), and, for historical reasons, the ASCII underscore (_, or \u005f) and dollar sign ($, or \u0024). The $ character should be used only in mechanically generated source code or, rarely, to access preexisting names on legacy systems.

Nevertheless, francan00, you should follow RGB's advice and eschew dollar signs in your Java identifiers. It may only say "should", but that's pretty close to "must" in this case.

francan00@xxxxxxxxx wrote:
if($inf.equals(getParameterValues($res)) {

RedGrittyBrick wrote:
and array elements should be indexed - e.g. if (inf[0].equals(...)) {

The method name 'getParameterValues()' implies return of an array or collection, so it is possible that the expression was meant to refer to the array as a whole.

With such tiny, incomplete fragments of code from the OP, one can only speculate, of course.

If that method does return an array, the OP may be surprised that 'equals()' between arrays doesn't do what they expect.

--
Lew
.



Relevant Pages

  • Re: Sort the output alphabetically
    ... > how do I have to change/edit my code that the output is sort by the ... > file name (from a-z)? ... $path_files = array(); ...
    (comp.lang.php)
  • Re: 79% Doesnt like Me
    ... Are you sure that it is not a rounding issue ... I am using the following array. ... The identical formula seems to work ok in the A-Z ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Newbie: test array for lower case
    ... Mark wrote: ... > I'm having problems with my testing for lower case in an array ... the texual value of the first element of @array with an anonymous array, ... that has the only element "a-z". ...
    (comp.lang.perl)
  • Re: Converting Text To Numbers
    ... the values to lookup in the array must be in ascending order. ... i.e. a-z in first half of array. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Need help with textboxes
    ... character into the input box. ... one of assigning the reference to a variable: ... All forms and their children are stored in an array ... No. Bracket property accessors allow their argument to be any string value. ...
    (comp.lang.javascript)