I hate to always have to mention this, but be careful with the chkfile! 
I once had this code for a c:\temp directory and guess what...  The user
actually had a file called "temp" in the root c:\ directory so it wouldn't
create the directory!

Karen



-----Original Message-----
From: Dennis McGrath <[email protected]>
To: RBASE-L Mailing List <[email protected]>
Sent: Fri, Jul 19, 2013 11:56 am
Subject: [RBASE-L] - RE: Tip of the Day: Finding Default vs. ActiveSCRATCH 
Settings


Even better:

-Scratch File Location
et var vMyScratch TEXT = 'D:\XX\RBTEMP'
IF (CHKFILE(.vMyScratch )) = 1 THEN
   GOTO SetScratch
LSE
   MKDIR .vMyScratch 
NDIF
LABEL SetScratch
ET SCRATCH .vMyScratch

ennis McGrath
oftware Developer
MI Security Solutions
661 Glenlake Ave
tasca IL 60143
30-980-8461
[email protected]
----Original Message-----
rom: [email protected] [mailto:[email protected]] On Behalf Of Bruce A. Chitiea
ent: Friday, July 19, 2013 10:15 AM
o: RBASE-L Mailing List
ubject: [RBASE-L] - RE: Tip of the Day: Finding Default vs. Active SCRATCH 
ettings
Thanks very much, Razzak.
May I add, for any who might like to take advantage of the SET SCRATCH
PATH> feature:
To ensure that an active SET SCRATCH <PATH> is always available, I include
his code - cribbed from a long-ago Razzak email I believe - in my Startup
ile.
--Scratch File Location
F (CHKFILE('D:\XX\RBTEMP')) = 1 THEN
   GOTO SetScratch
LSE
   MKDIR 'D:\XX\RBTEMP'
NDIF
LABEL SetScratch
ET SCRATCH 'D:\XX\RBTEMP'
Hope this helps.
Bruce Chitiea
afeSectors, Inc.
CondoMetrics
09.238.9012 Cell

----Original Message-----
rom: [email protected] [mailto:[email protected]] On Behalf Of A. Razzak
emon
ent: Thursday, July 18, 2013 11:00 PM
o: RBASE-L Mailing List
ubject: [RBASE-L] - Tip of the Day: Finding Default vs. Active SCRATCH
ettings
Friday, July 19, 2013
Tip of the Day: Finding Default vs. Active SCRATCH Settings
roduct.: R:BASE eXtreme 9.5 (32/64)
uild...: 9.5.3.20718 or higher www.rupdates.com
ettings: SCRATCH
(CVAL('SCRATCH')) function returns the value of the currently active SCRATCH
etting.
SET SCRATCH sets the drive and directory location for temporary (.$$$) files
reated when managing TEMPORARY Table, TEMPORARY Views, TEMPORARY SATTACHed
ables, and Sorting data.
When using the SET SCRATCH ON, the temporary (.$$$) files are stored in the
atabase drive and directory.
When using the SET SCRATCH OFF, the temporary (.$$$) files are stored in the
urrent (startup) drive and directory.
When using the SET SCRATCH TMP, (default configuration), the temporary
.$$$) files are stored in the Windows User Environment Variables folder set
or TMP folder.
When using the manual SET SCRATCH <path>, the temporary (.$$$) files are
tored in the defined path folder location. When doing so, make sure that
he folder does exist, and the user has Full Control and permission to such
older.
By default, R:BASE configuration files include the TMP for SCRATCH setting.
his default will allow R:BASE or Oterro sessions to use the user's TMP
nvironment settings for SCRATCH files on startup and eliminate all issues
elated to setting the SCRATCH directory and related files.
To take advantage of this setting, use the option "SCRATCH TMP" in the
ppropriate R:BASE and OTERRO configuration files. You may also use the "SET
CRATCH TMP" command in your application startup files.
Using the SET SCRATCH <ValidPathAndFolder> command at the R> prompt, in a
ommand file or in application startup file, will overwrite the default
CRATCH setting defined in the R:BASE eXtreme 9.5 Configuration file.
Using the SET SCRATCH <path> command, and providing the invalid path and
older will result in an -ERROR- as follows:
-ERROR- Cannot create temporary file. (2964)
In that case, make sure that you provide the correct path and folder with
ull control and permissions.
In a scenario where you have overwritten the default SCRATCH setting, did
ou know that the R:BASE "Settings" option will show you the Default and
ctive SCRATCH settings?
Here's how:
R:BASE eXtreme 9.5 (32/64) | Database Explorer | Main Menu | Settings |
onfiguration Settings ...
Configuration Settings | Scratch ...
Notice the illustration, including:
[x] TMP (to store temporary files in user environment TMP directory)
     Default SCRATCH Location:
     Active SCRATCH Location:
Stay productive, my friends!
Very Best R:egards,
Razzak.
www.rbase.com
ww.facebook.com/rbase
ww.RazzakMemon.com
- 
0+ years of continuous innovation!
5 Years of R:BASE Technologies, Inc. making R:BASE what it is today!
-


Reply via email to