Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Path To Images
Message
From
08/08/2007 09:31:25
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01246572
Message ID:
01246758
Views:
23
>I had created a series of constants to define image locations. The images are stored in different
>locations during development, in subfolders under the Media\UI folder. In runtime, all images will
>be dumped into a single folder called 'Graphics':
>
>
>#DEFINE IMAGE_LOC_RUNTIME	ADDBS(SYS(5) + SYS(2003)) + "Graphics\"
>#DEFINE IMAGE_LOC_DEV		ADDBS(SYS(5) + SYS(2003)) + "Media\UI\"
>
>#DEFINE IMAGE_LOC_BASE   	IIF(RUNTIME, IMAGE_LOC_RUNTIME, IMAGE_LOC_DEV)
>
>#DEFINE IMAGE_LOC_EFFECTS	IIF(RUNTIME, IMAGE_LOC_BASE, IMAGE_LOC_BASE + "Effects\")
>#DEFINE IMAGE_LOC_ARROWS	IIF(RUNTIME, IMAGE_LOC_BASE, IMAGE_LOC_BASE + "Arrows\")
>
>

I just want to point out two things here. First, using an expression like this, every place you use the constant, the expression has to be evaluated. This is a case where it's probably better to evaluate once into a variable or property of an app object and then use the computed value repeatedly.

Second, if you do want to stick with the expression, FORCEPATH() makes the first two more obvious than a simple concatenation does:

ADDBS(FORCEPATH("Graphics", CURDIR()))

Tamar
Previous
Reply
Map
View

Click here to load this message in the networking platform