从多个复选框中评估变量的结果 [英] Evaluating result of a variable from multiple checkboxes

查看:36
本文介绍了从多个复选框中评估变量的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个例程,可以在目录结构中搜索文件。现在文件模式只是*。*,当它完成时,我有一个清理例程,它删除了我不想要的文件扩展名(* .m3u,以及例程将标记为''未知的文件'')


我想做的是根据用户的选择使用可接受的文件扩展名填充变量。


For例如,我设置了四个复选框,每个复选框都是不同类型的文件(即音频,视频等)。


每种类型都有一个复选框。如何根据复选框的选择填充变量(ScanExt)。因此,如果用户仅选择音频,则变量可能会读取* .mp3,* .wma,如果他们选择音频和视频(那么它将读取* .mp3,* .wma,* .wmv,* .avi。


有没有人对我如何实现这个有任何建议?


谢谢,

CJ

解决方案

将它放在表单模块的顶部

展开 | 选择 | 换行 | 行号


< blockquote>我看到这是试图实现的,它正在工作但只是部分。

我在frt上遇到很多错误h关于为空的复选框,如果关闭音频选项,它就不能正常工作。


我的代码如下:

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号


我不得不调整第一个,尝试正确的格式化,但这似乎也没有。

I have a routine that searches a directory structure for files. Right now the file pattern is simply *.* and when it is finished, I have a cleanup routine that strips out the file extensions that I don''t want (*.m3u, and files which the routine will flag as ''unknown'')

What I would like to do is to populate a variable with the acceptable file extensions based on the users choice.

For example, I setup four checkboxes, each a different type of file (i.e., audio, video, etc.)

Each type has a checkbox. How can I populate a variable (ScanExt) based on the slection of checkboxes. So if the user chose only audio, the variable might read *.mp3, *.wma, and if they chose audio and video (then it would read *.mp3, *.wma, *.wmv, *.avi.

Does anyone have any suggestions on how I might acheive this?

Thanks,
CJ

解决方案

Put this at the top of your forms module

Expand|Select|Wrap|Line Numbers


I see what this is trying to achieve and it is working but only partially.
I get lots of errors on the fourth check box about being null, and it doesn''t quite work if the audio option gets turned off.

I have the code below:

Expand|Select|Wrap|Line Numbers


I had to tweak the first one, to try and get the formatting right, but that doesn''t seem to to the trick either.


这篇关于从多个复选框中评估变量的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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