Jump to content
Developer Wiki and Function Reference Links ×

Does class exist

Recommended Posts

Is there a way to find out if a class exists?  If a class of a certain name does not exist, I want to create it and set its attributes.  If it already exists, I don't want to change any attributes.  I can't find a way to check if a class exists.

Lost in the Funciton Reference woods.




Link to comment

I think you'll need something like this (untested):


Function DoesClassExist(sMyClassName : STRING) : BOOLEAN;
    i1 : INTEGER;
    DoesClassExist := False;
    FOR i1 := 1 TO ClassNum DO BEGIN
        IF ClassList(i1) = sMyClassName THEN BEGIN
            DoesClassExist := True;
            i1 := ClassNum;

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...