/com ### this macro concatenates 2 to 7 strings and removes all blanks and then
/com ### saves it into the variable which was given as arg1 (in quotes)/com ### arguments: arg1 = variable name into which the result is stored, put in quotes
/com ### arguments: arg2 = total number of single strings to be concatenated
/com ### arguments: arg3 through arg9 = single string in quotes, e.g. arg3='an '/com ### attention: depending on the length of a single input string and/or the length
/com ### of the resulting string, the final string ztstring1 may differ from what
/com ### was desired, as the total length is somewhat restricted (approx 31 characters???)/com ### example: << txtconcat,'mychar',2,'an ',' sys' >> would result in mychar='ansys'
/com ### created 2009-01-12 by Martin Herrenbruck
/com ### using Ansys 11.0 (classic)!----------------------------------------------------------------------------!
! concatenate successively each string with the previous ones
!----------------------------------------------------------------------------!*if,arg2,lt,8,then
*set,ztstring1_,arg3 ! collect first string
*do,ztcounter_, 4, arg2 + 2, 1 ! collect second to max. seventh string
*set,ztstring3_,'arg %ztcounter_%' ! results in 'arg 4' or 'arg 5' or 'arg 6' and so on
*set,ztstring3_,strcomp(ztstring3_) ! remove all blanks, so we have 'arg4' or 'arg5' or 'arg6' and so on
*set,ztstring2_,%ztstring3_% ! save the contents of 'arg4' or 'arg5' and so on as char into ztstring2_
*set,ztstring1_,'%ztstring1_% %ztstring2_%' ! concatenate with previous
*enddo
*set,%arg1%,strcomp(ztstring1_) ! remove all blanks from the string
*endif!----------------------------------------------------------------------------!
! print result on the output window
!----------------------------------------------------------------------------!
/gopr
*vwrite, '### macro ','txtconcat says:',' the characterstring ',arg1
%11c %15c %20c %33c
/com ### was saved into variable %arg1%
/com ### end of macro " txtconcat.mac"
/eof
相关文章
- 2021-09-08BIM技术丛书Revit软件应用系列Autodesk Revit族详解 [
- 2021-09-08全国专业技术人员计算机应用能力考试用书 AutoCAD2004
- 2021-09-08EXCEL在工作中的应用 制表、数据处理及宏应用PDF下载
- 2021-08-30从零开始AutoCAD 2014中文版机械制图基础培训教程 [李
- 2021-08-30从零开始AutoCAD 2014中文版建筑制图基础培训教程 [朱
- 2021-08-30电气CAD实例教程AutoCAD 2010中文版 [左昉 等编著] 20
- 2021-08-30电影风暴2:Maya影像实拍与三维合成攻略PDF下载
- 2021-08-30高等院校艺术设计案例教程中文版AutoCAD 建筑设计案例
- 2021-08-29环境艺术制图AutoCAD [徐幼光 编著] 2013年PDF下载
- 2021-08-29机械AutoCAD 项目教程 第3版 [缪希伟 主编] 2012年PDF