Bug Tracker 
| ID | 15🔗 |
|---|---|
| Date: | 2013-01-08 14:01:20 |
| Status | Closed (Fixed) |
| Category | datatool |
| Version | 2.11 |
| Summary | \DTLgetvalueforkey fails when key=0 |
Sign in to subscribe to notifications about this report.
Description
Thank you for datatool!; it has revolutionized my workflow.Please see the attached MWE.. pdflatex output looks like:
5.045455 Undefined Value 23.227273 32.318182 41.409091
MWE
Download (751B)
\documentclass[11pt,letterpaper]{article}
\usepackage{filecontents}
\begin{filecontents*}{data.out}
LOGDISTANCE,distance,barnum
-1,0.100000,5.045455
0,1.000000,14.136364
1,10.000000,23.227273
2,100.000000,32.318182
3,1000.000000,41.409091
4,10000.000000,50.500000
\end{filecontents*}
\usepackage{datatool}
\listfiles
\begin{document}
\DTLloadrawdb{MyDBase}{data.out}
\DTLgetvalueforkey\Onekm{barnum}{MyDBase}{LOGDISTANCE}{-1} \Onekm
\DTLgetvalueforkey\Onekm{barnum}{MyDBase}{LOGDISTANCE}{0} \Onekm
\DTLgetvalueforkey\Onekm{barnum}{MyDBase}{LOGDISTANCE}{1} \Onekm
\DTLgetvalueforkey\Onekm{barnum}{MyDBase}{LOGDISTANCE}{2} \Onekm
\DTLgetvalueforkey\Onekm{barnum}{MyDBase}{LOGDISTANCE}{3} \Onekm
\end{document}
Evaluation
The test for null was incorrectly interpreting 0 as a null value. Fixed in v2.13 (2013-01-15).
Comments
1 comment.
Replying to Comment #6:
Add Comment
Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=15

Date: 2013-03-15 05:45:29
Thanks!