Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
#IF...#ENDIF And Image Locations
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01232067
Message ID:
01232070
Vues:
13
#IF VERSION(2) = 2
	#DEFINE IMAGE_LOC_DEV_BASE      ADDBS(SYS(5) + SYS(2003)) + "Media\"
	#DEFINE IMAGE_LOC_DEV_EFFECTS	IMAGE_LOC_BASE + "Effects"	
	#DEFINE IMAGE_LOC_DEV_QA		IMAGE_LOC_BASE + "Toolbars"
#ELSE
	#DEFINE IMAGE_LOC_DEV_BASE      ADDBS(SYS(5) + SYS(2003)) + "Graphics\"
	#DEFINE IMAGE_LOC_DEV_EFFECTS	ADDBS(SYS(5) + SYS(2003)) + "Graphics\"
	#DEFINE IMAGE_LOC_DEV_QA		ADDBS(SYS(5) + SYS(2003)) + "Graphics\"
#ENDIF

cImagePath = IMAGE_LOC_EFFECTS
>How can I use preprocessor directives to establish image locations for both runtime and development? In development, my images are broken down bby category into various folders. In runtime, the icons will all be dumped into one folder.
>
>So, right now I have:
>
>
>#DEFINE IMAGE_LOC_DEV_BASE      ADDBS(SYS(5) + SYS(2003)) + "Media\"
>#DEFINE IMAGE_LOC_DEV_EFFECTS	IMAGE_LOC_BASE + "Effects"	
>#DEFINE IMAGE_LOC_DEV_QA	IMAGE_LOC_BASE + "Toolbars"
>
>#DEFINE IMAGE_LOC_RUNTIME	ADDBS(SYS(5) + SYS(2003)) + "Graphics\"
>
>
>But then in code I would need to do:
>
>
>IF oApp.lRunTime
>    cImagePath = IMAGE_LOC_RUNTIME
>ELSE
>    cImagePath = IMAGE_LOC_EFFECTS
>ENDIF
>
>** Determine the image to display
>IF lEnabled
>    sImage = cImagePath + .sIcon
>ELSE
>    sImage = cImagePath + .sIconDisabled
>ENDIF
>
>.imgIcon.Picture = sImage
>
>
>Is there a way to set up the path that is simplified?
>
>Thanks
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform