起步软件技术论坛-X3

 找回密码
 立即注册
搜索
12
返回列表 发新帖
楼主: cdz0451

【结帖】[重要]不知如何是好

[复制链接]
 楼主| 发表于 2007-9-20 11:15:14 | 显示全部楼层
datasetbroker.data.FieldByName('字段').AsInteger
能否得到 货币数值 例如: 0.25 元

TDataField.Asinteger 等到的 好像没有小数部分?
回复 支持 反对

使用道具 举报

发表于 2007-9-20 11:22:36 | 显示全部楼层
那有小数就不能用asInteger了,你用asFloat就可以了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-9-20 11:28:03 | 显示全部楼层
好久没有用
DELPHI 了!
现在用起来,感觉很吃力呀
问题 自我解决

结贴了
回复 支持 反对

使用道具 举报

发表于 2007-9-20 11:37:57 | 显示全部楼层
NameSpace: Business.Data
--------------------------------------------------------------------------------
[B]TDataField [/B]  = class(Business.System.TComponent)
protected
  function AccessError(TypeName: string): EDatabaseError; virtual;
  procedure Bind(Binding: Boolean); virtual;
  procedure Change; virtual;
  procedure CheckInactive;
  procedure CopyData(Source: Business.System.TObject; Dest: Business.System.TObject); virtual;
  procedure DataChanged;
  procedure DefineProperties(Filer: Business.System.TFiler); override;
  procedure FreeBuffers; virtual;
  function GetAsBCD: TBcd; virtual;
  function GetAsBoolean: Boolean; virtual;
  function GetAsByteArray: TObject; virtual;
  function GetAsCurrency: Int64; virtual;
  function GetAsDateTime: Double; virtual;
  function GetAsFloat: Double; virtual;
  function GetAsInteger: Longint; virtual;
  function GetAsSqlTimeStamp: TSQLTimeStamp; virtual;
  function GetAsString: string; virtual;
  function GetAsVariant: TObject; virtual;
  function GetCanModify: Boolean; virtual;
  function GetClassDesc: string; virtual;
  function GetDataSize: Longint; virtual;
  function GetDefaultWidth: Longint; virtual;
  function GetFieldNo: Longint; virtual;
  function GetHasConstraints: Boolean; virtual;
  function GetIsNull: Boolean; virtual;
  function GetSize: Longint; virtual;
  procedure GetText(Text: string; DisplayText: Boolean); virtual;
  procedure Notification(AComponent: Business.System.TComponent; Operation: Business.System.TOperation); override;
  procedure PropertyChanged(LayoutAffected: Boolean);
  procedure ReadState(Reader: Business.System.TReader); override;
  procedure SetAsBCD(Value: TBcd); virtual;
  procedure SetAsBoolean(Value: Boolean); virtual;
  procedure SetAsByteArray(Value: TObject); virtual;
  procedure SetAsCurrency(Value: Int64); virtual;
  procedure SetAsDateTime(Value: Double); virtual;
  procedure SetAsFloat(Value: Double); virtual;
  procedure SetAsInteger(Value: Longint); virtual;
  procedure SetAsSQLTimeStamp(Value: TSQLTimeStamp); virtual;
  procedure SetAsString(Value: string); virtual;
  procedure SetAsVariant(Value: TObject); virtual;
  procedure SetAutoGenerateValue(Value: TAutoRefreshFlag);
  procedure SetDataSet(ADataSet: TAbstractDataSet); virtual;
  procedure SetDataType(Value: TFieldType);
  procedure SetFieldKind(Value: TFieldKind); virtual;
  procedure SetParentComponent(AParent: Business.System.TComponent); override;
  procedure SetParentField(AField: TObjectField); virtual;
  procedure SetSize(Value: Longint); virtual;
  procedure SetText(Value: string); virtual;
  procedure SetVarValue(Value: TObject); virtual;
public
  constructor create(AOwner: Business.System.TComponent);
  procedure Assign(Source: Business.System.TPersistent); override;
  procedure AssignValue(Value: Business.System.TVarRec);
  procedure Clear; virtual;
  procedure Destroy; override;
  procedure FocusControl;
  function GetData(Buffer: Business.System.TObject; NativeFormat: Boolean): Boolean;
  function GetParentComponent: Business.System.TComponent; override;
  function HasParent: Boolean; override;
  function IsValidChar(InputChar: Char): Boolean; virtual;
  procedure RefreshLookupList;
  procedure SetData(Buffer: Business.System.TObject; NativeFormat: Boolean);
  procedure SetFieldType(Value: TFieldType); virtual;
  procedure Validate(Buffer: Business.System.TObject);
  property Alignment: Business.System.TAlignment;
  property AsBCD: TBcd;
  property AsBoolean: Boolean;
  property AsCurrency: Int64;
  property AsDateTime: Double;
  [B]property AsFloat: Double;[/B]
  property AsInteger: Longint;
  property AsSQLTimeStamp: TSQLTimeStamp;
  property AsString: string;
  property AsVariant: TObject;
  property AttributeSet: string;
  property AutoGenerateValue: TAutoRefreshFlag;
  property Calculated: Boolean;
  property CanModify: Boolean;
  property ConstraintErrorMessage: string;
  property CurValue: TObject;
  property CustomConstraint: string;
  property DataSet: TAbstractDataSet;
  property DataSize: Longint;
  property DataType: TFieldType;
  property DefaultExpression: string;
  property DisplayLabel: string;
  property DisplayName: string;
  property DisplayText: string;
  property DisplayWidth: Longint;
  property EditMask: string;
  property EditMaskPtr: string;
  property FieldKind: TFieldKind;
  property FieldName: string;
  property FieldNo: Longint;
  property FullName: string;
  property HasConstraints: Boolean;
  property ImportedConstraint: string;
  property Index: Longint;
  property IsIndexField: Boolean;
  property IsNull: Boolean;
  property KeyFields: string;
  property Lookup: Boolean;
  property LookupCache: Boolean;
  property LookupDataSet: TAbstractDataSet;
  property LookupKeyFields: string;
  property LookupList: TLookupList;
  property LookupResultField: string;
  property NewValue: TObject;
  property Offset: Longint;
  property OldValue: TObject;
  property OnChange: TFieldNotifyEvent;
  property OnGetText: TFieldGetTextEvent;
  property OnSetText: TFieldSetTextEvent;
  property OnValidate: TFieldNotifyEvent;
  property Origin: string;
  property ParentField: TObjectField;
  property ProviderFlags: TProviderFlags;
  property ReadOnly: Boolean;
  property Required: Boolean;
  property Size: Longint;
  property Text: string;
  property ValidChars: TFieldChars;
  property Value: TObject;
  property Visible: Boolean;
end;
回复 支持 反对

使用道具 举报

发表于 2007-9-20 11:40:21 | 显示全部楼层
晕,13楼编辑了多少次了!汗...
楼主,那你好好看看delphi相关的资料吧,否则用起来肯定不顺手的!
另外要看看平台相关的使用手册,有很多问题都会迎刃而解的!
回复 支持 反对

使用道具 举报

发表于 2007-9-20 11:41:40 | 显示全部楼层
谢谢楼主反馈,结帖!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-6-28 02:47 , Processed in 0.036834 second(s), 12 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表