Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Better way to handle multiple variable definitions?
Message
De
21/04/2007 20:06:14
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
21/04/2007 08:43:45
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01218589
Message ID:
01218630
Vues:
19
You might consider arrays, objects that contain arrays, or something similar, in the first place, so as not to have so many different variables.

Also, I agree with the other reply you got, that you might be better off defining those variables local, since this is the usual way to avoid variable conflicts between two programs.

>Any better way to do this? I can't get my head around if there is or not. After these are defined, they are set back to the old values on exit of the program. Thanks!
>
>
>
>m.Old_con_fg_r = m.con_fg_r
>m.Old_con_fg_g = m.con_fg_g
>m.Old_con_fg_b = m.con_fg_b
>m.Old_con_bg_r = m.con_bg_r
>m.Old_con_bg_g = m.con_bg_g
>m.Old_con_bg_b = m.con_bg_b
>
>m.Old_dis_fg_r = m.dis_fg_r
>m.Old_dis_fg_g = m.dis_fg_g
>m.Old_dis_fg_b = m.dis_fg_b
>m.Old_dis_bg_r = m.dis_bg_r
>m.Old_dis_bg_g = m.dis_bg_g
>m.Old_dis_bg_b = m.dis_bg_b
>
>m.Old_ne_fg_r = m.ne_fg_r
>m.Old_ne_fg_g = m.ne_fg_g
>m.Old_ne_fg_b = m.ne_fg_b
>m.Old_ne_bg_r = m.ne_bg_r
>m.Old_ne_bg_g = m.ne_bg_g
>m.Old_ne_bg_b = m.ne_bg_b
>
>m.Old_clo_fg_r = m.clo_fg_r
>m.Old_clo_fg_g = m.clo_fg_g
>m.Old_clo_fg_b = m.clo_fg_b
>m.Old_clo_bg_r = m.clo_bg_r
>m.Old_clo_bg_g = m.clo_bg_g
>m.Old_clo_bg_b = m.clo_bg_b
>
>m.Old_war_fg_r = m.war_fg_r
>m.Old_war_fg_g = m.war_fg_g
>m.Old_war_fg_b = m.war_fg_b
>m.Old_war_bg_r = m.war_bg_r
>m.Old_war_bg_g = m.war_bg_g
>m.Old_war_bg_b = m.war_bg_b
>
>m.Old_get_fg_r = m.get_fg_r
>m.Old_get_fg_g = m.get_fg_g
>m.Old_get_fg_b = m.get_fg_b
>m.Old_get_bg_r = m.get_bg_r
>m.Old_get_bg_g = m.get_bg_g
>m.Old_get_bg_b = m.get_bg_b
>
>m.con_fg_r = 0
>m.con_fg_g = 0
>m.con_fg_b = 96
>m.con_bg_r = 192
>m.con_bg_g = 192
>m.con_bg_b = 192
>
>m.dis_fg_r = 128
>m.dis_fg_g = 128
>m.dis_fg_b = 128
>m.dis_bg_r = 192
>m.dis_bg_g = 192
>m.dis_bg_b = 192
>
>m.ne_fg_r = 192
>m.ne_fg_g = 0
>m.ne_fg_b = 0
>m.ne_bg_r = 192
>m.ne_bg_g = 192
>m.ne_bg_b = 192
>
>m.clo_fg_r = 128
>m.clo_fg_g = 0
>m.clo_fg_b = 128
>m.clo_bg_r = 192
>m.clo_bg_g = 192
>m.clo_bg_b = 192
>
>m.war_fg_r = 255
>m.war_fg_g = 255
>m.war_fg_b = 0
>m.war_bg_r = 255
>m.war_bg_g = 0
>m.war_bg_b = 0
>
>m.get_fg_r = 0
>m.get_fg_g = 0
>m.get_fg_b = 128
>m.get_bg_r = 0
>m.get_bg_g = 255
>m.get_bg_b = 255
>
>
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform