Example about using isMainSourceFile() - Form Designer

25 views
Skip to first unread message

Mahmoud Fayed

unread,
Nov 28, 2025, 1:41:17 PM (10 days ago) Nov 28
to The Ring Programming Language
Hello

Using isMainSourceFile() we can write code that will be executed if our script is executed as the main program (ring myprogram.ring)

Also, we can write code that will be executed if it's a sub program (load "myprogram.ring")

For example, The Ring Form Designer
Could be executed as standalone tool (ringpm run formdesigner)
Or it could be loaded by Ring Notepad as a dock able window

To achieve this, we use isMainSourceFile() in formdesigner.ring


formdesigner.png

If the Form Designer is the main program, it will call the QApp Exec() method
If not, then Ring Notepad will call the QApp Exec() method

Greetings,
Mahmoud

Reply all
Reply to author
Forward
0 new messages