>I am experiencing errors if I use a 'scan for' statement inside a with...endwith.
>
>
>with thisform
> scan for .txtBox.value = 'xyz'
> do something
> endscan
>endwith
>
>
>The error I get is: 'Alias .txtbox.value is not found'. From within the debugger I can hold the cursor over this value and it has the correct value. The way to solve this is to add 'thisform' to '.txtbox.value'. But I was wondering if this is only happening to me or is this just the way it is. Also, is there any other commands I need to be concerned with this issue.
>
Paul, the notation you're using makes no sense - does .txtBox.Value contain the name of a field? if so, try:
LOCAL cFieldName
cFieldName = .txtbox.value
SCAN FOR (cFieldName) = 'xyz'
SCAN spins through a table, and the value in the textbox of a form is not going to change in the context of the scan - you want to check a field for a value presumably. If the value you're checking for is in the .txtbox.value, I'd recommend for simplicity and performance to copy the value to a memvar to eliminate the overhead and potential confusion in resolving the object reference each time the loop iterates, too.