Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Differences SYS(100) AND SET('CONSOLE') 1

Status
Not open for further replies.

weedz

Programmer
Dec 5, 2000
718
NL
Hello there,

Can anyone provide me with any info regarding SYS(100) and SET('CONSOLE'), concerning any differences between these two statements ??

Both should return the 'set console' setting, according to the MSDN but in my app both show opposite values (SYS(100) shows 'OFF' as where SET('CONSOLE') returns 'ON'.

Thanks in advance,

Weedz (Wietze Veld)
veld4663@exact.nl

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
While FPD/FPD list CONSOLE as an Option for the SET() function, VFP 3/5/6/7 don't. I'm not sure what ? SET(CONSOLE&quot;) actually represents - it's always ON. Note: ? SET(CONSOLE&quot;) is also &quot;wrong&quot; - always ON - in FPD/FPW 2.6a - so much for documentation <g>.

Rick
 
OK. Let me see if I can explain this without muddying the water:

They SYS(100) function is used in conjunction with SET('CONSOLE') in order to restore the SET CONSOLE setting after an error occurs.

The important clause in the VFP help for the SET CONSOLE command:
Important An error always sets SET CONSOLE to ON. Use SYS(100) to check the SET CONSOLE setting before the error occurred.

Paste the following into a PRG and run it:
ON ERROR *
MESSAGEBOX('SET CONSOLE IS '+SET('CONSOLE'),0,'Before')
MESSAGEBOX('SYS(100) IS '+SYS(100),0,'Before')

OH-BOY && last I checked, OH-BOY was not a valid VFP
&& function, thus throws an error

MESSAGEBOX('SET CONSOLE IS '+SET('CONSOLE'),0,'After')
MESSAGEBOX('SYS(100) IS '+SYS(100),0,'After')

Rick,

I'd guess the reason SET CONSOLE is always returning ON, in your case, is because you are issuing it from the command window and it cant be set from there. Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Good Answer Jon David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
Thanks Jon & Rick,

These are the answers that give me some insight. As you stated the console setting was indeed set to ON by an error in my case. That is how I got to the question.

Thanks again.

Weedz (Wietze Veld)
veld4663@exact.nl

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top