Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Procedure GetPIORecordFields;
- {Creates a worksheet showing the display and field names}
- {for the first selected object on the active layer}
- {Useful for determining the record.field names required}
- {for use in a worksheet.}
- {Updated May 2017}
- {Fixed bug with table not having enought cells in VW2017}
- {Corrected December 11, 2008}
- {Now shows correct field types}
- {Updated October 29, 2008}
- {Now includes the field type for each field}
- {January 30, 2008}
- {© 2008, Coviana, Inc - Pat Stanford pat@coviana.com}
- {Licensed under the GNU Lesser General Public License}
- {Modified 8/19/08 Pat Stanford}
- {Now puts quotes around both record and field instead of both combined}
- {Modified 8/19/08 Pat Stanford}
- {Now displays non-localized field names if no localization}
- Var H1 ,H2 :Handle;
- S1,S2,S3,S4,S5,S6, S7 :String;
- N1, N2, N3 :Integer;
- WSH :Handle;
- B1 :Boolean;
- Begin
- H1:=FSActLayer; {The active object}
- H2:=GetRecord(H1,NumRecords(H1)); {Handle to the first record}
- If H2 <> Nil then
- Begin {If a record exists then create worksheet}
- S1:=GetName(H2);
- N1:=NumFields(H2);
- N2:=1;
- S3:='';
- WSH:=CreateWS(Concat(S1,' ',Date(2,1)),N1+3,4);
- SetWSPlacement(WSH,200,200,800,850);
- SetWSColumnWidth(WSH,1,1,200);
- SetWSColumnWidth(WSH,2,2,200);
- SetWSCOlumnWidth(WSH,3,3,200);
- SetWSCOlumnWidth(WSH,4,4,200);
- SetWSCellFormula(WSH,1,1,1,1,Concat('Parameter Fields for PIO: ',S1));
- SetWSCellFormula(WSH,3,1,3,1,'Display Name');
- SetWSCellFormula(WSH,3,2,3,2,'Cell Formula');
- SetWSCellFormula(WSH,3,3,3,3,'Field Type');
- SetWSCellFormula(WSH,3,4,3,4,'Current value');
- While N2<=N1 Do
- Begin {populate the worksheet with all the fields}
- S2:=GetFldName(H2,N2);
- S3:=Concat(Chr(39),S1,CHR(39),'.',CHR(39),S2,Chr(39));
- SetWSCellFormula(WSH,N2+3,2,N2+3,2,S3);
- B1:=GetLocalizedPluginParameter(S1,S2,S4);
- if S4='' then S5:=S2 else S5:=S4;
- SetWSCellFormula(WSH,N2+3,1,N2+3,1,S5);
- N3:=GetFldType(H2,N2);
- Case N3 of
- 1: S6:='Integer';
- 2: S6:='Boolean';
- 3: S6:='Real';
- 4: S6:='Text';
- 7: S6:='Real - Coordinate Displacement';
- 8: S6:='Text - Popup Menu Item';
- 9: S6:='Text - Radio Button';
- 10: S6:='Real - Coodinate X Location';
- 11: S6:='Real - Coordinate Y Location';
- 14: S6:='Static Text';
- Otherwise S6:='Some Numeric Format';
- End;
- SetWSCellFormula(WSH,N2+3,3,N2+3,3,S6);
- S7:=GetRField(H1,GetName(H2), S2);
- SetWSCellFormula(WSH, N2+3,4,N2+3,4, S7);
- N2:=N2+1;
- end;
- ShowWS(WSH,True);
- SetTopVisibleWS(WSH);
- end;
- End;
- Run(GetPIORecordFields);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement