欢迎大家来到IT世界,在知识的湖畔探索吧!
-
小写金额转大写,程序源代码如下:
int i,lendec,lenint
string numstr,a,b,c,d,bbak
numstr=string(aje,”#0.00″)
lenint=len(mid(numstr,1,pos(numstr,’.’) – 1))
if right(numstr,2)=’00’ then
lendec=0
else
lendec=2
end if
string dxint[13],dxdec[2],sz[13]
string dxstr=”万仟佰拾亿仟佰拾万仟佰拾元”
string szstr=”零壹贰叁肆伍陆柒捌玖”
for i=1 to 13
dxint[i]=mid(dxstr,26 – i*2+1,2)
if i<11 then
sz[i]=mid(szstr,i*2 – 1,2)
else
sz[i]=” “
end if
next
dxdec[1]=”角”
dxdec[2]=”分”
dxstr=” “
for i = 1 to lenint
a = mid(mid(numstr,1,lenint),i,1)
b = sz[integer(a)+1]
c = dxint[lenint – i +1]
if dxstr<>” ” then
d = mid(dxstr,len(dxstr) – 1 ,2)
else
d = ” “
end if
if b=”零” and (d=”零” or b=bbak or c=”元” or c=”万” or c=”亿”) then b=””
if a=”0″ and c<>”元” and c<>”万” and c<>”亿” then c=””
if (c=”元” or c=”万” or c=”亿”) and d=”零” and a=”0″ then
dxstr=mid(dxstr,1,len(dxstr) – 2)
d = mid(dxstr,len(dxstr) – 1,2)
if (c=”元” and d=”万” or c=”万”and d=”亿”) then c=””
end if
dxstr=dxstr + b + c
bbak = b
next
for i=1 to lendec
a = mid (mid(numstr,lenint+2,lendec),i,1)
if a=”0″ and dxdec[i]=”分” then
b=””
else
b=sz[integer(a) + 1]
end if
if a<>”0″ then
dxstr=dxstr+b+dxdec[i]
else
dxstr=dxstr+b
end if
next
if lendec=0 then dxstr=dxstr+”整”
return dxstr
2.获取IP地址
声明win32 API函数:
function int WSAStartup( uint UIVersionRequested, ref s_WSAData lpWSAData ) library “wsock32.dll”
function int WSACleanup() library “wsock32.dll”
function int WSAGetLastError ( ) library “wsock32.dll”
function int gethostname ( ref string name, int namelen ) library “wsock32.dll”
function string GetHost(string lpszhost, ref blob lpszaddress ) library “pbws32.dll”
使用方法:
s_wsadata l_WSAData
string ls_HostName = space(128)
string ls_IpAddress
int li_version = 257
blob{4} lb_hostaddress
IF wsastartup ( li_version, l_WSAData ) = 0 THEN
IF gethostname ( ls_HostName, len(ls_HostName) ) < 0 THEN
messagebox(“GetHostName”,WSAGetLastError())
ELSE
GetHost(ls_HostName, lb_HostAddress)
ls_IpAddress = string(asc(string(blobmid(lb_HostAddress,1,1))),”000″) + “.”
ls_IpAddress += string(asc(string(blobmid(lb_HostAddress,2,1))),”000″) + “.”
ls_IpAddress += string(asc(string(blobmid(lb_HostAddress,3,1))),”000″) + “.”
ls_IpAddress += string(asc(string(blobmid(lb_HostAddress,4,1))),”000″)
END IF
WSACleanup()
ELSE
messagebox(“GetHostName”,WSAGetLastError())
END IF
sle_1.text=ls_hostname
sle_2.text=ls_ipaddress
3.Datawindow每页打印固定行
—- 第一步:增加一个计算列,此计算列必须放在Detail段,Expression中输入: ceiling(getrow()/20) <–这里20还可以用全局函数取代,这样可以允许用户任意设置每页打印多少行。
—- 第二步:定义分组,选择菜单Rows->Create Group…
—- 按计算列字段分组,并一定将check box–>New Page On Group Break选中。
—- 第三步:将此计算列设为不可视。
—- 另外,如果需要最后一页不足补空行。也很简单,如下:
long ll_pagerow = 6 //每页打印行数
long ll_count, ll_row
ll_count = dw_report.retrieve(…)
//取得现有报表的总行数
ll_count = ll_pagerow – mod(ll_count, ll_pagerow)
If ll_count < ll_pagerow Then
for ll_row = 1 to ll_count
dw_print.insertrow(0) //补足空行
next
end If
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://itzsg.com/37444.html