Latest news 2021-06-05: New blog post: Dickimaw Books Site Account.

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.

🔗Comment from OP
Date: 2013-03-15 05:45:29

Thanks!

Replying to Comment #6:

Name (optional):

Are you human? Please confirm the bug report ID (which can be found at the top of this page) or login if you have an account.

Comment:

You can use the following markup:

Block:

[pre]Displayed verbatim[/pre]
[quote]block quote[/quote]

In line:

[tt]code[/tt]
[file]file/package/class name[/file]
[em]emphasized text[/em]
[b]bold text[/b]
[url]web address[/url] [sup]superscript[/sup]
[sub]subscript[/sub]

Ordered list:
[ol]
[li]first item[/li]
[li]second item[/li]
[/ol]

Unordered list:
[ul]
[li]first item[/li]
[li]second item[/li]
[/ul]

You can use the Preview button to review your message formatting before submitting.


Add Comment

Name (optional):

Are you human? Please confirm the bug report ID (which can be found at the top of this page) or login if you have an account.

Comment:

You can use the following markup:

Block:

[pre]Displayed verbatim[/pre]
[quote]block quote[/quote]

In line:

[tt]code[/tt]
[file]file/package/class name[/file]
[em]emphasized text[/em]
[b]bold text[/b]
[url]web address[/url] [sup]superscript[/sup]
[sub]subscript[/sub]

Ordered list:
[ol]
[li]first item[/li]
[li]second item[/li]
[/ol]

Unordered list:
[ul]
[li]first item[/li]
[li]second item[/li]
[/ul]

You can use the Preview button to review your message formatting before submitting.

Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=15