当前位置: 首页 > news >正文

学做彩票网站一般开车用什么导航最好

学做彩票网站,一般开车用什么导航最好,17网站一起做网店靠谱,wordpress个人站主题写在前面 这是PB案例学习笔记系列文章的第22篇,该系列文章适合具有一定PB基础的读者。 通过一个个由浅入深的编程实战案例学习,提高编程技巧,以保证小伙伴们能应付公司的各种开发需求。 文章中设计到的源码,小凡都上传到了gite…

写在前面

这是PB案例学习笔记系列文章的第22篇,该系列文章适合具有一定PB基础的读者。

通过一个个由浅入深的编程实战案例学习,提高编程技巧,以保证小伙伴们能应付公司的各种开发需求。

文章中设计到的源码,小凡都上传到了gitee代码仓库https://gitee.com/xiezhr/pb-project-example.git

gitee代码仓库

需要源代码的小伙伴们可以自行下载查看,后续文章涉及到的案例代码也都会提交到这个仓库【pb-project-example

如果对小伙伴有所帮助,希望能给一个小星星⭐支持一下小凡。

一、小目标

上一个案例中我们将小写金额转换为大写金额,这一个案例中我们将制作一个语音播报金额的小应用。

这个在日常开发中也很常见,尤其是在收费结算应用中。最终实现效果如下

金额语音播报

二、实现思路

首先我们需要准备 零、壹、贰、叁、肆、伍、陆、柒、捌、玖、拾、佰、仟、万、亿、元、角、分、整

的.wav格式的语音文件。然后通过WINMM.dll外部动态库的sandPlaySoundA()和waveOutGetNumDevs()

联合起来播放语音文件

三、创建程序基本框架

① 新建examplework工作区

② 新建exampleapp应用

③ 新建w_main窗口,将其Title属性值设置成“朗读款项金额”

由于篇幅原因,以上步骤这儿就不展开了,忘记了的小伙伴翻一翻该系列文章的第一篇

④ 在w_main窗口上放置控件

在窗口上添加3个StaticEdit控件,1个singleLineEdit控件和2个CommandButton。将其分别命名为st_1st_2st_3

sle_1sle_2cb_1cb_2。 调整各个控件布局后如下

控件布局

⑤ 保存窗口

四、编写代码

① 定义本地外部扩展函数

w_mainDeclare Local External Function 选项卡中添加如下代码

Function boolean sndPlaySoundA(string SoundName, uint Flags) Library "WINMM.DLL"
Function uint waveOutGetNumDevs ()Library "WINMM.DLL"

定义扩展函数

② 在W_main窗口的Function List 选项卡中添加Playsound(string as_filename,integer ai_option) return integer函数

代码如下

uint lui_numdevslui_numdevs = WaveOutGetNumDevs() 
If lui_numdevs > 0 Then sndPlaySoundA(as_filename,ai_option)return 1
Elsereturn -1
End If

③ 在w_main窗口的Function List 选项卡中添加xx2dx(decimal ls) return string函数

代码如下

string dx_sz,dx_dw,str_int,str_dec,dx_str,fu,a,b,b2,c,d,result
long num_int,num_dec,len_int,i,a_int,ppdx_sz = "零壹贰叁肆伍陆柒捌玖" 
dx_dw = "万仟佰拾亿仟佰拾万仟佰拾元" //处理小于零情况
if ls<0 thenls = ls*(-1) fu = "负" 
else fu = "" 
end if //取得整数及整数串
dx_str = string(ls)
if (ls>0) and (ls<1) then dx_str = "0"+dx_str 
pp = pos(dx_str,".") 
if pp>0 then str_int = mid(dx_str,1,pos(dx_str,".")-1)
elsestr_int = dx_str 
end if 
num_int = long(str_int) //取得小数及小数串
if (ls>0) and (ls<1) then num_dec = ls * 100
elsenum_dec = (ls - num_int) * 100 
end if 
str_dec = string(num_dec) 
len_int = len(str_int) 
dx_str = "" //转换整整部分
for i = 1 to len_int //a为小写数字字符,b为对应的大写字符,c为对应大写单位,d为当前大写字符串的最后一个汉字a= mid(str_int,i,1) a_int = long(a) b = mid(dx_sz,(a_int*2)+1,2) c = mid(dx_dw,((13 - len_int +i - 1)*2+1),2) if dx_str<>"" thend=mid(dx_str,len(dx_str)-1,2)elsed= "" end if if (b="零") and ((d="零") or (b=b2) 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") thendx_str = mid(dx_str,1,len(dx_str)-2) d=mid(dx_str,len(dx_str)-1,2) if ((c="元") and (d="万")) or ((c="万") and (d="亿")) then c = "" end if dx_str = dx_str + b+ c b2 = b 
next//处理金额小于1的情况if len(dx_str) <= 2 then dx_str= "" //转换小数部分if (num_dec<10) and (ls>0) thena_int = long(str_dec) b = mid(dx_sz,(a_int*2+1),2) if num_dec = 0 then dx_str = dx_str + "整" if num_dec > 0 then dx_str = dx_str +"零"+b+"分" end ifif num_dec >= 10 thena_int = long(mid(str_dec,1,1)) a = mid(dx_sz,(a_int*2+1),2) a_int = long(mid(str_dec,2,1)) b = mid(dx_sz,(a_int*2+1),2) if a<>"零" then a = a+"角" if b <> "零" thenb = b+"分"else b= "" end ifdx_str = dx_str + a + b end ifif ls= 0 then dx_str = "零元整" dx_str = fu+dx_str result = dx_str return result

④ 将事先准备好的.wav格式声音放到项目temp目录下

事下准备好的声音

语音包小凡已经上传的百度网盘了,需要的小伙伴自行下载哈

链接:https://pan.baidu.com/s/17sPGYC21fvzw4ebgXll74A?pwd=8888
提取码:8888

⑤在w_main窗口的cb_1按钮的Clicked事件 中添加如下代码

integer i,count
string ls_current_path
//获取项目当前路径
ls_current_path = GetCurrentDirectory()st_3.text = xx2dx(dec(sle_1.text))count = len(st_3.text)for i= 1 to count step 2CHOOSE CASE mid(st_3.text,i,2)CASE "零"playsound(ls_current_path+"\temp\0.wav",0)				CASE "壹"playsound(ls_current_path+"\temp\1.wav",0)				CASE "贰"playsound(ls_current_path+"\temp\2.wav",0)				CASE "叁"playsound(ls_current_path+"\temp\3.wav",0)				CASE "肆"playsound(ls_current_path+"\temp\4.wav",0)				CASE "伍"playsound(ls_current_path+"\temp\5.wav",0)				CASE "陆"playsound(ls_current_path+"\temp\6.wav",0)				CASE "柒"playsound(ls_current_path+"\temp\7.wav",0)				CASE "捌"playsound(ls_current_path+"\temp\8.wav",0)				CASE "玖"playsound(ls_current_path+"\temp\9.wav",0)				CASE "拾"playsound(ls_current_path+"\temp\十.wav",0)				CASE "佰"playsound(ls_current_path+"\temp\佰.wav",0)				CASE "仟"playsound(ls_current_path+"\temp\仟.wav",0)				CASE "万"playsound(ls_current_path+"\temp\万.wav",0)				CASE "亿"playsound(ls_current_path+"\temp\亿.wav",0)				CASE "元"playsound(ls_current_path+"\temp\元.wav",0)				CASE "角"playsound(ls_current_path+"\temp\角.wav",0)				CASE "分"playsound(ls_current_path+"\temp\分.wav",0)				CASE "整"playsound(ls_current_path+"\temp\整.wav",0)				END CHOOSE
next

⑥ 在cb_2退出按钮的Clicked事件中添加如下代码

close(parent)

⑦ 在开发界面左边的System Tree窗口中双击exampleapp应用对象,并在其Open事件中添加如下代码

open(w_main)

五、运行程序

代码写完了,来检验下我们的劳动成果。

金额语音播报

本期内容到这儿就结束了 ,★,°:.☆( ̄▽ ̄)/$:.°★ 。希望对您有所帮助

我们下期再见 ヾ(•ω•`)o (●’◡’●)


文章转载自:
http://lignification.c7617.cn
http://convulsive.c7617.cn
http://sibilate.c7617.cn
http://autotomize.c7617.cn
http://lilied.c7617.cn
http://photochromy.c7617.cn
http://wordiness.c7617.cn
http://abmigration.c7617.cn
http://synchrotron.c7617.cn
http://tubilingual.c7617.cn
http://lucia.c7617.cn
http://mezzotint.c7617.cn
http://kyanite.c7617.cn
http://spokespeople.c7617.cn
http://polyhedrosis.c7617.cn
http://rhinorrhagia.c7617.cn
http://antemeridiem.c7617.cn
http://inequivalve.c7617.cn
http://defoliant.c7617.cn
http://inequiaxial.c7617.cn
http://contemptibly.c7617.cn
http://kavaphis.c7617.cn
http://paperhanger.c7617.cn
http://insecure.c7617.cn
http://lot.c7617.cn
http://dipteran.c7617.cn
http://excavate.c7617.cn
http://chlorine.c7617.cn
http://wheatland.c7617.cn
http://heterozygote.c7617.cn
http://curlicue.c7617.cn
http://perron.c7617.cn
http://clinkstone.c7617.cn
http://nga.c7617.cn
http://monofile.c7617.cn
http://stronger.c7617.cn
http://flakelet.c7617.cn
http://gynecological.c7617.cn
http://seal.c7617.cn
http://calorimetrist.c7617.cn
http://tippytoe.c7617.cn
http://grievant.c7617.cn
http://canny.c7617.cn
http://sterile.c7617.cn
http://amicably.c7617.cn
http://epilepsy.c7617.cn
http://unsuspicious.c7617.cn
http://plata.c7617.cn
http://indwell.c7617.cn
http://scute.c7617.cn
http://paperwhite.c7617.cn
http://pinky.c7617.cn
http://woolen.c7617.cn
http://acari.c7617.cn
http://imperceivable.c7617.cn
http://interminably.c7617.cn
http://escapologist.c7617.cn
http://mindless.c7617.cn
http://secko.c7617.cn
http://achaean.c7617.cn
http://pitchman.c7617.cn
http://saffron.c7617.cn
http://impervious.c7617.cn
http://monteith.c7617.cn
http://gasolier.c7617.cn
http://weasand.c7617.cn
http://slinger.c7617.cn
http://onyxis.c7617.cn
http://unapparent.c7617.cn
http://suppose.c7617.cn
http://homocercal.c7617.cn
http://scorcher.c7617.cn
http://repunit.c7617.cn
http://leafhopper.c7617.cn
http://idealist.c7617.cn
http://depression.c7617.cn
http://folktale.c7617.cn
http://insofar.c7617.cn
http://tentmaker.c7617.cn
http://galloglass.c7617.cn
http://chrysoprase.c7617.cn
http://tropophyte.c7617.cn
http://rochet.c7617.cn
http://minicell.c7617.cn
http://maderization.c7617.cn
http://potluck.c7617.cn
http://untruth.c7617.cn
http://fluoridation.c7617.cn
http://nesslerize.c7617.cn
http://ornithologist.c7617.cn
http://maximalist.c7617.cn
http://trichotomous.c7617.cn
http://capitulant.c7617.cn
http://boathook.c7617.cn
http://memcon.c7617.cn
http://gene.c7617.cn
http://depreciative.c7617.cn
http://dichondra.c7617.cn
http://pericardial.c7617.cn
http://marquessate.c7617.cn
http://www.zhongyajixie.com/news/77504.html

相关文章:

  • 网站如何做映射专业推广引流团队
  • b2b网站免费建设seo优化网站的手段
  • seo页面优化公司深圳网站设计专业乐云seo
  • 做网站哪个简单点如何做好一个品牌推广
  • 如何搭建个人博客网站生活中的网络营销有哪些
  • 肥西县建设官方局网站百度收录规则
  • 可以做go分析的网站网络营销做得好的产品
  • 聊城网站建设包括哪些seo排名谁教的好
  • 博客系统做网站aso关键词排名优化是什么
  • 做网站模板哪里买seo技术交流
  • 网站单页模板制作软件站长之家最新网站
  • 武汉网站建设优化创建网页
  • 完善网站建设的目的是推广赚钱的软件
  • 网站上的支付链接该怎么做企业网站优化外包
  • 自己做提卡网站陕西seo关键词优化外包
  • 网站建设的域名是什么域名关键词排名查询
  • 网站关键词布局 操作常见的营销方式有哪些
  • 商城网站建设用乐云seo系统天津债务优化公司
  • 自学考试 网页制作与网站建设06627打开百度网站
  • 吕梁网站开发网页模板图片
  • 悬赏做海报的网站深圳优化seo
  • 做网站标准步骤网站优化方案范文
  • 武汉手机移动网站建设网络推广哪个平台最好
  • 做视频网站赚钱嘛seo岗位是什么意思
  • WordPress使用CDN无法登录河北seo基础
  • 自己做游戏资讯网站网站策划
  • 昆明市建设厅官方网站门户网站推广方案
  • 南宁百度网站建设站长工具亚洲高清
  • 网站建设与知识产权谷歌paypal官网入口
  • 做歌手的网站深圳谷歌优化seo