SHUO ZHANG
  • Homepage
  • Publications
  • Talks/tutorials
  • CV
  • About
  • 繁
  • NewsLog
  • Misc.
  • Homepage
  • Publications
  • Talks/tutorials
  • CV
  • About
  • 繁
  • NewsLog
  • Misc.

NEWSBLOG

variable substitution

8/6/2013

1 Comment

 
in the new way of PSL:
cla$=do("Get label of interval...", 4,1) 
printline 'cla$' 
this does not work:
Found a numeric expression instead of a string expression. 
Formula not run. 
Script line 1 not performed or completed: 
« cla$=do("Get label of interval...", 4,1) » 
Menu command "Run" not completed.
Which is true because if you switch the variable from cla$ to cla, it works, returns 'undefined'. 

You can do it the old way, which works: 
cla$=Get label of interval... 4 1 
printline 'cla$' 
by the way, this works with arrays too (it seems numeric array behaves rather normally in the old way of scripting): 
Therefore, basically there is an asymmetry between functions that return a number vs. a string, because both return numeric values in the do("Get...",x,y)mode. This will work with variable assignment if it is meant to return a number, naturally: 
numOfIntWordTier=do("Get number of intervals...", tierLyrics+1)
1 Comment
ocean
8/6/2013 08:53:46 am

actually this might work,according to the scripting manual:

« cla$=do$("Get label of interval...", 4,1) »

this is the difference between do() and do$().

Reply



Leave a Reply.

    computing-log

    A log of developer's updates,problems, tricks, documentations,etc. Use Categories to find your topic of interest.

    Categories

    All
    Audio Signal Processing
    Character Encoding
    Links
    Pitch Synth
    Pitch-synth
    Praat Scripting
    Python
    R Stats
    R-stats
    Yaml

    Regular blog"
    file cabin
    MTG_Collection
    R log@MIW

    Picture

    Archives

    November 2013
    October 2013
    September 2013
    August 2013

    RSS Feed

Powered by Create your own unique website with customizable templates.