Page 1 of 1

CSPro user defined packages

Posted: May 1st, 2022, 1:14 pm
by htuser
Dear CSPro Developer Team,
I know i'm the CSProuser who request you more ;) ... But this post doesn't have any new request... :)
As already mentioned in previous posts and mails, one of my ultimate dream for CSPro is to write standard "ready to use" packages and shared some of them on the forum... In a way similar to any packages management system. This would facilitate CSPro users a lot. Right now, it miss three features for a such realization:

1.- User defined CSPro Object;
However, if we can have support of Javascript Libraries as external logic files and call them in logic (as the missing part of the CSPro-JS API: calling any JS function inside CSPro Logic)*, even if we don't have user defined object in CSPro logic, we can bypass this using JS object such as

Code: Select all

CSProAuth = {};
CSProAuth.UserAuth = function userAuthen(user) {
	var UserAccess=CSPro.runLogic(`ListUser(${user});`); 
	return UserAccess;
} 
2.-Using dictionary symbol that are unknown at the compile time or dictionary symbol alias in logic not only for the GLOBAL PROC, but for any CSPro Native functions, Records, Items and User Defined Functions...** ;
The most important and, a years ago request...

3.- Export/Import mechanism for CSPro Logic user defined functions or objects;
Can be bypassed with JS object...

If we have this, we'll have a more open and powerful CSPro and request far less from you.
Thanks in advance,

* Thanks to Alex for the workaround he taught us months ago for this. But, we need a more direct way in the JS-CSPro API.
** Right now, you give a way to define alias in dictionary items, records, but not in logic.

Re: CSPro user defined packages

Posted: January 20th, 2026, 9:44 am
by htuser
Proof of concepts: Implementing User-Defined Objects and
Namespaces in CSPro
User_Defined_Objects_And_Namespaces_Report_2026-01-19.pdf
Priority: Medium

Re: CSPro user defined packages

Posted: January 20th, 2026, 4:03 pm
by Gregory Martin
I looked at the PDF, but I'm not sure that I understand the point. It is true that the Action Invoker namespaces are hardcoded, but they are hardcoded around actual implementations in C++. If the goal is to add new functionality in the C++ layer, then you will have to build the project anyway, so defining these statically doesn't seem like such a burden.

I may not be fully understanding this though. Perhaps you can explain the use case that this would solve.

Re: CSPro user defined packages

Posted: January 20th, 2026, 9:00 pm
by htuser
I may not be fully understanding this though. Perhaps you can explain the use case that this would solve.
I believe the restriction of CSPro logic to a strictly functional programming paradigm—lacking support for user-defined objects or namespaces—is a significant limitation for users attempting to implement robust, modular logic. This constraint also hinders code efficiency. As the industry shift from C to C++ demonstrates, Object-Oriented Programming (OOP) has largely become the dominant paradigm for these very reasons.

A potential workaround would be to extend the CSPro-JS API (the "Action Invoker") to support calls to any native CSPro logic function, not just basic user-defined ones. This would allow modules to be authored in JavaScript. (Note: It remains unclear if the new declare function currently supports calling JavaScript objects using dot notation).

Since the release of the CSPro source code, I have generated several reports to better understand the codebase. This post report was implemented to answer the following technical questions:
  • How can new namespaces be added to the Action Invoker?
    What is the path to implementing user-defined namespaces and dot-notation objects directly in CSPro logic?
While I understand this may not be the immediate focus, I suggest the following priorities for the roadmap:
  • Full Compiler Availability: Support on Android devices.
    Runtime Symbol Resolution: Allow dictionary symbols unknown until runtime to be passed as arguments to any function.
    Dictionary Structure: Implementation of deeper, more than three-level dictionaries.
    Web/Phone Support: Native support for CAWI (Computer-Assisted Web Interviewing) and CATI (Computer-Assisted Telephone Interviewing).
    Community: Launching a modern user forum.
Best,