Error while loading Softanza (StzLib)

57 views
Skip to first unread message

Mahmoud Fayed

unread,
Sep 29, 2025, 9:29:38 PM (5 days ago) Sep 29
to The Ring Programming Language
Hello Mansour

While trying to use ring stzlib.ring using latest stzlib version from GitHub and Ring 1.24

I get the next error

error1.png

The error happens in the next line

error2.png

Solved by updating the path 

error3.png

Greetings,
Mahmoud

Mansour Ayouni

unread,
Sep 29, 2025, 10:29:38 PM (5 days ago) Sep 29
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

Thank you very much!

Since the text file (stzUnicodeData.txt) is located in the same folder as the code file (stzUnicodeData.ring) then we can just use the name without any path:

image.png

All the best,
Mansour

--

---
You received this message because you are subscribed to the Google Groups "The Ring Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ring-lang+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ring-lang/506eb380-7a67-4419-a1af-1f04c67af951n%40googlegroups.com.

Mansour Ayouni

unread,
Sep 29, 2025, 11:01:05 PM (5 days ago) Sep 29
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

It should actually remain as read("../data/unicodedata.txt"), because it is being used from the stzUnicodeDataTest file (located under ../base/test).  

image.png

When I change it to just "stzunicodedata.txt", as I mentioned, it works fine when running stzUnicodeData.ring, but it raises an error when running the test samples from the stzUnicodeDataTest.ring file (under ../base/test).  

Also, when I use your suggestion "base/data/unicodedata.txt", I get an error both when running stzUnicodeData.ring and when running the samples inside stzUnicodeData.ring:

image.png

image.png

Did I miss something?

Best,
Mansour  

Mahmoud Fayed

unread,
Sep 29, 2025, 11:20:06 PM (5 days ago) Sep 29
to The Ring Programming Language
Hello Mansour

>> "Did I miss something?"

Yes, read() is executed during runtime

When we use the Load command which is executed at compile-time, Ring move the current directory to the file folder (only during compile-time) so when we load a file, this sub file could load the files in the same folder by typing their names directly

But when the execution starts, i.e. during runtime
The current folder is the original current folder (i.e. Ring doesn't change the current folder)
This is very important so we can create tools that exist in ring/bin folder like Ring2EXE
where we can use these tools with files in other folders

So, to create a library like StzLib, it's expected to have it in specific folder relative to Ring folder
something like ring/libraries/stzlib

Then during Runtime, you can get the path to this folder using
C_STZLIB_PATH = exefolder()+"../libraries/stzlib"

Then use C_STZLIB_PATH as your starting point to access any sub folder/file during runtime

i.e. C_STZLIB_PATH + "base/data/unicodedata.txt

Greetings,
Mahmoud

Mahmoud Fayed

unread,
Sep 29, 2025, 11:21:49 PM (5 days ago) Sep 29
to The Ring Programming Language
Hello Mansour

A missing character

This
C_STZLIB_PATH = exefolder()+"../libraries/stzlib"

Must be
C_STZLIB_PATH = exefolder()+"../libraries/stzlib/"

Greetings,
Mahmoud

Mahmoud Fayed

unread,
Sep 29, 2025, 11:36:20 PM (5 days ago) Sep 29
to The Ring Programming Language
Hello Mansour

More Comments

(1) We can write specific code to be executed if the current source code file is the main file (i.e. execution started from this file)

load "stdlibcore.ring"

if isMainSourcefile()
     # Some code
ok


(2) 

The idea of using C_STZLIB_PATH = exefolder()+"../libraries/stzlib/" comes with a limitation
It assumes that we will run the program from source code while Ring is installed on the machine

If your plan is to write an application that you will distribute without Ring, then follow the approach applied by many ring/applications or some ring/tools 

1- One starting point for your application
2- Run the application from the application folder 
3- Store the currentDir() at startup
4- Use (3) and relative path to find files


i.e. Ring comes with all of the functions/features that you need, but you have to think and decide how you will organize your application, files, current folder & finding files.

Greetings,
Mahmoud
On Tuesday, September 30, 2025 at 6:20:06 AM UTC+3 Mahmoud Fayed wrote:

Mansour Ayouni

unread,
Sep 30, 2025, 6:04:37 AM (5 days ago) Sep 30
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

Thank you very much for these helpful clarifications! I believe your last suggestion is the best way forward.  

All the best,
Mansour

Mahmoud Fayed

unread,
Sep 30, 2025, 9:41:08 AM (5 days ago) Sep 30
to The Ring Programming Language
Hello Mansour

You are welcome :D

Greetings,
Mahmoud

Reply all
Reply to author
Forward
0 new messages