[substitute:] preprocessor: text vs numbers

Discussion related to "Everything" 1.5 Alpha.
Post Reply
NotNull
Posts: 5517
Joined: Wed May 24, 2017 9:22 pm

[substitute:] preprocessor: text vs numbers

Post by NotNull »

addcol:A colA:=[substitute:a.b.c.d,c,_]
=>
a0b0_0d

addcol:A colA:=[substitute:"a.b.c.d","c","_"]
=>
a0b0_0d


The dot is seen as a number (0). Not only in the text field, but also in the replace field.

More curious:
addcol:A colA:=[substitute:0.b.c.d,.,_]
=>
0_b_c_d

(the zero is not replaced)

Didn't test the replace (preprocessor) function and family (substr, ..)


BTW: To make sure the dot was numerical, I checked in 1386a: "." was replaced with "0,0" (comma is decimal separator here)
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: [substitute:] preprocessor: text vs numbers

Post by void »

Thank you for the issue report NotNull,

The preprocessor and formulas are treating a lone . with no surrounding digits as 0
The next update will treat a lone . as literal.

[substitute:a.b.c.d,c,_]
=>
a.b._.d


I recommend using double quotes for text:

[substitute:"a.b.c.d","c","_"]




addcol:A colA:=[substitute:0.b.c.d,.,_] => 0_b_c_d
Everything applys the preprocessor before applying formulas.
colA:=[substitute:"a.b.c.d","c","_"] =>
colA:=a.b._.d
colA uses formulas.
Unfortunately, formulas is also treating the . as 0
This will be fixed in the next update.

For now, please try:
colA:=substitute("a.b.c.d","c","_")

-or-
colA:=[quote:[substitute:"a.b.c.d","c","_"]]
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: [substitute:] preprocessor: text vs numbers

Post by void »

Everything 1.5.0.1388a will now treat . with no surrounding digits as literal.
Post Reply