Here's a strange one ...

Posted by jmls on 15-Feb-2011 14:59

The good Doctor is going to love this

create a class foo

CLASS foo:

  DEF PUBLIC PROPERTY bar AS CHAR NO-UNDO INIT "wow" GET . PRIVATE SET .

END CLASS.

now have a look at this code :

DEF VAR a AS CLASS experiment.foo.

a = NEW foo().

MESSAGE a:"bar" VIEW-AS ALERT-BOX.

funky, huh ?

Haven't found a use for that. Yet .

All Replies

Posted by Matt Baker on 15-Feb-2011 16:36

I always liked this one.

procedure " ".

  MESSAGE 'something'

  VIEW-AS ALERT-BOX.

end.

procedure "  ".

  message "something else" view as alert-box.

run "  ".

run ' '.

Note that the quotes are NOT part of the name.  So you can put spaces into variable and run it.

Or this one:

procedure "".

  /* do something */

  MESSAGE 'hell world'

  VIEW-AS ALERT-BOX.

end.

run value('').

No spaces at all.

Posted by jmls on 16-Feb-2011 14:43

yuk ...

Posted by Peter Judge on 16-Feb-2011 15:23

jmls wrote:

yuk ...

Indeed, although this is not allowed in OOABL ...

/* no spaces in name */

METHOD ""():

gives: Identifier was left blank or is more than 32 characters. (1700)

/* has space-as-name */

METHOD " "(): 

gives: ** The first character of   must be alphabetic. (257)

This is true in 10.2Bx at least, although I remember it earlier.
-- peter

This thread is closed