Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Function 为什么PowerBuilder函数Integer(";)返回零_Function_Integer_Powerbuilder - Fatal编程技术网

Function 为什么PowerBuilder函数Integer(";)返回零

Function 为什么PowerBuilder函数Integer(";)返回零,function,integer,powerbuilder,Function,Integer,Powerbuilder,在PowerBuilder中,函数Integer(“”)返回零。空字符串怎么可能变成零?为什么Integer函数(“”)不返回null?这就是该方法的定义方式,并且从一开始就一直如此。无效输入或不兼容的数据类型导致返回零(0)。如果输入为null,则返回null 如果需要区分零字符串值和非数字输入,请在使用Integer之前使用IsNumber方法进行检查。空字符串与NULL不同。我记得,只有当字符串参数为NULL时,返回的数字才会为NULL 我假设空字符串相当于PB的初始值,因此对于数字,它将

在PowerBuilder中,函数Integer(“”)返回零。空字符串怎么可能变成零?为什么Integer函数(“”)不返回null?

这就是该方法的定义方式,并且从一开始就一直如此。无效输入或不兼容的数据类型导致返回零(0)。如果输入为null,则返回null


如果需要区分零字符串值和非数字输入,请在使用Integer之前使用IsNumber方法进行检查。

空字符串与NULL不同。我记得,只有当字符串参数为NULL时,返回的数字才会为NULL


我假设空字符串相当于PB的初始值,因此对于数字,它将是0(零)。

由于我们中没有人可能是近30年前设计或实现此函数的开发人员,请询问您的意见。但是,您最好记住这个模式:一个简单函数返回null的唯一时间是当传递的参数为null时。你会发现它经常在PowerScript中应用。对,我非常喜欢它,笑了一会儿“你会发现它经常在PowerScript中应用”。是的,先生,我从PB帮助中了解到了这一点。当被问到我的问题时,我心情很好。真的。:)0(零)是有效值,而“”空字符串不是有效数字。例如,如果一张假钞有价值,那么为什么打印它是非法的?确认是转换前的第一件事。因为我带着口哨和唱歌离开了,所以你失去了工作。你脸上带着微笑给我看你的牙齿。在现实生活中,当我在货币兑换窗口给你一张假钞时,你应该给当局打电话。规则:非法=null,因此类型转换函数的空字符串必须严格等于null。在PowerBuilder中,空字符串不等于null。您不理解。实际上,Integer()函数在收到的字符串参数中没有有效数字时必须返回null。简单地说,当你没有得到有效的东西时,你没有给我有效的东西。不是吗?在PB中,当integer函数在字符串参数中没有收到有效的数字时,默认情况下返回0。