Coder Social home page Coder Social logo

TF_GetData() bug about tf HOT 3 CLOSED

hi5 avatar hi5 commented on July 22, 2024
TF_GetData() bug

from tf.

Comments (3)

hi5 avatar hi5 commented on July 22, 2024

You don't use TF_GetData() in a script on its own. TF_GetData is called by all other TF functions to test if a variable or a file has been passed on to a TF_... function.

That particular line/error message is shown if a user makes a syntax error:

TF_...(! "file.txt",...) vs TF_...("!file.txt",...). The ! before a filename is used to write back the result of the TF function to the source file instead of a copy (file_copy.txt). I noticed that some users tried to use it like ! "file.txt" instead of "!file.txt" and I show the MsgBox as a reminder.

I can read/work with a file with one line containing "000000" without any problems.

What function are you using and how are you calling it, if you post it I might spot a syntax error (below each TF command there is a short example in the readme.md

from tf.

stealzy avatar stealzy commented on July 22, 2024

TF_GetData() is called first in many user function.

msg =
(
000000
)
MsgBox % TF_TrimLeft(msg, 1, 1, 3)
— Error msgbox.

msg =
(
C:\users\desktop.ini
)
MsgBox % TF_TrimLeft(msg, 1, 1, 3)
— I get 1 here, because I have this file on disk.

msg =
(
!C:\
)
MsgBox % TF_TrimLeft(msg, 1, 1, 3)
— Error msgbox.

IMHO, from such type of function I expected behavior like SubStr().
No hidden parameters, no undefinied try read file, no error msgbox.
A good tool should be simple.
Of course, I understand that it's too late change it here.

from tf.

hi5 avatar hi5 commented on July 22, 2024

Sorry but only the last one gives an error message, the first two work fine here.

Your second example should have created a file C:\users\desktop_copy.ini, it should be there.
The 1 indicates it hasn't been able to make a backup - There is little point in using MsgBox with files as, well it writes back the result to a file and does NOT return the changed content to a variable which you can display in a MsgBox.

The last one tries to read a file "C:" which of course doesn't exist (there is no such file) so it gives an error message saying it can't read it. You can pass on a variable as a filename which is what you are doing here in the second and third example.

So as far as I can see: no bugs and it works as intended.

Edit: v3.7 (April 16, 2017)

from tf.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.