找回密码
 加入
搜索
楼主: 131738

[AU3基础] (已解决)请 afan 帮助修改正则替换代码, 谢谢!

 火... [复制链接]
 楼主| 发表于 2012-3-15 23:27:21 | 显示全部楼层
回复 23# afan

我的替换脚本用于au3文档一直没有问题,
只是这次用于 APIEx 出现这个问题,应该不是普遍现象,看来只能手动修改这个偶然错误了
发表于 2012-3-15 23:31:58 | 显示全部楼层
回复 31# 131738


    你的同一文件在数组中的元素是连续的吗?
 楼主| 发表于 2012-3-15 23:34:29 | 显示全部楼层
回复  131738


    你的数组是如何定义的?
如果 $aWinAPIEx[$x][2] 只需要查找 $aWinAPIEx[$x][0] 替 ...
afan 发表于 2012-3-15 23:24


5 的文件的, 空行分隔:
Global $aWinAPIEx[8889][3]
$aWinAPIEx[0][0] = 'Closes and discards any paths in the specified device context.'
$aWinAPIEx[0][1] = '关闭和删除指定设备环境的任何路径.'
$aWinAPIEx[0][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AbortPath.txt'
$aWinAPIEx[1][0] = '        Handle to the device context from which a path will be discarded.'
$aWinAPIEx[1][1] = '        目标设备环境句柄.'
$aWinAPIEx[1][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AbortPath.txt'
$aWinAPIEx[2][0] = 'Success:        1.'
$aWinAPIEx[2][1] = '成功:        返回 1.'
$aWinAPIEx[2][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AbortPath.txt'
$aWinAPIEx[3][0] = 'Failure:        0 and sets the @error flag to non-zero.'
$aWinAPIEx[3][1] = '失败:        返回 0, @error 设置为非 0 值.'
$aWinAPIEx[3][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AbortPath.txt'

$aWinAPIEx[4][0] = 'Displays a Windows About dialog box.'
$aWinAPIEx[4][1] = '显示 Windows 系统"关于"对话框.'
$aWinAPIEx[4][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AboutDlg.txt'
$aWinAPIEx[5][0] = '        The title of the Windows About dialog box.'
$aWinAPIEx[5][1] = '        "关于"对话框的窗口标题.'
$aWinAPIEx[5][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AboutDlg.txt'
$aWinAPIEx[6][0] = '        The first line after the text "Microsoft".'
$aWinAPIEx[6][1] = '        显示在对话框第一行 "Microsoft" 后面的文本.'
$aWinAPIEx[6][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AboutDlg.txt'
$aWinAPIEx[7][0] = '        The text to be displayed in the dialog box after the version and copyright information.'
$aWinAPIEx[7][1] = '        显示在对话框版权和授权信息之间的文本.'
$aWinAPIEx[7][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AboutDlg.txt'
$aWinAPIEx[8][0] = '        [optional] Handle to the icon that the function displays in the dialog box.'
$aWinAPIEx[8][1] = '        [可选参数] 对话框显示图标的句柄.'
$aWinAPIEx[8][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AboutDlg.txt'
$aWinAPIEx[9][0] = '        [optional] Handle to a parent window.'
$aWinAPIEx[9][1] = '        [可选参数] 父窗口句柄.'
$aWinAPIEx[9][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AboutDlg.txt'
$aWinAPIEx[10][0] = 'Success:        1.'
$aWinAPIEx[10][1] = '成功:        返回 1.'
$aWinAPIEx[10][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AboutDlg.txt'
$aWinAPIEx[11][0] = 'Failure:        0 and sets the @error flag to non-zero.'
$aWinAPIEx[11][1] = '失败:        返回 0, @error 设置为非 0 值.'
$aWinAPIEx[11][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AboutDlg.txt'

$aWinAPIEx[12][0] = 'Sets the input locale identifier for the calling thread or the current process.'
$aWinAPIEx[12][1] = '设置调用线程或当前进程的输入法区域设置标识符.'
$aWinAPIEx[12][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_ActivateKeyboardLayout.txt'
$aWinAPIEx[13][0] = '        The input locale identifier to be activated. This parameter must be either the handle to a keyboard'
$aWinAPIEx[13][1] = '        被激活的输入法区域标识符'
$aWinAPIEx[13][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_ActivateKeyboardLayout.txt'
$aWinAPIEx[14][0] = '        layout or one of the following values.'
$aWinAPIEx[14][1] = '        布局或下列值之一:'
$aWinAPIEx[14][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_ActivateKeyboardLayout.txt'
$aWinAPIEx[15][0] = '        $HKL_NEXT'
$aWinAPIEx[15][1] = '        $HKL_NEXT --- 系统区域标识符列表中的下一个区域标识符.'
$aWinAPIEx[15][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_ActivateKeyboardLayout.txt'
$aWinAPIEx[16][0] = '        $HKL_PREV'
$aWinAPIEx[16][1] = '        $HKL_PREV --- 系统区域标识符列表中的前一个区域标识符.'
$aWinAPIEx[16][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_ActivateKeyboardLayout.txt'
$aWinAPIEx[17][0] = '        [optional] The flag that specifies how the input locale identifier is to be activated. This parameter can be'
$aWinAPIEx[17][1] = '        [可选参数] 指定如何激活输入法区域标识符.'
$aWinAPIEx[17][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_ActivateKeyboardLayout.txt'
$aWinAPIEx[18][0] = '        one of the following values.'
$aWinAPIEx[18][1] = '        可以是以下值之一:'
$aWinAPIEx[18][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_ActivateKeyboardLayout.txt'
$aWinAPIEx[19][0] = '        $KLF_REORDER'
$aWinAPIEx[19][1] = '        $KLF_REORDER --- 系统区域标识符列表重新排序, 并将激活的区域标识符置于顶部.'
$aWinAPIEx[19][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_ActivateKeyboardLayout.txt'
$aWinAPIEx[20][0] = '        $KLF_RESET'
$aWinAPIEx[20][1] = '        $KLF_RESET --- 如设置此项而未设置 KLF_SHIFTLOCK, 则 Caps Lock 状态为打开; 如同时设置 KLF_SHIFTLOCK, 则 Caps Lock 状态为按 Shift 键关闭.'
$aWinAPIEx[20][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_ActivateKeyboardLayout.txt'
$aWinAPIEx[21][0] = '        $KLF_SETFORPROCESS'
$aWinAPIEx[21][1] = '        $KLF_SETFORPROCESS --- 为全部进程指定区域标识符, 并发送 WM_INPUTLANGCHANGE 消息到当前线程或活动窗口.'
$aWinAPIEx[21][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_ActivateKeyboardLayout.txt'
$aWinAPIEx[22][0] = '        $KLF_SHIFTLOCK'
$aWinAPIEx[22][1] = '        $KLF_SHIFTLOCK -- 用于 KLF_RESET. 见 KLF_RESET 的解释.'
$aWinAPIEx[22][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_ActivateKeyboardLayout.txt'
$aWinAPIEx[23][0] = 'Success:        The previous input locale identifier.'
$aWinAPIEx[23][1] = '成功:        返回先前的输入法区域标识符.'
$aWinAPIEx[23][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_ActivateKeyboardLayout.txt'
$aWinAPIEx[24][0] = 'Failure:        0 and sets the @error flag to non-zero.'
$aWinAPIEx[24][1] = '失败:        返回 0, @error 设置为非 0 值.'
$aWinAPIEx[24][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_ActivateKeyboardLayout.txt'
$aWinAPIEx[25][0] = 'Places the given window in the system-maintained clipboard format listener list.'

$aWinAPIEx[25][1] = '将特定窗口放到系统维护剪贴板格式侦听器列表.'
$aWinAPIEx[25][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddClipboardFormatListener.txt'
$aWinAPIEx[26][0] = '        Handle to the window to be placed.'
$aWinAPIEx[26][1] = '        特定窗口的句柄.'
$aWinAPIEx[26][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddClipboardFormatListener.txt'
$aWinAPIEx[27][0] = 'Success:        1.'
$aWinAPIEx[27][1] = '成功:        返回 1.'
$aWinAPIEx[27][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddClipboardFormatListener.txt'
$aWinAPIEx[28][0] = 'Failure:        0 and sets the @error flag to non-zero.'
$aWinAPIEx[28][1] = '失败:        返回 0, @error 设置为非 0 值.'
$aWinAPIEx[28][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddClipboardFormatListener.txt'
$aWinAPIEx[29][0] = 'This function requires Windows Vista or later.'
$aWinAPIEx[29][1] = '此函数需要 Windows Vista 或更高版本系统.'
$aWinAPIEx[29][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddClipboardFormatListener.txt'

$aWinAPIEx[30][0] = 'Adds the font resource from a memory image to the system.'
$aWinAPIEx[30][1] = '添加系统内存映像的字体资源.'
$aWinAPIEx[30][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddFontMemResourceEx.txt'
$aWinAPIEx[31][0] = '        The pointer to a font resource.'
$aWinAPIEx[31][1] = '        字体资源指针.'
$aWinAPIEx[31][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddFontMemResourceEx.txt'
$aWinAPIEx[32][0] = '        The number of bytes in the font resource.'
$aWinAPIEx[32][1] = '        字体资源的字节数.'
$aWinAPIEx[32][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddFontMemResourceEx.txt'
$aWinAPIEx[33][0] = 'Success:        The handle uniquely identifies the fonts that were installed on the system, @extended flag will contain'
$aWinAPIEx[33][1] = '成功:        返回安装到系统的字体句柄.'
$aWinAPIEx[33][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddFontMemResourceEx.txt'
$aWinAPIEx[34][0] = '                a number of fonts added to the system as a result of this call. '
$aWinAPIEx[34][1] = '        @extended 包含函数调用的结果.'
$aWinAPIEx[34][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddFontMemResourceEx.txt'
$aWinAPIEx[35][0] = 'Failure:        0 and sets the @error flag to non-zero.'
$aWinAPIEx[35][1] = '失败:        返回 0, @error 设置为非 0 值.'
$aWinAPIEx[35][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddFontMemResourceEx.txt'
$aWinAPIEx[36][0] = 'This function allows an application to get a font that is embedded in a document or a Web page. A font that is'
$aWinAPIEx[36][1] = '本函数允许应用程序获取文档或网页嵌入的字体.'
$aWinAPIEx[36][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddFontMemResourceEx.txt'
$aWinAPIEx[37][0] = 'added by this is always private to the process that made the call and is not enumerable.'
$aWinAPIEx[37][1] = '添加的字体始终为进程私有调用, 且不枚举.'
$aWinAPIEx[37][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddFontMemResourceEx.txt'
$aWinAPIEx[38][0] = 'When the function succeeds, the caller of this function can free the memory pointed to by $pData because the system'
$aWinAPIEx[38][1] = '当函数成功后,系统产生自己的内存副本, 函数调用者可以释放 $pData 指针指向的内存.'
$aWinAPIEx[38][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddFontMemResourceEx.txt'
$aWinAPIEx[39][0] = 'has made its own copy of the memory. To remove the fonts that were installed, call _WinAPI_RemoveFontMemResourceEx().'
$aWinAPIEx[39][1] = '要删除已安装的字体, 请调用 _WinAPI_RemoveFontMemResourceEx().'
$aWinAPIEx[39][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddFontMemResourceEx.txt'
$aWinAPIEx[40][0] = 'However, when the process goes away, the system will unload the fonts.'
$aWinAPIEx[40][1] = '当进程消失时, 系统会卸载字体.'
$aWinAPIEx[40][2] = @ScriptDir & '\txt2htm\txtlibfunctions\_WinAPI_AddFontMemResourceEx.txt'
发表于 2012-3-15 23:38:28 | 显示全部楼层
回复 33# 131738


    看懂了,是连续的,那就好办了
发表于 2012-3-15 23:38:59 | 显示全部楼层
大叔是为了质量所以每行一个元素吗
 楼主| 发表于 2012-3-15 23:43:59 | 显示全部楼层
回复  131738


    你的同一文件在数组中的元素是连续的吗?
afan 发表于 2012-3-15 23:31


这个不能保证,如果新版本删除整行文本,相对索引空出,
APIEx 如果删除某个函数,则相应空出几个或10多个索引号,如同是添加有新的文本或函数,
我会利用这些空索引号,这样可能同一个函数的描述文本行会分布在不同的索引段!
发表于 2012-3-15 23:45:27 | 显示全部楼层
回复 36# 131738


    那就不好办了
 楼主| 发表于 2012-3-15 23:45:30 | 显示全部楼层
回复  131738


    看懂了,是连续的,那就好办了
afan 发表于 2012-3-15 23:38


有不连续的,看 36 楼
 楼主| 发表于 2012-3-15 23:49:28 | 显示全部楼层
回复  131738


    那就不好办了
afan 发表于 2012-3-15 23:45


劳烦了,只是偶然错误,算了,谢谢!!!
 楼主| 发表于 2012-3-15 23:51:10 | 显示全部楼层
大叔是为了质量所以每行一个元素吗
Ycxw2008 发表于 2012-3-15 23:38


不是质量问题,汉化脚本这样编写的。
发表于 2012-3-15 23:52:36 | 显示全部楼层
回复 38# 131738


    你这样是十分不便于维护的,建议使用配置文件,字段名就是文件路径,关键字是查找项,值是替换项,那样简单极了,维护也简单,增删也完全不会乱套

[txt2htm\txtlibfunctions\_WinAPI_AbortPath.txt]
Handle to the device context from which a path will be discarded.        =目标设备环境句柄.
Success:        1.        = 成功:        返回 1.
Failure:        0 and sets the @error flag to non-zero.        = 失败:        返回 0, @error 设置为非 0 值.
 楼主| 发表于 2012-3-15 23:59:19 | 显示全部楼层
回复  131738


    你这样是十分不便于维护的,建议使用配置文件,字段名就是文件路径,关键字是查找项 ...
afan 发表于 2012-3-15 23:52


利用配置文件?我想想看。。。
发表于 2012-3-16 00:03:40 | 显示全部楼层
各位辛苦了,顶下
发表于 2012-3-16 00:03:52 | 显示全部楼层
回复 42# 131738


    用你现有的数组生成个 ini 配置文件也十分简单
 楼主| 发表于 2012-3-16 00:03:55 | 显示全部楼层
回复 41# afan

配置文件不容易记录失败行,如果记录失败行,好像要用到文件指针吧!这个不懂!
不会捕捉配置文件的行号!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-10 05:59 , Processed in 0.070114 second(s), 13 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表