Brian,

Here is a helpful hint, make the first value of your subroutine the Return
Value.  This way it can also be used from an I-Desc.

Thanks,
David A. Green
DAG Consulting


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brian Leach
Sent: Thursday, August 31, 2006 2:43 AM
To: [email protected]
Subject: RE: [U2] Using DICT items in basic program

Bob

Here's one I had lying around. Hack it as you will :)

Regards,

Brian

--------> CUT HERE <-------

      SUBROUTINE stdValue( FileName, FieldName, Id, Record, Value )
*--------------------------------------------------------------------------
*  Name        : stdValue
*  Description : Get a field value from the dictionary
*  Author      : Brian Leach
*  Project     : STD
*  Module      : GENERAL
*--------------------------------------------------------------------------
      Value = ""
      Open "DICT", FileName To DFL Else
         RETURN
      End
      Read DictRec From DFL, FieldName Else
         RETURN
      End

      @Id = Id
      @Record = Record
      @Dict = FileName

      First = UpCase(TrimF(DictRec))[1,1]
      Begin Case
         Case First = "D"
            Value = (Id:@fm:Record)<DictRec<2>+1>
            Conv = DictRec<3>
         Case First = "I"
            Value = IType(DictRec)
            Conv = DictRec<3>
         Case First = "A" Or First = "S"
            Value = (Id:@fm:Record)<DictRec<2>+1>
            If DictRec<8> <> "" Then
               Value = OConv(Value, DictRec<8>)
            End
            Conv = DictRec<7>
         Case 1
            Return
      End Case

      If Conv <> "" Then
         Value = OConvS(Value,Conv)
      End

      RETURN 
<---- End cut  ---->
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to