VB6中的Sbyte数组. [英] Sbyte array in VB6.

查看:236
本文介绍了VB6中的Sbyte数组.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的开发人员,
我想在vb6中找到C#字节的替代方法.
在C#Sbyte中,范围是-127到+128.
我想在VB6中找到相同的范围数组.
在VB6中有字节数组,但范围为0-255.
VB6中是否有其他方法可以找到与c#中的sbyte相同的数组Range?

感谢进阶,
问候,
Ravi Sharma

解决方案

VB6没有那么小的整数类型.在将其传递到您的VB6应用之前,您必须将C#端的值强制转换为Byte,或者将C#端的类型更改为Byte而不是SByte,(我认为这样做会比较乏味,但从长远来看更易于维护).另一个好处是,如果数据是从VB6应用返回的,则不必在C#端执行健全性检查(因为传递回的值可能会使C#端的SByte变量溢出).

据我所知VB6并没有内置类型的带符号字节.根据您的需要,您可以将.NET SByte值存储到Byte中,或者使用Integer.


Dear Developer,
I want to find the alternative of C# sbyte into vb6.
In C# Sbyte have the Range -127 to +128 .
I want to find same range array in VB6.
In VB6 there is byte array but its have range 0-255.
Is any alternative method in VB6 to find the same array Range like sbyte in c#?

Thanks in Advanced,
Regards,
Ravi Sharma

解决方案

VB6 doesn''t have an integer type that small. You''re going to have to cast the value on the C# side to a Byte before passing it to your VB6 app, or change the type in the C# side to be a Byte instead of a SByte, (which I think would be a bit more tedious to do, but more maintainable in the long run). Another benefit is that you don''t have to implement sanity checks on the C# side if the data is returned from the VB6 app (because the value being passed back may overflow the SByte variable on the C# side).


As far as I know VB6 hasn''t the signed byte as built in type. Depending upon your needs you may store .NET SByte values into Bytes or use Integer instead.


这篇关于VB6中的Sbyte数组.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆