本文介绍了如何在不输出的情况下增加一个字节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 当我选择Strict时,我想增加一个字节,而且我不希望想要进行任何投射。下面的代码可以实现,但它很难在 眼睛。 Dim lineNumber As Byte = 0 Dim incrementer As字节= 1 每条线作为线路输入mCollection lineNumber + =增量器 line.LineNumber.Value = lineNumber 下一页 我想做更多这样的事情 Dim lineNumber As Byte = 0 每条线作为线路输入mCollection lineNumber + = 1y line.LineNumber.Value = lineNumber 下一页 其中y是后缀会创建无名临时对象 作为一个值为1的字节。 有没有办法做到这一点?有没有更好的方法来增加一个字节? 谢谢, Russ 解决方案 < KO ********* @ hotmail.com> schrieb: 你不需要做任何明确的演员! - MS Herfried K. Wagner MVP< URL:http://dotnet.mvps.org/> VB< URL:http://classicvb.org/petition/> I want to increment a byte when I have Option Strict on and I don''twant to do any casting. The code below does it but it is hard on theeyes. Dim lineNumber As Byte = 0Dim incrementer As Byte = 1 For Each line As Line In mCollectionlineNumber += incrementerline.LineNumber.Value = lineNumberNext I''d like to do something more like this Dim lineNumber As Byte = 0 For Each line As Line In mCollectionlineNumber += 1yline.LineNumber.Value = lineNumberNext Where y is what ever suffix would create that nameless temporary objectas a byte with the value of 1. Is there a way to do this? Is there a better way to increment a byte? Thanks,Russ 解决方案 You don''t need to do any explicit casting! --M S Herfried K. WagnerM V P <URL:http://dotnet.mvps.org/>V B <URL:http://classicvb.org/petition/> 这篇关于如何在不输出的情况下增加一个字节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-17 20:06