User Manual table of contents
 INDEX | GETTING STARTED | TASKS | LANGUAGE | LIBRARY | SYSTEM | SAMPLES

Release Notes for Version 1.0d69


Home
Products
*Tour
*Manual
Corporate
Support
Search



!
Quick Reference
Object Types
System Properties
System Methods
Command-Line
Binary Operators





Added Access to Properties By Name
We've added the ability to access the properties of an object by name. There are two new methods (GetProperty and SetProperty) and one new property (PropertyNames) for Thing (which means all objects have these methods and properties). The GetProperty method is used to get and set the value of a property on an object by name. For example:

&(name = "Clinton");
Bill's last name is &(name.length); letters long.
What I really mean to say is that Bill's last name is &(name.getproperty(name="length")); letters long.

This produces:

Bill's last name is 7 letters long.
What I really mean to say is that Bill's last name is 7 letters long.

At first it might be hard to see the advantage of the second method, but the nifty thing about it is that you can refer to object's properties using names that aren't known in advance.

This combines nicely with the new PropertyNames property which gives back an OrderedCollection of the names of all of an object's properties. The following macro will display a list of all of the properties for an object along with the values of the properties. Here's the macro:

<define name=objectinfo attributes="TheObjectInQuestion" empty>
&(PropertyNamesOfTheObjectInQuestion = TheObjectInQuestion.PropertyNames);
<PropertyNamesOfTheObjectInQuestion.collect each=EachPropertyName>
&(TheValueOfTheProperty = TheObjectInQuestion.GetProperty(name=&EachPropertyName;));
<p>Property: <strong>&EachPropertyName;</strong>
<ul>
<li>Value: <strong>&(TheValueOfTheProperty.PrintString.Escape);</strong>
<li>Object Type: <strong>&(TheValueOfTheProperty.Type);</strong>
</ul>
</collect>
</define>

If you use that macro like this:

&(aString = "c:\windows\desktop\index.pt");
&(aFileName = aString.AsFileName);
<objectinfo TheObjectInQuestion=&aFileName;>

you'll get something like this:

Property: New

  • Value: c:\windows\desktop\index.pt
  • Object Type: FileName

Property: PrintString

  • Value: c:\windows\desktop\index.pt
  • Object Type: String

Property: type

  • Value: FileName
  • Object Type: String

Property: isnull

  • Value: <false>
  • Object Type: False

Property: isnotnull

  • Value: <true>
  • Object Type: True

Property: PropertyNames

  • Value: NewPrintStringtypeisnullisnotnullPropertyNamesfullpathvolumedirectorynameextensionfullnamefileinfo
  • Object Type: OrderedCollection

Property: fullpath

  • Value: c:\windows\desktop\index.pt
  • Object Type: String

Property: volume

  • Value: c:
  • Object Type: String

Property: directory

  • Value: \windows\desktop\
  • Object Type: String

Property: name

  • Value: index
  • Object Type: String

Property: extension

  • Value: .pt
  • Object Type: String

Property: fullname

  • Value: index.pt
  • Object Type: String

Property: fileinfo

  • Value: <null>
  • Object Type: Null

As you can see, all the properties of a TimeStamp object are shown along with the values of each property.

The other new method is SetProperty and can be used to set a property on an object using the same technique as described above for getting a property's value. The following two lines of pop!talk perform identically:

&(address.zipcode = 94403);
&(address.setProperty(name="zipcode", value=94403));

Timestamp problem
Under certain unlikey circumstances, directly changing the hour or year properties of a timestamp object (when in certain timezones) caused the hour to be set incorrectly. This has been fixed.

 


powered by pop!site Copyright 1995-1997. Pragmatica, Inc. All Rights reserved.
Pragmatica, pop!site and pop!talk are trademarks of Pragmatica, Inc.
Modified: 05/14/97 08:48:18

Page Feedback
Webmaster Contact