明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 737|回复: 1

小问题,难住了,关于变体变量有没有赋值

[复制链接]
发表于 2016-10-17 19:02 | 显示全部楼层 |阅读模式
Dim pnt_fs As Variant

If pnt_fs Is Empty Then pnt_fs = ThisDrawing.Utility.GetPoint(, "选择俯视图中心点: ")
If pnt_fs Is Nothing Then pnt_fs = ThisDrawing.Utility.GetPoint(, "选择俯视图中心点: ")
If pnt_fs Is VBNull Then pnt_fs = ThisDrawing.Utility.GetPoint(, "选择俯视图中心点: ")
If pnt_fs = Empty Then pnt_fs = ThisDrawing.Utility.GetPoint(, "选择俯视图中心点: ")
If pnt_fs = null Then pnt_fs = ThisDrawing.Utility.GetPoint(, "选择俯视图中心点: ")
If pnt_fs ="" Then pnt_fs = ThisDrawing.Utility.GetPoint(, "选择俯视图中心点: ")

以上全部试过了,没招了。基本都是类型不匹配或要求对象的错误,当然强行弄也能弄出来,就是加个if err语句,出错就是没赋值,但这样也太难看了,有没有正统的办法。
发表于 2018-8-25 18:53 来自手机 | 显示全部楼层
vartype,试一下,判断结过为vbempty
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-26 16:36 , Processed in 1.716931 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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