Re: Array Question



amerar@xxxxxxx <amerar@xxxxxxx> wrote:

following error:


It is a warning message, not an error message.


Argument "" isn't numeric in printf at ./saba.pl line 151, <BFILE> line
^^
^^

Looks like you have an empty string somewhere.


Here is line 151:

printf FAN "@work_format\n",@d_ar;

Now, this is where it get crazy. @work_format is a FORMAT that looks
like this:

my @work_format=qw/%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s
%s %s %s %.3f %.3f %.3f %.3f
%.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f

[ snip a whole bunch more ]


My question is, how the hell do I know which element is throwing the
error??


By dumping the array.


I've dumped the array,


Good idea.


which looks like this:

158: +000000000000000.000
159: +000000000000010.000
160: +000000000000000.000
161: +000000000002200.000
162: +000000000000000.000
163:
164: +000000000005000.000
165:
166: +000000000000000.000

Those are elements of the array. It works with all other records in
the file except for this one. How do I know which format is throwing
the error????


Then ones that correspond to the empty strings.


Can anyone help?


With what?

You already know how to tell which format is causing the warning...


I've been at this for 4 days now.....


.... so by now you should have moved on to answering the next question:

Why does this record contain empty strings?

We cannot help you with that because we don't know how @d_ar
is being populated.


--
Tad McClellan SGML consulting
tadmc@xxxxxxxxxxxxxx Perl programming
Fort Worth, Texas
.



Relevant Pages

  • Writing an empty string to SQL Server using Db-Library
    ... I am experiencing problems in writing empty strings to ... the query from the Query Analyzer. ... table using the Enterprise Manager after ... The error message "Runtime Error: ...
    (microsoft.public.sqlserver.clients)
  • Writing empty string to SQL Server table using Db-Library
    ... I am experiencing problems in writing empty strings to ... the query from the Query Analyzer. ... table using the Enterprise Manager after ... The error message "Runtime Error: ...
    (microsoft.public.sqlserver.programming)