几何尺寸与公差论坛

 找回密码
 注册
查看: 674|回复: 0

【转帖】passing variables

[复制链接]
发表于 2009-4-13 13:18:46 | 显示全部楼层 |阅读模式
passing variables
what would be the best way to handle passing variables and values between userforms in a sw vba macro.
thanks,
declan.
in form1 declare the variable as global ex. test
and in form2 you can call the variable from form1: form1.test
chris
solidworks 2007 (office pro.) sp5.0
testing solidworks 2009 (pro) sp0.0
dell precision t3400
2 cpu (8500) 3.16 ghz, 3.25 gb of ram
window xp pro sp2
nvidia fx 570 6.14.11.6262
for best programming practise your main code function should create an instance of form1, show it, and after it has returned, get the variables (that are set as public not global) and do as you please with them. then the main code continues and creates an instance of form2, and then sets public variables within form2 to those values you just retrieved from form1.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 08:57 , Processed in 0.036180 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表