[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

381.0. "FN$STRING lexical function" by SHALOT::LAMPSON (Whatever ya do, ya gotta have FUN!) Tue Mar 31 1992 22:55

        Hi,
        
        	I am placing around with the new lexical functions in
        ALL-IN-1 V3.0 and there is one I cannot figure out.
        
        	What is FN$STRING do?  The documentation states the
        parameter is an 'expression' of text format.  Therefore, all
        my tests simply echo the input to the output.  What am I missing?
        
        	I tried using the index, but apparently none of the
        functions are individually listed in the index.  Lexical just
        points me to Chapter 6 of Ref. 1.  String doesn't list FN$STRING
        as a subheading.
        
        Thanks,
        
        _Mike
T.RTitleUserPersonal
Name
DateLines
381.1FN$STRING is virtually OA$NULL? ;')57826::VICKERSIf it helps a customer, DO ITTue Mar 31 1992 23:4822
    Mike,

    It appears to my under educated mind that FN$STRING does nothing but
    take some more CPU cycles.  This reminds me of when I wrote the
    OA$STRING DSAB many years ago and wanted to have an UPCASE option and
    discovered that no code was required.  All I had to do was to return
    the string.

    <GET FN$STRING(PI)

    is the same as

    <GET PI

    They both give you the same piece of PI.

    I suspect that there may be some obscure use of the lexical but I
    cannot think of one.  Of course, it's far better to have too many
    lexical functions than not enough.

    Keep smiling,
    don
381.2SIOG::T_REDMONDThoughts of an Idle MindTue Mar 31 1992 23:513
    Gee Don... where did you pick up that silly example ;)
    
    Tony
381.3From a book right above (over?) my head57826::VICKERSIf it helps a customer, DO ITWed Apr 01 1992 00:427
    At least the really poor pun was mine.
    
    I guess that I should have given credit to the author but I knew him to
    a kind soul.
    
    Stay happy,
    don
381.4Maybe not what it was intended to doSHALOT::NICODEMWho told you I&#039;m paranoid???Wed Apr 01 1992 15:3711
	Not that this exonerates FN$STRING, but it also seems to concatenate
whatever arguments are passed to it.  For instance, if #A = 1, #B = "asdf", and
#C = 3535, then FN$STRING(#A + #B + #C) returns "1asdf3535" -- something that
normal string concatenation could have done anyway, or course.

	I think perhaps that the intention of FN$STRING was to duplicate the
F$STRING lexical function...  only it failed.  Because in the case of the
F$STRING lexical, F$STRING(#A + #C) with the above values would have returned
3536 (i.e., the sum), not 13535 (i.e., the concatenation).

	F
381.5Wish: FN$LOWERSHALOT::LAMPSONWhatever ya do, ya gotta have FUN!Wed Apr 01 1992 17:499
        While we are discussing lexicals, why is there a FN$UPPER (something
        that is easy to do in ALL-IN-1 without the lexical) and no FN$LOWER
        which is much harder?
        
        Thanks Frank for the hint of another usage for FN$STRING.  It would
        help if the documentation explained what "expression" was since no
        other lexical uses a parameter of this type.
        
        _Mike
381.6I've asked the code author to join this discussion!IOSG::PYEGraham - ALL-IN-1 Sorcerer&#039;s ApprenticeWed Apr 01 1992 18:090
381.7Not sure of the usefulness...SHALOT::NICODEMWho told you I&#039;m paranoid???Tue Apr 07 1992 18:2213
	Since there's been no reply from the "code author" (see .6), I just
thought I'd confirm what we've been saying all along -- namely, that FN$STRING
really does nothing more than evaluate the parameter.  As a matter of fact,
the entire code for FN$STRING (after, of course, parsing out parameters, etc.)
consists of:

�    Status = Str$Copy_DX(.Output_String,.Input_String);

which, for the uninitiated, basically says that the result you're going to get
back (i.e., Output_String) will be a copy of whatever you passed it (i.e.,
Input_String).

	F
381.8Talking to him that knowsIOSG::TALLETTJust one more fix, then we can ship...Wed Apr 08 1992 08:4315
    
    	I spoke to "the code author" and asked him what FN$STRING was
    	for, (I am preparing a talk on this stuff and thought I might
    	get asked! :-) and it was apparently originally supposed to be similar
    	to DCL F$EDIT but it only half made it. It does convert its
    	argument to a string, but we couldn't think of a place where
    	ALL-IN-1 wouldn't do this anyhow.
    
    	By the way, I also came across FAO(..., OUTPUT=#x) which is in V3.0
    	but not the documentation because it found its way into the product
    	by devious means. I love it as I never did like OA$FAO (which also
    	found its way in by devious means! Sorry Jim).
    
    Regards,
    Paul