Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array interfering with form
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Array interfering with form
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01226450
Message ID:
01226450
Views:
73
I have an array as shown below, which I initialize in the LOAD event of my main form for our Quality Control dept. The fields which seem to be affected are the "Spec_No" field and also the "BEND" and "WRAP" fields. As you can see below the LOAD event initializes a couple arrays for BEND and WRAP.
WITH ThisForm
   This.DoSets()
   .cTable="certs"
   * Put values into the Form's .aBend[3,2] array.
   .aBend[1,1]="Not Tested"
   .aBend[1,2]=" "
   .aBend[2,1]="Pass      "
   .aBend[2,2]="P"
   .aBend[3,1]="Fail      "
   .aBend[3,2]="F"
   * Put values into the Form's .aWrap[3,2] array.
   .aWrap[1,1]="Not Tested"
   .aWrap[1,2]=" "
   .aWrap[2,1]="Pass      "
   .aWrap[2,2]="P"
   .aWrap[3,1]="Fail      "
   .aWrap[3,2]="F"
I also use some code to check for state of every field to see if anything has changed. It seems that in my LOAD event, I've got changes happening to several fields, but this is not desired.

Here's the code that checks for each field's state (The Table is Buffered with Optimistic Table Buffering.):
LOCAL lcFieldState, llRecordChanged
WITH ThisForm
   lcFieldState = GetFldState(-1, .cTable) && Get the field state of the entire record.
   IF !IsNull(lcFieldState)
      llRecordChanged = '2' $ lcFieldState OR '3' $ lcFieldState OR '4' $ lcFieldState
   ELSE
   * GetFldState may return a null value, so compensate for this. It should return a string, usually.
      llRecordChanged = .F.
   ENDIF
ENDWITH
RETURN llRecordChanged
Next
Reply
Map
View

Click here to load this message in the networking platform