Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ctrl+C - GetFldState "thinks" changes were made
Message
From
15/08/2005 09:13:04
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01040860
Message ID:
01040947
Views:
14
It may be specific to MM. I'm not seeing it in vanilla VFP. When I test the code below by selecting the entire field data of the cust_id field, pressing CTRL+C, and then clicking on the command button that checks the field state, it is still 1:
CLOSE DATABASES
CLEAR

SET MULTILOCKS ON         && Allow table buffering
OPEN DATABASE (HOME(2) + 'data\testdata')
USE Customer             && Open customer table
=CURSORSETPROP("Buffering",5,"customer")  && Enable table buffering

oform = CREATEOBJECT('testform')
oform.show()
READ EVENTS

CLOSE ALL
RETURN

DEFINE CLASS testform AS form


   Top = 0
   Left = 0
   Height = 350
   Width = 556
   DoCreate = .T.
   Caption = "Form1"
   Name = "Form1"


   ADD OBJECT txtcust_id AS textbox WITH ;
      Comment = "Unique Customer ID code made up of the first five character of the Customer's Company name.", ;
      ControlSource = "customer.cust_id", ;
      Height = 23, ;
      Left = 99, ;
      MaxLength = 6, ;
      TabIndex = 2, ;
      Top = 19, ;
      Width = 55, ;
      Name = "txtCust_id"


   ADD OBJECT lblcust_id AS label WITH ;
      AutoSize = .T., ;
      WordWrap = .T., ;
      BackStyle = 0, ;
      Caption = "Cust_id", ;
      Left = 48, ;
      Top = 19, ;
      Width = 43, ;
      TabIndex = 1, ;
      Name = "lblCust_id"


   ADD OBJECT txtcompany AS textbox WITH ;
      Comment = "", ;
      ControlSource = "customer.company", ;
      Height = 23, ;
      Left = 138, ;
      MaxLength = 40, ;
      TabIndex = 4, ;
      Top = 60, ;
      Width = 288, ;
      Name = "txtCompany"


   ADD OBJECT lblcompany AS label WITH ;
      AutoSize = .T., ;
      WordWrap = .T., ;
      BackStyle = 0, ;
      Caption = "Company", ;
      Left = 77, ;
      Top = 60, ;
      Width = 53, ;
      TabIndex = 3, ;
      Name = "lblCompany"


   ADD OBJECT txtcontact AS textbox WITH ;
      Comment = "Primary contact for this Customer.", ;
      ControlSource = "customer.contact", ;
      Height = 23, ;
      Left = 128, ;
      MaxLength = 30, ;
      TabIndex = 6, ;
      Top = 103, ;
      Width = 219, ;
      Name = "txtContact"


   ADD OBJECT lblcontact AS label WITH ;
      AutoSize = .T., ;
      WordWrap = .T., ;
      BackStyle = 0, ;
      Caption = "Contact", ;
      Left = 78, ;
      Top = 103, ;
      Width = 42, ;
      TabIndex = 5, ;
      Name = "lblContact"


   ADD OBJECT command1 AS commandbutton WITH ;
      Top = 168, ;
      Left = 140, ;
      Height = 27, ;
      Width = 210, ;
      Caption = "Get Field State of Customer ID Field", ;
      Name = "Command1"

   ADD OBJECT command2 AS commandbutton WITH ;
      Top = 200, ;
      Left = 140, ;
      Height = 27, ;
      Width = 210, ;
      Caption = "NEXT", ;
      Name = "Command2"

   ADD OBJECT command3 AS commandbutton WITH ;
      Top = 240, ;
      Left = 140, ;
      Height = 27, ;
      Width = 210, ;
      Caption = "PREV", ;
      Name = "Command3"

   PROCEDURE destroy
      CLEAR EVENTS
   ENDPROC

   PROCEDURE load
      =CURSORSETPROP("Buffering",3,"customer")  && Test Row buffering
   ENDPROC
   
   PROCEDURE command1.Click
      nState=GETFLDSTATE("cust_id")
      wait WINDOW "Cust_id Field State is: "+ALLTRIM(STR(nState)) NoWAIT
   ENDPROC

   PROCEDURE command2.Click
      skip
      thisform.refresh()
   ENDPROC

   PROCEDURE command3.Click
      skip - 1
      thisform.refresh()
   ENDPROC

ENDDEFINE
>>How can you save something with paste (Ctrl+V)? Or you meant CTR+C?
>>
>
>Sorry, I meant Ctrl + C.
>
>>>I noticed, that then I do Ctrl+V to save some information on the form and then try to close that form, I'm asked a question "Do you want to save your changes?". In other words, using Ctrl+V is considered a change by GetFldState function, even if nothing was changed. Why is that?
>>>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform