Getting what map file class is in

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Getting what map file class is in

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:45 pm

by Michael Hill >> Wed, 22 Dec 2004 1:57:30 GMT

Afternoon all,

Does anyone know how to programmatically get what map file a class belongs to.

Cheers

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Getting what map file class is in

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:45 pm

by allistar >> Wed, 22 Dec 2004 3:00:13 GMT

There is probably a better way than this (bound to be), but here goes:

getClassMap():String;
vars
s: String;
pos: Integer;begin

s := display();
pos := s.pos("Maps: ", 1);
if ((pos <> 0) and (pos < s.length() - 6)) then
s := s[pos+1:end];
pos := s.pos(Cr, 1);
if (pos <> 0) then
return s[1:pos-1].stripChar(" ");
else
return s.stripChar(" ");
endif;
endif;
return "";
end;

This is a method on the "Class" class.

Regards,
Allistar.
--
------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst allistar@silvermoon.co.nz
Auckland, NEW ZEALAND

Silvermoon Software
Specialising in JADE development and consulting
Visit us at: http://www.silvermoon.co.nz
*NEW* Simple web access to Jade at: www.silvermoon.co.nz/jhp.html ------------------------------------------------------------------

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Getting what map file class is in

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:45 pm

by John Munro >> Wed, 22 Dec 2004 9:28:20 GMT

Create the following method on the Class class.

getMapFileName() : String;

vars
begin

if not classMapRefs.isEmpty then
return classMapRefs.first.diskFile.name;
endif;

end;

You can then call this using MyClass.getMapFileName or myObject.class.getMapFileName etc.

John Munro

FileVision UK Ltd.


Atlantic House
Imperial Way
Reading
RG2 0TD

Telephone: +44 (0) 118 903 6066
Fax: +44 (0) 118 903 6100
Email: john.munro@filevision.com
Web: http://www.filevision.com

The contents of this communication are confidential and are only intended to be read by the addressee. We apologize if you receive this communication in error and ask that you contact FileVision UK Ltd. immediately to arrange for its return. The use of any information contained in this communication by an unauthorized person is strictly prohibited. FileVision UK Ltd. cannot accept responsibility for the accuracy or completeness of this communication as it is being transmitted over a public network. If you suspect this message may have been intercepted or amended, please inform FileVision UK Ltd.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 42 guests