Comments (4)
Further weirdness. It turns out that assigning the ID of a newly created object makes printing come back, but nothing gets printed if the ID is not assigned to anything. The following will work:
clearinfo
file$ = temporaryDirectory$ + "/temp.praat"
writeFileLine: file$,
... "a = Create TextGrid: 0, 1, ""Hello"", """""
appendFileLine: file$,
... "writeInfoLine: ""Hello"""
a = nocheck runScript: file$
But removing the ID assignment:
writeFileLine: file$,
... "Create TextGrid: 0, 1, ""Hello"", """""
makes the problem come back.
What is going on?
from praat.
What about this one:
clearinfo
file$ = temporaryDirectory$ + "/temp.praat"
writeFileLine: file$,
... "a = Create TextGrid: 0, 1, ""Hello"", """""
appendFileLine: file$,
... "writeInfoLine: ""Hello"""
b = nocheck runScript: file$
deleteFile(file$)
appendInfoLine: b
b will contain the unique id of the TextGrid...
from praat.
Or this:
a = nocheck writeInfoLine: 10
appendInfoLine: "<<", a, ">>"
This writes <<10>>, but without the nocheck
it just writes <<1>>, which is the (meaningless) return value of writeInfoLine
. Here you can see that using nocheck
ignores the return value of the function (either runScript
or writeInfoLine
), so that the assignment only finds whatever was in the diverted info return buffer before. The return values of writeInfoLine
and runScript
are meaningless, so normally you would never see this interaction happen.
from praat.
The return value of writeInfoLine
etc. are in general quite meaningless, because they always return 1
. But they do so as far as they succeeded (or am I getting this wrong?). I actually do use the return value of runScript()
in a procedure I wrote to try to implement a try ... catch
style block. The idea being that you could write
include path/to/try.proc
call try
... # Next line has a typo \n
... Crate TextGrid: 0, 1, "Hello", "" \n
if try.catch
writeInfoLine: "There was an error"
endif
and not worry about whether or not your main script would fail (note how in that procedure I have to create an object as a placeholder, precisely to navigate around this problem, which back then was a lot more obscure to me).
I think the behaviour of nocheck
is confusing. We've talked about this with regards to code like nocheck @procedure()
, which did not do what I expected (disregard errors in the execution of that procedure) but instead skipped the procedure altogether.
And with the example you wrote, it seems nocheck
also allows you to catch what is being written to the Info window?
What exactly does nocheck
do? Or better yet: what do you consider to be the purpose of nocheck
?
from praat.
Related Issues (20)
- Unable to find License information in the repository or via github interface
- Failing test on Windows because of mismatched path separator HOT 1
- Wrong output for "Create SpeechSynthesizer" in Praat 6.3.15 HOT 2
- Add license file to the repository HOT 2
- Extraneous files in 6.3.17 tarball HOT 4
- [feature request] please support save sound to disk as mp3 (in Menu: View & Edit>FIle>Save sound to disk) HOT 2
- Version 6.3.18 failing to build from source on i386 architecture HOT 11
- Allow selection of a boundary without clicking on it exactly
- boolean in beginPause bug
- [feature request] please support reading m4a audio format HOT 1
- number# doesn't work
- Chromebook Lenovo C330 Help! HOT 1
- [Bug] The numberOfFourierSamples may be changed after a window function is applied to the sound data in the menu command "View spectral sliceβ
- [Feature request] Allow customized placement of pause window continuation buttons
- Hide/show tiers in TextGrid HOT 5
- [Documentation] Missing setting "Attenuation at ceiling" in documentation HOT 1
- On linux/wayland demoShow doesn't immediatly show window
- The 'select earlier/later' shortcut keys do not work in the Linux system.
- Praat v6.4.06 - form/endform - text type - Praat interprets text: numberOfLines, variable$, initialValue$ as text: variable$, initialValue$ HOT 1
- Praat 6.4.06 - Windows 10 - Table: sort rows - GUI issues
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from praat.