看我用汉语写的vb代码

zt11zfx 2009-08-22 10:16:26
加精
Public int分录编号 As Integer '分录编号
Public int分录条数 As Integer '分录条数
Public int当前辅助号 As Integer
Public 分录辅助字符串 As String

Public str辅助往来单位信息 As String
Public str辅助部门信息 As String
Public str辅助个人信息 As String
Public str辅助产品信息 As String
Public str辅助项目信息1 As String '项目类别编号_项目编号_项目类别名称_项目名称
Public str辅助项目信息2 As String
Public str辅助项目信息3 As String
Public str辅助项目信息4 As String


Public str外币币种 As String
Public str外币金额 As String
Public str外币汇率 As String


Public str辅助金额 As String
Public str辅助日期 As String
Public int分录辅助条数 As Integer

Dim 分录辅助条数(2200) As Integer

Dim 辅助信息数组(2200, 50, 13) As String

Public Function int获取辅助条数() As Integer

Dim i As Integer
int获取辅助条数 = 0
For i = 1 To 49
If Val(辅助信息数组(int分录编号, i, 5)) <> 0 Then
int获取辅助条数 = i
End If
Next

End Function

Public Sub put写辅助信息()


If str辅助往来单位信息 <> "" Then 辅助信息数组(int分录编号, int当前辅助号, 1) = str辅助往来单位信息
If str辅助部门信息 <> "" Then 辅助信息数组(int分录编号, int当前辅助号, 2) = str辅助部门信息
If str辅助个人信息 <> "" Then 辅助信息数组(int分录编号, int当前辅助号, 3) = str辅助个人信息
If str辅助产品信息 <> "" Then 辅助信息数组(int分录编号, int当前辅助号, 4) = str辅助产品信息
If str辅助金额 <> "" Then 辅助信息数组(int分录编号, int当前辅助号, 5) = str辅助金额
If str辅助日期 <> "" Then 辅助信息数组(int分录编号, int当前辅助号, 6) = str辅助日期
If str辅助项目信息1 <> "" Then 辅助信息数组(int分录编号, int当前辅助号, 7) = str辅助项目信息1
If str辅助项目信息2 <> "" Then 辅助信息数组(int分录编号, int当前辅助号, 8) = str辅助项目信息2
If str辅助项目信息3 <> "" Then 辅助信息数组(int分录编号, int当前辅助号, 9) = str辅助项目信息3
If str辅助项目信息4 <> "" Then 辅助信息数组(int分录编号, int当前辅助号, 10) = str辅助项目信息4
If str外币币种 <> "" Then 辅助信息数组(int分录编号, int当前辅助号, 11) = str外币币种
If str外币汇率 <> "" Then 辅助信息数组(int分录编号, int当前辅助号, 12) = str外币汇率
If str外币金额 <> "" Then 辅助信息数组(int分录编号, int当前辅助号, 13) = str外币金额


clear清空当前辅助信息
分录辅助条数(int分录编号) = int分录辅助条数
End Sub
Public Sub get读辅助信息()
clear清空当前辅助信息
str辅助往来单位信息 = Trim(辅助信息数组(int分录编号, int当前辅助号, 1))
str辅助部门信息 = Trim(辅助信息数组(int分录编号, int当前辅助号, 2))
str辅助个人信息 = Trim(辅助信息数组(int分录编号, int当前辅助号, 3))
str辅助产品信息 = Trim(辅助信息数组(int分录编号, int当前辅助号, 4))
str辅助金额 = Trim(辅助信息数组(int分录编号, int当前辅助号, 5))
str辅助日期 = Trim(辅助信息数组(int分录编号, int当前辅助号, 6))
str辅助项目信息1 = Trim(辅助信息数组(int分录编号, int当前辅助号, 7))
str辅助项目信息2 = Trim(辅助信息数组(int分录编号, int当前辅助号, 8))
str辅助项目信息3 = Trim(辅助信息数组(int分录编号, int当前辅助号, 9))
str辅助项目信息4 = Trim(辅助信息数组(int分录编号, int当前辅助号, 10))

str外币币种 = 辅助信息数组(int分录编号, int当前辅助号, 11)
str外币汇率 = 辅助信息数组(int分录编号, int当前辅助号, 12)
str外币金额 = 辅助信息数组(int分录编号, int当前辅助号, 13)


int分录辅助条数 = Trim(分录辅助条数(int分录编号))
End Sub
Public Sub clear清空辅助信息()
str辅助往来单位信息 = ""
str辅助部门信息 = ""
str辅助个人信息 = ""
str辅助产品信息 = ""
str辅助金额 = ""
str辅助日期 = ""
str辅助项目信息1 = ""
str辅助项目信息2 = ""
str辅助项目信息3 = ""
str辅助项目信息4 = ""
str外币币种 = ""
str外币金额 = ""
str外币汇率 = ""
For i = 1 To 50
For j = 1 To 49
For K = 1 To 11
辅助信息数组(i, j, K) = ""
Next
Next
Next
End Sub
Public Sub clear清空当前辅助信息()
str辅助往来单位信息 = ""
str辅助部门信息 = ""
str辅助个人信息 = ""
str辅助产品信息 = ""
str辅助金额 = ""
str辅助日期 = ""
str辅助项目信息1 = ""
str辅助项目信息2 = ""
str辅助项目信息3 = ""
str辅助项目信息4 = ""
str外币币种 = ""
str外币金额 = ""
str外币汇率 = ""
End Sub

Public Sub 分析凭证信息字符串()
'"4200007_中铁建总公司财务部`_`_```1`3289885.47`20080804`^f"
' Trim(Split(Split(strFLFZXX(i), "`")(0), "_")(1))
On Error Resume Next
Dim szdd() As String
szdd = Split(分录辅助字符串, "^f")
clear清空当前辅助信息
Dim i
int分录辅助条数 = UBound(szdd)
For i = 0 To UBound(szdd) - 1
int当前辅助号 = i + 1
str辅助往来单位信息 = " " & Trim(Split(Split(分录辅助字符串, "^f")(i), "`")(0))
str辅助部门信息 = " " & Trim(Split(Split(分录辅助字符串, "^f")(i), "`")(1))
str辅助个人信息 = " " & Trim(Split(Split(分录辅助字符串, "^f")(i), "`")(2))
str辅助产品信息 = " " & Trim(Split(Split(分录辅助字符串, "^f")(i), "`")(3))
str辅助项目信息1 = " " & Split(Trim(Split(Split(分录辅助字符串, "^f")(i), "`")(4)), "_")(0)
str辅助项目信息2 = " " & Split(Trim(Split(Split(分录辅助字符串, "^f")(i), "`")(4)), "_")(1)
str辅助项目信息3 = " " & Split(Trim(Split(Split(分录辅助字符串, "^f")(i), "`")(4)), "_")(2)
str辅助项目信息4 = " " & Split(Trim(Split(Split(分录辅助字符串, "^f")(i), "`")(4)), "_")(3)
str辅助金额 = " " & Trim(Split(Split(分录辅助字符串, "^f")(i), "`")(6))
str辅助日期 = " " & Trim(Split(Split(分录辅助字符串, "^f")(i), "`")(7))
str外币币种 = " " & Trim(Split(Split(分录辅助字符串, "^f")(i), "`")(8)) & "_" & get外币名称("" & Trim(Split(Split(分录辅助字符串, "^f")(i), "`")(8)))
str外币汇率 = " " & Trim(Split(Split(分录辅助字符串, "^f")(i), "`")(9))
str外币金额 = " " & Trim(Split(Split(分录辅助字符串, "^f")(i), "`")(10))



put写辅助信息
Next i
分录辅助字符串 = ""
End Sub
Public Sub 合成凭证信息字符串()
Dim i, j As Integer
On Error Resume Next
分录辅助字符串 = ""
For i = 1 To int获取辅助条数
int当前辅助号 = i
get读辅助信息
分录辅助字符串 = 分录辅助字符串 & str辅助往来单位信息 & "`" & str辅助部门信息 & "`" & str辅助个人信息 & "`" & str辅助产品信息 & "`"
'If str辅助项目信息1 <> "" Then


分录辅助字符串 = 分录辅助字符串 & str辅助项目信息1 & "_" & str辅助项目信息2 & "_" & str辅助项目信息3 & "_" & str辅助项目信息4 & "_"



If str外币币种 <> "" Then
分录辅助字符串 = 分录辅助字符串 & "`" & "`" & str辅助金额 & "`" & str辅助日期 & "`" & Split(str外币币种, "_")(0) & "`" & str外币汇率 & "`" & str外币金额 & "``f"
Else
分录辅助字符串 = 分录辅助字符串 & "`" & "`" & str辅助金额 & "`" & str辅助日期 & "`````f"


End If
Next i

End Sub
...全文
7978 345 打赏 收藏 转发到动态 举报
写回复
用AI写文章
345 条回复
切换为时间正序
请发表友善的回复…
发表回复
zzdeDream 2012-06-28
  • 打赏
  • 举报
回复
牛 只的初学者学习!!
shenboo 2012-05-20
  • 打赏
  • 举报
回复
看惯英文再看中文都看不习惯了
hongchangliu 2012-05-12
  • 打赏
  • 举报
回复
肿么可以这样强悍?!
whqcx 2012-04-13
  • 打赏
  • 举报
回复
无语无语
anticlimax 2012-04-12
  • 打赏
  • 举报
回复
原来,微软早就会我们的易语言了
llyjili 2012-03-12
  • 打赏
  • 举报
回复
楼主真乃神人!!------膜拜
星小野 2012-02-20
  • 打赏
  • 举报
回复
才人啊
ye_7_ 2011-10-23
  • 打赏
  • 举报
回复
哇塞~~~~~~~~~~~~~
wwxjsoft 2011-10-15
  • 打赏
  • 举报
回复
楼主为中文走向世界做出了伟大的贡献
oshi002 2011-10-15
  • 打赏
  • 举报
回复
这个思路不错的啊,不过变量太长了也不好记。
nonary 2011-08-23
  • 打赏
  • 举报
回复
[Quote=引用 17 楼 yachong 的回复:]

这样的代码我也写过一段时间,没什么不好
公司里不是每个人都有英文基础,用汉字定义变量、函数可以让每个人都能看明白。
[/Quote]

既然这样的话还给他们看干什么呀。。。
wjtwsd 2011-08-18
  • 打赏
  • 举报
回复
看着别扭,眼花了!
几罗星人 2011-07-30
  • 打赏
  • 举报
回复
你够本事这样写:

公有声明 分录编号 是 整形 '分录编号
公有声明 分录条数 是 整形 '分录条数
公有声明 当前辅助号 是 整形
公有声明 分录辅助字符串 是 字符串

公有声明 辅助往来单位信息 是 字符串
公有声明 辅助部门信息 是 字符串
公有声明 辅助个人信息 是 字符串
公有声明 辅助产品信息 是 字符串
公有声明 辅助项目信息1 是 字符串 '项目类别编号_项目编号_项目类别名称_项目名称
公有声明 辅助项目信息2 是 字符串
公有声明 辅助项目信息3 是 字符串
公有声明 辅助项目信息4 是 字符串


公有声明 外币币种 是 字符串
公有声明 外币金额 是 字符串
公有声明 外币汇率 是 字符串


公有声明 辅助金额 是 字符串
公有声明 辅助日期 是 字符串
公有声明 分录辅助条数 是 整形

声明 分录辅助条数(2200) 是 整形

声明 辅助信息数组(2200, 50, 13) 是 字符串

公有声明 函数 获取辅助条数() 是 整形

声明 我 是 整形


如果这样编译机都给你Pass的话,那还有没有天理啊~~~~
mezhe 2011-07-22
  • 打赏
  • 举报
回复
牛人!不过感觉有点怪
codingfunny 2011-07-12
  • 打赏
  • 举报
回复
占字节的说法,是对变量、数据类型认识不清造成的。变量名,只是个名字而已,编译后,映射到内存上的一个位置,具体内存站的空间大小跟类型有关,比如Integer,你用再长的变量名,它也只占2个字节空间而已。
再普及一下,变量名怎么命名,跟内存大小没有任何关系。
huahuademama 2011-07-11
  • 打赏
  • 举报
回复
本来VB就支持中文的啊,我也是这样写的,因为业余爱好者发表简单最重要,管他占多少字节,现在20M的硬盘恐怕历史博物馆都找不到了。

不过再牛,或者真的有本事,就把 if 。。。 then。。。 写成 “若。。。。则。。。。完”,我曾经想开发过,给儿童教育的。。。。。
Uncleguai 2011-04-08
  • 打赏
  • 举报
回复
占内存啊
青蛙爱大莹宝 2011-03-29
  • 打赏
  • 举报
回复
楼主 真 有才 ,佩服 啊
  • 打赏
  • 举报
回复
是不是将来可以开发出纯中文的开发工具呢?期待ing
lyserver 2011-03-15
  • 打赏
  • 举报
回复
牛人年年有啊!
加载更多回复(321)

7,762

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧