🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #857

Problem with iv3.1-beta3 string class (lacks documentation!)

#857
From: Heribert Dahms
Date: Fri, 13 Nov 1992 16:05
64 lines
2242 bytes
I'm just porting iv3.1-beta3 to VAX/VMS and got a little problem with the
string class of InterViews in session.c .

I miss a complete description of the string class in A.6 of the iv-Manual
and also in the man pages (which i converted to a VMS help library).

I try cutting the argv[0] string (program name) from e.g.
	ifkvs2$dkb0:[interviews31]idemo.exe;7
first to
	idemo.exe;7
which works, but then i want to get
	idemo
i.e. the part of the string to the left of the dot (if any), but several
attempts resulted in keeping
	idemo.exe;7

That's obviously no problem with VMS itself, only with the string handling!
What's wrong?


Thanks,
Heribert Dahms	(dahms@ifk20.mach.uni-karlsruhe.de)

=============================================================================
Extract of src/lib/interviews/session.c :
=============================================================================

/*
 * Use ICCCM rules to find an application's instance name
 * from the command line or an environment variable.
 */

String* SessionRep::find_name() {
    String name;
    if (find_arg(String("-name"), name)) {
	return new String(name);
    }

    const char* res_name = getenv("RESOURCE_NAME");
    if (res_name != nil) {
	return new String(res_name);
    }

    if (argc_ > 0) {
	String s(argv_[0]);
#ifdef VMS		// H. Dahms  12.11.92
	int slash = s.rindex(']');
#else
	int slash = s.rindex('/');
#endif
	if (slash >= 0) {
	    s = s.right(slash + 1);
	}
#ifdef VMS		// H. Dahms  13.11.92
	int dot = s.index('.');
	if (dot >= 0) {
	    s = s.substr(0, dot);
	}
#endif
	return new String(s);
    }

    return new String("noname");
}
Technical Details
Message-ID: <1992Nov13.160516.19376@rz.uni-karlsruhe.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!snorkelwacker.mit.edu!ira.uka.de!ira.uka.de!rz.uni-karlsruhe.de!usenet

Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews
Path: arc1-ca.pugleaf.net!sparky!uunet!snorkelwacker.mit.edu!ira.uka.de!ira.uka.de!rz.uni-karlsruhe.de!usenet
From: DAHMS@ifk20.mach.uni-karlsruhe.de (Heribert Dahms)
Subject: Problem with iv3.1-beta3 string class (lacks documentation!)
Message-ID: <1992Nov13.160516.19376@rz.uni-karlsruhe.de>
Sender: usenet@rz.uni-karlsruhe.de (USENET 'No news is bad news' News System)
Organization: University of Karlsruhe, FRG (Dept. of Mechanical Engineering)
Date: Fri, 13 Nov 1992 16:05:16 GMT
X-News-Reader: VMS NEWS 1.20
Lines: 64