{"id":1452,"date":"2014-12-12T20:24:36","date_gmt":"2014-12-12T12:24:36","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=1452"},"modified":"2014-12-12T20:35:24","modified_gmt":"2014-12-12T12:35:24","slug":"qmacros%e9%80%9f%e5%ba%a6%e7%ae%80%e5%8d%95%e8%af%84%e6%b5%8b","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=1452","title":{"rendered":"QMacros\u901f\u5ea6\u7b80\u5355\u8bc4\u6d4b"},"content":{"rendered":"<h4>\u3010\u6d4b\u8bd5\u8bf4\u660e\u3011<\/h4>\n<p>\u672c\u6d4b\u8bd5\u53ea\u662f\u5bf9QMacros\u7684\u6027\u80fd\u505a\u4e00\u4e2a\u7b80\u5355\u7684\u8bc4\u4ef7\uff0c\u4ece\u800c\u7ed9\u51fa\u4e00\u5b9a\u7684\u5efa\u8bae\u3002\u53d7\u9650\u4e8e\u6d4b\u8bd5\u7528\u4f8b\u7684\u8bbe\u8ba1\u65e0\u6cd5\u8986\u76d6\u5404\u79cd\u60c5\u51b5\uff0c\u8fd9\u4e9b\u5efa\u8bae\u672a\u5fc5\u4e00\u5b9a\u53ef\u9760\uff0c\u9700\u8981\u60a8\u81ea\u5df1\u8fdb\u884c\u4e00\u5b9a\u7684\u8fdb\u4e00\u6b65\u6d4b\u8bd5\u3002<\/p>\n<h4>\u3010\u6d4b\u8bd5\u7528\u4f8b\u3011<\/h4>\n<p>\u672c\u6b21\u6d4b\u8bd5\u4e3b\u8981\u5bf9\u6bd4\u7684\u662f\u7cfb\u7edf\u81ea\u5e26\u7684StringReplace\u548cQDAC\u4e2dQString\u63d0\u4f9b\u7684StringReplaceW\u3002\u4ece\u7406\u8bba\u4e0a\u6765\u8bf4\uff0cQMacros\u66f4\u590d\u6742\uff0c\u9002\u7528\u8303\u56f4\u4e5f\u66f4\u5e7f\u4e00\u4e9b\uff0c\u4e24\u4e2aStringReplace\u51fd\u6570\u5f88\u660e\u663e\u66f4\u9002\u7528\u4e8e\u5c11\u91cf\u5339\u914d\u6a21\u5f0f\u65f6\u4f7f\u7528\u3002\u5982\u679c\u9700\u8981\u5339\u914d\u548c\u66ff\u6362\u7684\u6a21\u5f0f\u6bd4\u8f83\u591a\uff0c\u524d\u4e24\u8005\u5c06\u7531\u4e8e\u9700\u8981\u91cd\u590d\u7684\u5168\u6587\u626b\u63cf\u800c\u9020\u6210\u6027\u80fd\u4e0a\u4e0eQMacros\u6709\u4e25\u91cd\u7684\u5dee\u8ddd\u3002\u8fd9\u5728\u540e\u9762\u7684\u7ed3\u679c\u4e2d\u6211\u4eec\u4e5f\u53ef\u4ee5\u770b\u5230\u8fd9\u4e00\u70b9\u3002<\/p>\n<p>\u7b2c\u4e00\u4e2a\u6d4b\u8bd5\u7528\u4f8b\uff1a\u662f\u5c0620\u4e2a \u201c%Year%\u201d \u6784\u6210\u7684\u5b57\u7b26\u4e32\u5206\u522b\u66ff\u6362\u4e3a 2014 \u8fd9\u4e2a\u503c\u3002<\/p>\n<p>\u7b2c\u4e8c\u4e2a\u6d4b\u8bd5\u7528\u4f8b\uff1a\u662f\u5c0620\u4e2a \u201c%Now%\u201d \u6784\u6210\u7684\u5b57\u7b26\u4e32\u5206\u522b\u66ff\u6362\u4e3a\u5f53\u524d\u65f6\u95f4\u3002<\/p>\n<p>\u7b2c\u4e09\u4e2a\u6d4b\u8bd5\u7528\u4f8b\uff1a\u662f\u5c0620\u4e2a \u201c%Year% %Month% %Now%\u201d \u6784\u6210\u7684\u5b57\u7b26\u4e32\u66ff\u6362\u6389\u3002<\/p>\n<p>\u7b2c\u56db\u4e2a\u6d4b\u8bd5\u7528\u4f8b\uff1a\u662f\u5c06 \u201c%Macro1%\u201d ~ \u201c%Macro20\u201d \u00a0\u62fc\u63a5\u6210\u7684\u5b57\u7b26\u4e32\u4e2d\u7684\u00a0\u201c%Macro1%\u201d ~ \u201c%Macro20\u201d \u00a0\u5168\u90e8\u66ff\u6362\u62102014\u3002<\/p>\n<p>\u7b2c\u4e94\u4e2a\u6d4b\u8bd5\u7528\u4f8b\uff1a\u8fd8\u662f\u4e0a\u9762\u7684\u5b57\u7b26\u4e32\uff0c\u5206\u522b\u4ee5%\u548c\u4e0d\u8bbe\u5b9a\u5206\u9694\u7b26\u7684\u65b9\u5f0f\uff0c\u4f7f\u7528QMacros\u6765\u8fdb\u884c\u7b80\u5355\u66ff\u6362\u5bf9\u6bd4\uff0c\u4ece\u800c\u4e3a\u5927\u5bb6\u505a\u4e00\u4e0b\u6709\u548c\u6ca1\u6709\u5206\u9694\u7b26\u65f6\u5e26\u6765\u7684\u5f71\u54cd\u3002\u5f53\u7136\uff0c\u5982\u679c\u662f\u4e00\u6b21\u7f16\u8bd1\uff0c\u591a\u6b21\u66ff\u6362\u7684\u60c5\u51b5\u4e0b\uff0c\u4e24\u8005\u4e4b\u95f4\u7684\u7531\u4e8e\u7f16\u8bd1\u8fc7\u7a0b\u5f15\u7528\u7684\u6027\u80fd\u5dee\u8ddd\uff0c\u6211\u4e2a\u4eba\u8ba4\u4e3a\u8fd8\u662f\u53ef\u4ee5\u5ffd\u7565\u4e0d\u8ba1\u7684\u3002<\/p>\n<p>\u4e0a\u9762\u76845\u4e2a\u6d4b\u8bd5\u7528\u4f8b\u90fd\u662f\u6267\u884c10\u4e07\u6b21\uff0c\u6765\u7edf\u8ba1\u65f6\u95f4\u3002<\/p>\n<h4>\u3010\u6d4b\u8bd5\u7ed3\u679c\u3011<\/h4>\n<p><a href=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QQ\u622a\u56fe20141212203501.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1459 size-full\" src=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QQ\u622a\u56fe20141212203501.jpg\" alt=\"QQ\u622a\u56fe20141212203501\" width=\"610\" height=\"507\" srcset=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QQ\u622a\u56fe20141212203501.jpg 610w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QQ\u622a\u56fe20141212203501-300x249.jpg 300w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>\u9996\u5148\u770b\u524d4\u4e2a\u7528\u4f8b\u7684\u6d4b\u8bd5\u7ed3\u679c\u5bf9\u6bd4\uff1a<\/p>\n<p><a href=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QMacroCompare.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1454 size-full\" src=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QQ\u622a\u56fe20141212200233.jpg\" alt=\"QQ\u622a\u56fe20141212200233\" width=\"513\" height=\"169\" srcset=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QQ\u622a\u56fe20141212200233.jpg 513w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QQ\u622a\u56fe20141212200233-300x98.jpg 300w\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u8f6c\u6362\u6210\u67f1\u72b6\u56fe\u6765\u770b\uff1a<\/p>\n<p><a href=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QMacroCompare.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1453 size-full\" src=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QMacroCompare.jpg\" alt=\"QMacroCompare\" width=\"834\" height=\"305\" srcset=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QMacroCompare.jpg 834w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QMacroCompare-300x109.jpg 300w\" sizes=\"auto, (max-width: 834px) 100vw, 834px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u7136\u540e\u7b2c5\u79cd\u6d4b\u8bd5\u7528\u4f8b\u7684\u5bf9\u6bd4\u7ed3\u679c\uff1a<\/p>\n<p><a href=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QQ\u622a\u56fe20141212200341.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1455 size-full\" src=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QQ\u622a\u56fe20141212200341.jpg\" alt=\"QQ\u622a\u56fe20141212200341\" width=\"625\" height=\"192\" srcset=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QQ\u622a\u56fe20141212200341.jpg 625w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QQ\u622a\u56fe20141212200341-300x92.jpg 300w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/12\/QQ\u622a\u56fe20141212200341-240x75.jpg 240w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h4>\u3010\u7ed3\u679c\u5206\u6790\u3011<\/h4>\n<p>1\u3001\u7528\u4f8b1\u7531\u4e8e%Year%\u662f\u4e00\u4e2amvImmutable\u7c7b\u578b\u7684\u503c\uff0c\u6240\u4ee5QMacros\u5b9e\u9645\u4e0a\u68c0\u6d4b\u5230\u65e0\u8bba\u6267\u884c\u591a\u5c11\u6b21\u66ff\u6362\uff0c\u7ed3\u679c\u4e0d\u4f1a\u6709\u4efb\u4f55\u53d8\u5316\uff0c\u6240\u4ee5\u76f4\u63a5\u7f13\u5b58\u4e86\u7b2c\u4e00\u6b21\u7684\u66ff\u6362\u7ed3\u679c\uff0c\u540e\u9762\u768499999\u6b21\u66ff\u6362\u90fd\u76f4\u63a5\u8fd4\u56de\u4e86\u7f13\u5b58\u7684\u503c\uff0c\u800c\u4e0d\u662f\u8c61StringReplace\u548cStringReplaceW\u4e00\u6837\uff0c\u50bb\u50bb\u7684\u5b9e\u9645\u66ff\u636210\u4e07\u6b21\u3002\u6240\u4ee5\u5728\u6267\u884c10\u4e07\u6b21\u6548\u7387\u8fdc\u8d85\u8fc7\u53e6\u5916\u4e24\u8005\u3002<\/p>\n<p>2\u3001\u7528\u4f8b2\u7531\u4e8e%Now%\u662f\u4e00\u4e2amvStable\u7c7b\u578b\u7684\u503c\uff0c\u6240\u4ee5\u5b9e\u9645\u4e0aQMacros\u4e5f\u4f1a\u6267\u884c10\u4e07\u6b21\u5b9e\u9645\u7684\u66ff\u6362\u5e76\u6bcf\u6b21\u66ff\u6362\u65f6\uff0c\u8c03\u7528\u51fd\u6570\u83b7\u53d6Now\u8fd9\u4e2a\u5b8f\u7684\u503c\uff0c\u56e0\u6b64\uff0c\u5176\u5f00\u9500\u8981\u6bd4\u7b2c\u4e00\u79cd\u60c5\u51b5\u5927\u7684\u591a\u3002\u901f\u5ea6\u4e5f\u663e\u7136\u5c31\u4f1a\u6709\u6240\u4e0b\u964d\u3002\u4f46\u7531\u4e8e\u76f8\u5e94\u7684\u4f18\u5316\uff0c\u6bd4\u7cfb\u7edf\u81ea\u5e26\u7684StringReplace\u4ecd\u8981\u9ad8\u6548\u7684\u591a\uff0c\u5bf9\u6bd4QString\u7684StringReplaceW\uff0c\u5219\u660e\u663e\u5904\u4e8e\u4e0b\u98ce\u3002<\/p>\n<p>3\u3001\u7528\u4f8b3\u7531\u4e8e\u5f15\u5165\u4e863\u4e2a\u9700\u8981\u66ff\u6362\u7684\u5b8f\uff0c\u6240\u4ee5\uff0cStringReplace\u548cStringReplaceW\u90fd\u9700\u8981\u6267\u884c\u4e09\u6b21\u66ff\u6362\u64cd\u4f5c\uff0c\u4ee5\u5b8c\u6210\u66ff\u6362\u6240\u6709\u7684\u5b8f\u3002StringReplace\u5728\u6b64\u6027\u80fd\u5df2\u7ecf\u4e0d\u582a\u5165\u76ee\u4e86\uff0cStringReplaceW\u548cQMacros\u4e4b\u95f4\u7684\u6027\u80fd\u5dee\u8ddd\u5728\u7f29\u5c0f\u3002<\/p>\n<p>4\u3001\u7528\u4f8b4\u7531\u4e8e\u5f15\u5165\u4e8620\u4e2a\u9700\u8981\u66ff\u6362\u7684\u5b8f\uff0c\u6240\u4ee5StringReplace\u548cStringReplaceW\u90fd\u9700\u8981\u6267\u884c20\u6b21\u66ff\u6362\u64cd\u4f5c\uff0c\u4ee5\u5b8c\u6210\u66ff\u6362\u6240\u6709\u7684\u5b8f\u3002StringReplace\u7684\u6027\u80fd\u5dee\u8ddd\u8fdb\u4e00\u6b65\u88ab\u62c9\u5927\uff0cStringReplaceW\u4e5f\u5df2\u7ecf\u88abQMacros\u8fdc\u8fdc\u7684\u7529\u5728\u4e86\u540e\u9762\u3002<\/p>\n<p>5\u3001\u7528\u4f8b5\u4e2d\uff0c\u7531\u4e8e\u65e0\u5206\u9694\u7b26\u65f6\uff0c\u8981\u5224\u5b9a\u6bcf\u4e2a\u5b57\u7b26\u8d77\u59cb\u4f4d\u7f6e\u662f\u5426\u662f\u5206\u9694\u7b26\u7684\u65b9\u5f0f\u8981\u6bd4\u6709\u5206\u9694\u7b26\u7684\u65b9\u5f0f\u590d\u6742\u7684\u591a\uff0c\u7531\u6b64\u5f15\u5165\u4e86\u989d\u5916\u7684\u5f00\u9500\uff0c\u6240\u4ee5\u9020\u6210\u6027\u80fd\u4e0a\u7684\u5dee\u8ddd\u3002<\/p>\n<h4>\u3010\u7ed3\u8bba\u3011<\/h4>\n<p>\u53ef\u80fd\u5927\u5bb6\u6ce8\u610f\u5230\u4e86\uff0c\u7528\u4f8b4\u6bd4\u7528\u4f8b3 QMacros \u7528\u7684\u65f6\u95f4\u66f4\u5c11\uff0c\u8fd9\u662f\u7531\u4e8e\u76f8\u5e94\u7684\u51fd\u6570\u5b9e\u73b0\u7684\u4e0d\u540c\u5f15\u8d77\u7684\u3002\u7528\u4f8b4\u76f4\u63a5\u8fd4\u56de\u4e862014\u8fd9\u4e2a\u503c\uff0c\u800c\u7528\u4f8b3\u9700\u8981\u683c\u5f0f\u5316\u5f53\u524d\u65f6\u95f4\u8fd4\u56de\u3002<\/p>\n<p>\u7efc\u5408\u4e0a\u9762\u7684\u6d4b\u8bd5\u7ed3\u679c\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c\u968f\u7740\u9700\u8981\u66ff\u6362\u7684\u5185\u5bb9\u7684\u590d\u6742\uff0cQMacros\u5e26\u6765\u7684\u6027\u80fd\u4f18\u52bf\u8d8a\u6765\u8d8a\u660e\u663e\u3002\u5982\u679c\u53ea\u662f\u4e00\u4e24\u4e2a\u5b8f\u7684\u76f4\u63a5\u66ff\u6362\uff0c\u7528QString\u63d0\u4f9b\u7684StringReplaceW\u5c06\u662f\u4e0d\u4e8c\u7684\u9009\u62e9\uff0c\u4f46\u5982\u679c\u4ece\u6613\u4e8e\u7406\u89e3\u548c\u4ee3\u7801\u7edf\u4e00\u7684\u89d2\u5ea6\uff0cQMacros\u663e\u793a\u662f\u6a21\u677f\u66ff\u6362\u7684\u4e0d\u4e8c\u9009\u62e9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u6d4b\u8bd5\u8bf4\u660e\u3011 \u672c\u6d4b\u8bd5\u53ea\u662f\u5bf9QMacros [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[69,8,9,214],"tags":[231,229,230],"class_list":["post-1452","post","type-post","status-publish","format-standard","hentry","category-c-builder","category-delphi","category-qdac","category-qmacros","tag-231","tag-229","tag-230"],"views":5060,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/1452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1452"}],"version-history":[{"count":3,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/1452\/revisions"}],"predecessor-version":[{"id":1460,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/1452\/revisions\/1460"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}