请解释一下这个编码 [英] please explain this coding

查看:62
本文介绍了请解释一下这个编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  Dim  s,s1,sheet  As  字符串 
s = Mid(ddlfromreg.Text, 2
s1 = Mid(ddltoreg.Text, 2
sheets =(Val(s1) - Val(s))+ 1
txtsheets.Text = Val(sheet)* 15

解决方案

  Dim  s,s1,sheet  As   String  



s s1 被声明为字符串 s。

脏语句(Visual Basic) [ ^ ]

 s = Mid(ddlfromreg.Text, 2 
s1 = Mid(ddltoreg.Text, 2



Mid function返回一个 String ,其中包含 String 中指定数量的字符:

Mid Function(Visual Basic) [ ^ ]

 sheet =(Val(s1) -  Val(s))+  1  

< br $>
Val 函数将字符串中包含的数字作为数值返回:

函数 [ ^ ]

 txtsheets.Text = Val(工作表)*  15  



文本 txtsheets 的属性设置为 Val(工作表)* 15



希望这会有所帮助。


这很简单:它从from和To值中提取两个字符串,从每种情况开始,从输入的第二个字符开始,然后将它们转换为数字,从另一个中减去一个并添加一个。然后它将它转换为字符串(gawd知道原因),将该字符串转换回gawd的数字,知道什么是愚蠢的原因,将其乘以15,再将其转换回字符串并将结果放入文本框中。

Dim s, s1, sheets As String
        s = Mid(ddlfromreg.Text, 2)
        s1 = Mid(ddltoreg.Text, 2)
        sheets = (Val(s1) - Val(s)) + 1
        txtsheets.Text = Val(sheets) * 15

解决方案

Dim s, s1, sheets As String


s, s1 and sheets are declared as Strings.
Dim Statement (Visual Basic)[^]

s = Mid(ddlfromreg.Text, 2)
s1 = Mid(ddltoreg.Text, 2)


The Mid function returns a String containing a specified number of characters from a String:
Mid Function (Visual Basic)[^]

sheets = (Val(s1) - Val(s)) + 1


The Val function returns the numbers contained in a string as a numeric value:
Val Function[^]

txtsheets.Text = Val(sheets) * 15 


The Text property of txtsheets is set to Val(sheets) * 15.

Hope this helps.


It''s pretty simple: it extracts two strings from teh From and To values, starting in each case from the second character of the input, then converts those to numbers, subtracts one from the other and adds one. It then converts it to a string (gawd knows why), converts that string back to a number for gawd knows what stupid reason, multiplies that by 15, converts it back to a string again and puts the result in a text box.


这篇关于请解释一下这个编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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