DocumentDirectory() fails to work in function

DocumentDirectory() fails to work in function - Poruke

#1 Objavljeno: 22. 7. 2023. 11:44:10
Martin Kraska

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: Moderator

The function DocumentDirectory() works fine when called at the canvas.

When called in a function body, then I get an error message, saying that the object pointer was not set to an object instance.

BTW, the GUI is set to english, SMath has been closed and re-opened. Still the error message is in german. Sorry for that.

fullname.sm (4,72 KiB) preuzeto 1650 put(ova).
fullname.png

System information:

Prikaži spoiler

Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#2 Objavljeno: 22. 7. 2023. 21:08:08
Alvaro

Alvaro

1.139 svidjanja u 1.805 postova.

Grupa: User

Wrote

The function DocumentDirectory() works fine when called at the canvas. ...



Hi Martin. The issue is because the line() statement. Without it DocumentDirectory() and other functions works fine.

As a workaround for the case that you need to use it with inside a line statement, and given that DocumentDirectory() just use the same argument "" always, you can save it into a constant, but could have others issues, like using that with include().

fullname.sm (4,38 KiB) preuzeto 1696 put(ova).

Clipboard01.png

Best regards.
Alvaro.
  • Novi postovi
  • Nema novih postova