/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