Search found 10 matches

Go to advanced search

by Dennis
Wed Dec 15, 2010 2:20 pm
Forum: General Discussion
Topic: Amusing or annoying code
Replies: 25
Views: 22556

Re: Amusing or annoying code

I posted a contact on Parsys where doing a File::peek(len), where len was 0, would cause an unhandled exception. Jade's response was that this was not an issue, in fact I think it hadn't been documented yet. I still cannot understand why the function does not just return zero bytes like most other l...
by Dennis
Thu Oct 07, 2010 12:07 pm
Forum: Tips and Techniques
Topic: Autmatically renaming methods
Replies: 20
Views: 19255

Re: Autmatically renaming methods

You may be interested in having a look at the FeatureUsage class. You can do a [JadeMethod].sendMsgWithParams("_getScriptRefsIncslusive", [FeatureUsageSet io]) and then getting the values for following FeatureUsage properties (schemaScript, textPosition, textLength). It could be interesting doing a ...
by Dennis
Thu Oct 07, 2010 11:19 am
Forum: Tips and Techniques
Topic: Autmatically renaming methods
Replies: 20
Views: 19255

Re: Autmatically renaming methods

Funnily enough I tried doing the same thing with a sendMsgWithParams() but ended up with the same 1236 exception where I was failing to create/update a JadePatchDetails object. It could be that doing a find/replace is the best way to go. May be worthwhile making an NFS contact on PARSYS if you have ...
by Dennis
Thu Oct 07, 2010 10:06 am
Forum: Tips and Techniques
Topic: Autmatically renaming methods
Replies: 20
Views: 19255

Re: Autmatically renaming methods

Sorry I forgot about the method header within the source. Try this second version:

Code: Select all

setMyName(pName: String) updating; vars pos: Integer; src: String; begin pos := 1; src := source; src := pName & src[src.pos("(", pos):end]; name := pName; source := src; end;
by Dennis
Thu Oct 07, 2010 9:21 am
Forum: Tips and Techniques
Topic: Autmatically renaming methods
Replies: 20
Views: 19255

Re: Autmatically renaming methods

All you need to do is create your own method on the Method or JadeMethod class eg. setMyName(pName: String) updating; begin name := pName; end; and have the method call sandwiched between a beginTransaction and commitTransaction. I used the name setMyName as setName is a reserved name used by Jade. ...
by Dennis
Mon Jul 26, 2010 4:05 pm
Forum: Tips and Techniques
Topic: Generically handling MKD with unknown number of keys
Replies: 5
Views: 7995

Re: Generically handling MKD with unknown number of keys

I would try something along the lines below:

Code: Select all

vars k: Key; cls: Class; cc: CollClass; begin cc := MyCollClass; cls := cc.getMemberType().Class; foreach k in cc.getKeys() do write k.keyName() & " " & cls.getProperty(k.keyName()).type.name; endforeach;
Hope this helps.
by Dennis
Thu Jul 08, 2010 11:49 am
Forum: Tips and Techniques
Topic: Identifying Unused Classes
Replies: 9
Views: 12373

Re: Identifying Unused Classes

Probably the best thing to do is add a Boolean-returning method onto the Class class so you can use some of the unpublished properties - perhaps something like this; return numScriptRefs() > 0 or numCollClassRefs() > 0 or numPropertyRefs() > 0 or usedInWebService or not exposedClassRefs.isEmpty() or...
by Dennis
Wed Jul 07, 2010 11:57 am
Forum: Tips and Techniques
Topic: Identifying Unused Classes
Replies: 9
Views: 12373

Re: Identifying Unused Classes

No problem. I forgot to add you will need to check subclasses as well before you delete anything.
by Dennis
Wed Jul 07, 2010 10:14 am
Forum: Tips and Techniques
Topic: Identifying Unused Classes
Replies: 9
Views: 12373

Re: Identifying Unused Classes

There are some unpublished methods on the Type class that might be of use. I found them by executing Type.inspectModal in a workspace and clicking the methods entry. Assuming you have a new class called TestClass, try the following code before and after you have used it in a method or class referenc...
by Dennis
Mon Aug 31, 2009 10:22 am
Forum: General Discussion
Topic: Regular Expression
Replies: 7
Views: 10440

Re: Regular Expression

I found the Microsoft VBScript Regular Expressions ActiveX quite useful.
If you are using Linux or want to use a DLL then there are quite a few alternatives such as PCRE (Perl compatible Regular Expressions) but then you will have to write your own class wrapper.

Go to advanced search

cron