[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

2503.0. "Problems with the OA$FAO function" by BUSHIE::SETHI (Man from Downunder) Wed Mar 31 1993 04:10

    Hi All,
    
    A customer has reported a problem with the OA$FAO function on version
    2.4 and I have managed to reproduce it under 3.0.
    
    The story is :-)
    
    1. OpenVMS $ write sys$output f$fao ( "!8ZL" , 1)
    
    	gives 00000001
    
    2. ALL-IN-1 2.4 and 3.0
    
    	<get #temp=1 or <compute #temp=1
    
    	<oa$fao "!8ZL" , "OA$DISPLAY", #temp 
        <oa$fao "!8ZL" , "OA$DISPLAY", 1
        <oa$fao "!8ZL" , "OA$DISPLAY", "1"
        
    	gives 03481176 (2.4 and 3.0 ) sometimes you get 03765792 (3.0)
    
    Before I bug it can someone confirm my findings or tell me were we are
    going wrong ?
    
    Regards,
    
    Sunil
T.RTitleUserPersonal
Name
DateLines
2503.1Works (NOT!) for meIOSG::PYEGraham - ALL-IN-1 Sorcerer&#039;s ApprenticeWed Mar 31 1993 09:5919
    On a PFR, I consistently get 10069808 for all your examples.
    
    In fact, trying a few others (!SL, !ZL, etc.) none of them seem to
    work. Since all ALL-IN-1 symbols are strings, perhaps it makes sense
    that only !AS should work, although I suppose the others might work if
    you could work out how to pass the address of an integer to them!
    
    What I assume we are seeing is the result of decoding the address of
    the symbol's string descriptor - Perhaps I'll try it in a debug image
    and verify that!
    
    The APR is not very clear, since it says that all the normal FAO
    qualifiers can be used.
    
    Was this reported by a customer? I ask because we take customer
    discovered problems more seriously. If not, I'll submit it internally,
    since that's cheaper, and gets to us much quicker.
    
    Graham
2503.2BUSHIE::SETHIMan from DownunderWed Mar 31 1993 10:2711
    Graham my friend ;-),
    
    This is a customer discovery and he would like this to be solved
    because he is writing an application that requires the numbers to have
    leading zero's.
    
    Let me know if I have to SPR it and I will do so.
    
    Regards,
    
    Sunil
2503.3Explanation and workaroundSCOTTC::MARSHALLSpitfire Drivers Do It ToplessWed Mar 31 1993 11:0324
It is well known, although apparently not documented, that OA$FAO only works
for string data.  Graham's reasoning is correct: all ALL-IN-1 symbols are
stored as strings.  Trying to use an integer conversion (eg !XL) will pick
up the first longword of the string descriptor (that points to a string
containing the ASCII digits of the number) and display that.

As a workaround, the following script fragment will take a number in #num, add
leading zeroes to it to make its length #lz, and put it in #lznum:

get #lznum = ""
get #tnum = #num
get #tlz = #lz
.label loop
    compute #digit = #tnum mod 10
    compute #tnum = #tnum div 10
    get #lznum = #digit #lznum
    decrement #tlz
.if #tlz gt 0 then .goto loop

Or if you have V3.0, you can be even cleverer:

get #lznum = FN$FILL(#num, #lz, "0", 1)

Scott
2503.4And the bug is...SCOTTC::MARSHALLSpitfire Drivers Do It ToplessWed Mar 31 1993 11:256
PS - if I didn't make it clear in .3, this is a documentation bug - the APR
shouldn't say that you can use all the directives.  If you put in a code bug
asking for OA$FAO to support all directives, you'll be waiting a long time for
it to be implemented... :-)

Scott
2503.5How to pass a longword!?IOSG::MAURICEBecause of the architect the building fell downWed Mar 31 1993 12:3711
    Hi,
    
    In the VMS documentation it states that !ZL converts a *longword* to
    decimal. Since the customer was not passing a longword but instead a
    string perhaps we can fault the customer's application! That the
    customer has no way of passing a longword parameter may not go down too
    well ;^)
    
    Cheers
    
    Stuart
2503.6I am but a simple soulIOSG::SHOVEDave Shove -- REO2-G/M6Wed Mar 31 1993 17:3515
    Am I being dense, or what?
    
    Doesn't this do it (to get #num padded with leading zeros to 6
    characters in this case)?
    
    get #a = '000000' #num
    get #lznum = #a::6
    
    (You can also do neat tricks to get stuff on the end, using :H to
    reverse the string).
    
    Of course, as Scott says, if you have v3.0 you can use the lexical
    function FN$FILL
    
    D.
2503.7RE .2, SPR (against APR as Scott suggests) please!IOSG::PYEGraham - ALL-IN-1 Sorcerer&#039;s ApprenticeWed Mar 31 1993 18:350
2503.8Another workaround by yours truely ;*) !!!BUSHIE::SETHIMan from DownunderThu Apr 01 1993 03:0917
    Hi All,
    
    The customer does not want me to submit an SPR because they are
    ditching ALL-IN-1 in favour of MS-mail .... (sorry for the pause just
    washing my mouth out ;-}).
    
    However I gave the customer another workaround and it is:
    
    get oa$dcl="write oamailbox ""OA get #num = ''f$fao("""!8ZL""" , 1)'"""
    get oa$dcl="@DCLMAILBOX"
    
    I would be grateful if someone in IOGland can record this problem in
    the database of known problems and something in Stars.
    
    Regards,
    
    Sunil
2503.9IPR Submitted.IOSG::PYEGraham - ALL-IN-1 Sorcerer&#039;s ApprenticeThu Apr 01 1993 09:558
    OK, I'll submit the bug internally, and I'll note that a customer
    discovered it, to help its classification.
    
    I don't know whether that means it gets to STARs automatically.
    
    Graham
    
    PS I'm jealous of your workround, I only wish I'd thought of using DCL!
2503.10Use the FAO function (undocumented until a PFR)IOSG::HULINIan Hulin, IOSG: REO, DTN 830-6141Thu Apr 01 1993 11:4424
   G'dye Sunil,

   Sorry sport, but yer needed yer crystal ball here.  

   We have an undocumented function in V3.0 (which we plan to document for a
   PFR) which I initially wrote to test the Centalized Parser keyword
   functions, and because I thought it _couldn't_ do a worse job than OA$FAO,
   which effectively only supports formatting input FAO parameters which are
   ASCII only.
   (Also there's the nonsense of having to put the output symbol name as a
   quoted string!).
   Try this in A1 command mode {KEY 7}:

   GET #temp = 0
   INCREMENT(#temp)
   FAO(FORMAT="!8ZL",OUT=OA$DISPLAY,P1=#temp)

   On IOSG (admittedly running a PFR) I get the result:

   00000001

   Cheers,

   Ian
2503.11More workaroundsSCOTTC::MARSHALLSpitfire Drivers Do It ToplessThu Apr 01 1993 13:5716
re .6

>> Doesn't this do it
>>    get #a = '000000' #num
>>    get #lznum = #a::6

Not when I tried it.  It just gives the end of the string, starting at the
seventh character.  But
      get #a = '000000' #num
      get #a = #a:H
      get #a = #a:6
      get #lznum = #a:H

does seem to work.

Scott
2503.12Mea culpaIOSG::SHOVEDave Shove -- REO2-G/M6Thu Apr 01 1993 16:353
    Sorry - I forgot to put the :H's in.
    
    D.