Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conditional GetFldState Excluding Specific Fields
Message
From
26/07/2001 11:16:38
 
 
To
26/07/2001 10:46:07
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00535632
Message ID:
00535760
Views:
15
This message has been marked as the solution to the initial question of the thread.
Hi!

Ok, I reviewed the code. Following is changed mRefresh method:
local lnResult, lcOldValue, lcAlias<b>, llSimpleRefresh</b>
with This
	lnResult   = 1
	lcOldValue = ""
        <b>llSimpleRefresh = .F.</b>
	lcAlias    = .cSourceAlias
	if !empty(lcAlias) and used(lcAlias)
		if recno(lcAlias) <> .nRecord
                        <b>llSimpleRefresh = .T.</b>
			lcOldValue = eval(.ControlSource)
			.nRecord   = recno(lcAlias)
		else
			lcOldValue = .DisplayValue
		endif
	else
		lcOldValue = .DisplayValue
	endif
	if !empty(lcOldValue)
		lnResult = ascan(.aList, lcOldValue)
	endif
	if lnResult = 0
                <b>if llSimpleRefresh
		  .mAddItem(lcOldValue)
                else
                  .Value = lcOldValue
                  lcOldValue=eval(.ControlSource) && to match its size to the field size
                  .Value = lcOldValue
		  .mAddItem(lcOldValue)
                endif</b>
	endif
	<b>.ControlSource=.ControlSource</b>
endwith
HTH.

>Man! Some days are just meant to stay in bed or golf... :)
>
>>Hi!
>>
>>My Email is in my sign up at the end of each my message ;)
>>vgryn@softservecom.com
>>vgryn@softserve.lviv.ua
>>
>>>Vlad,
>>>
>>>Would you reply with your email address please? I click on the envelope, but the pc here at work doesn't have the client installed correctly and it won't work.
>>>
>>>Thanks, Renoir
>>>
>>>>Been there, done that... Often. The field state changes during code to handle the populating of the list in the combo. It happens whenever DisplayValue or Value is reset, whether it is the same value or not. The class is based on Mark McCasland's Combo, but I had to make changes where things are fired due to my apps nuances in regards to views being available, etc. Whatever I try to do to with regards to ControlSource = ControlSource instead of changing the Value or DisplayValue, then the combo stops functioning correctly. If I fix the combo so it works correctly, I cannot get a true state of the field as it thinks it has changed value. Very frustrating. I will send the zip to you. Do not spend much time on it, just let me know if what I want to do is possible and where to look. Thanks Vlad!
>>>>
>>>>Renoir
>>>>
>>>>
>>>>>Hi!
>>>>>
>>>>>Ok, you can send it to me. However, you can track this by self in quite easy manner:
>>>>>Use SET STEP ON somewhere on your form that you're sure is before data marked as changes, or just after update of data so, again, you're sure getfldstate(-1) return all '1'. Then run program and when it stops at that point open watches window, type getfldstate(-1,'alias') in it and setup the breakpoint on that watch by double clicking on the area just to left from the watch item. Run program again. Program will stop at each statement that cause the change of that value. There could be a lot of them because data session change or alias goes out of scope, but at last you will reach what is needed. Good luck!
>>>>>
>>>>>
>>>>>>>>Since the Comboboxes always return a 2 whether they have changed or not, ...
>>>>>>>
>>>>>>>Thats not correct! Save your time and look to the combobox class. Often combobox.value=combobox.value used to refresh the combobox properly. That causes the bound field marked as changed. The best way to refresh the combobox value is to match the item in List of the combobox with the field value (if such value is not already in list), than use combobox.ControlSource=combobox.CountrolSource. This way field is not marked as changed and you will forget about this problem. Verified in production APP.
>>>>>>
>>>>>>Hey Vlad,
>>>>>>
>>>>>>I have been dealing with these Comboboxes for over two full days now and need to move on. Would you (or anyone) be willing to look at the class and instance combos and let me know what I'm doing wrong? If so, I'll create a quick project, not functional, and zip it up.
>>>>>>
>>>>>>We could still keep communication continuing in this thread.
>>>>>>
>>>>>>Renoir
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform