comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » procedure name quirk
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
procedure name quirk [message #49082] Mon, 12 June 2006 17:17
rother is currently offline  rother
Messages: 9
Registered: April 2000
Junior Member
Dear Gurus,

as I had just failed to keep myself in lurking mode,
I want to come with a funny question (seems to
be difficult to search for by google):

it is possible to write a procedure named '!'.
I'm using one (in *nix) to have 'comment like'
print-statements in toplevel batches and functions
(can be switched of by '!quiet' here...):

PRO !, m

IF !quiet EQ 0 THEN return

help, calls = stack & n = n_elements(stack)

CASE n OF
2: print, '! '+m
ELSE: print, (strtok(stack[1],' ',/ex))[0]+': '+m
ENDCASE

END

looks like

PRO test_bang

!,'very much like a comment'

a = 0

!,'and bye...'

return

END

works as:

(X). .r !.pro
(X). .r test_bang.pro
(X). !,'a toplevel comment'
! a toplevel comment
(X). test_bang
TEST_BANG: like a comment
TEST_BANG: and bye...
(X). !quiet = 0
(X). test_bang
(X).

are there *other* 'special'-characters,
known to allow to be procedure names?

I tried with '+' to get a perlish 'die',
but that didn't work somehow...

best regards,
martin.

--
Martin Rother (rother@gfz-potsdam.de) +331 / 288-1272 Section 2.3
GeoForschungsZentrum Potsdam, Germany
[Message index]
 
Read Message
Previous Topic: itk
Next Topic: structures still confusing

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 04:36:45 PDT 2025

Total time taken to generate the page: 0.72132 seconds