indexedVariables.praat 641 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. writeInfoLine: "arrays..."
  2. # should give a different error:
  3. ;a
  4. a=5
  5. # should give an error:
  6. a+5
  7. a [1] = 3
  8. assert a [1] = 3
  9. appendInfoLine: a [1]
  10. ; abcdefghijklmnopqrstuvwxyz
  11. ;a [12345678]
  12. a = 7
  13. asserterror Missing expression after variable a[9].
  14. a [a+2] =
  15. ;a [2]
  16. a [3], 5 = 7
  17. printline 'a[3,5]', 'a[3]'
  18. a [1] = 2
  19. b [a [1]] = 3
  20. assert b [a [1]] = 3
  21. printline 'b[2]'
  22. speaker$[1]="paul"
  23. printline <'speaker$[1]'>
  24. speaker$ [2] = "silke"
  25. printline <'speaker$[2]'>
  26. a$ = speaker$ [1] + " " + speaker$ [2]
  27. printline <'a$'>
  28. a[2+length("h]""k")]=6
  29. assert a[6] = 6
  30. a[6]+=3
  31. assert a[6]=9
  32. speaker$ [1] = "JM"
  33. speaker$ [2] = "PB"
  34. printline OK