Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: SET TEXTMERGE and errors
Message
From
19/06/2005 04:32:56
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01024628
Message ID:
01024681
Views:
19
>Fabio,
>
>They couild word it better but the SET TEXTMERGE TO MEMVAR scope continues until SET TEXTMERGE OFF. Any TRY...ENDTRY in that scope will reset memory variable when error occurs. Does it make sense to me? No, but it's the way it works.

Not. OFF don't close TEXTMERGE, it deactive the <<>> evaluation only.
CLEAR
LOCAL a
SET TEXTMERGE TO MEMVAR A
\1
SET TEXTMERGE OFF	&& OFF don't close the TEXTMERGE scope
\\2
A='0'
\\3
? "point 1",A
SET TEXTMERGE TO && MEMVAR A  -- THIS COPY THE TEXTMERGE'S BUFFER INTO THE VARIABLE
? "point 2",A
SET TEXTMERGE TO MEMVAR A ADDITIVE
\\5
SUBSCOPE()
\\6
SET TEXTMERGE TO && MEMVAR A  -- THIS COPY THE TEXTMERGE'S BUFFER INTO THE VARIABLE
? "point 4",A

PROCEDURE SUBSCOPE
	* A is out of scope, but the buffer is
	\\4
* uncomment next two lines
*	SET TEXTMERGE TO && MEMVAR A create a SUBSCOPE's private "a" variable
*	? "point 3",a
With a filename or _TEXT file handle, textmerge put every \|\\ line into the file directly;
with a memvar, TEXTMERGE build a text buffer, and only the
SET TEXTMERGW TO
copy/append the buffer into the variable.
If happen an error ( TRY/ENDTRY it is insignificant),
VFP executes a SET TEXTMERGE TO in the error's scope,
and therefore, the filename setting or the buffer value is lose.
Previous
Reply
Map
View

Click here to load this message in the networking platform