DocumentDirectory() fails to work in function

DocumentDirectory() fails to work in function - Messages

#1 Posted: 7/22/2023 11:44:10 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: 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 KiB) downloaded 28 time(s).
fullname.png

System information:

Show Spoiler

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#2 Posted: 7/22/2023 9:08:08 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: 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 KiB) downloaded 41 time(s).

Clipboard01.png

Best regards.
Alvaro.
  • New Posts New Posts
  • No New Posts No New Posts