{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "Hyperlink" -1 17 "" 0 1 0 128 128 1 2 0 1 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 271 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 273 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 274 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 275 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 276 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 277 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 278 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 279 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 280 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 281 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 282 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 283 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 284 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 285 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 286 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 287 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 288 "" 1 10 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 289 "" 1 10 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 290 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 291 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 292 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Error" -1 8 1 {CSTYLE "" -1 -1 "Courier" 1 10 255 0 255 1 2 2 2 2 2 1 1 1 3 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 } {PSTYLE "Maple Output" -1 11 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 3 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Bullet Item " -1 15 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 } 1 1 0 0 3 3 1 0 1 0 2 2 15 2 }{PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 257 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 2" -1 258 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 4 4 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 257 "" 0 "" {TEXT 274 82 "\"code_support' for CLI FFORD, Bigebra, Octonion, GTP, Cliplus, Octonion in Maple 10" }{TEXT -1 242 "\n\n`Copyright 1995-2006 by Rafal Ablamowicz (*) and Bertfried Fauser ($)\n\n(*) Department of Mathematics, Box 5054\n Tennessee Technological University, Cookeville, TN 38505\n Tel: USA (931) 3 72-3569, fax: USA (931) 372-6353\n E-mail: " }{URLLINK 17 "rablamo wicz@tntech.edu" 4 "mailto:rablamowicz@tntech.edu" "" }{TEXT -1 16 " \+ \n URL: " }{URLLINK 17 "http://math.tntech.edu/rafal/Cliff8/" 4 "http://math.tntech.edu/rafal/Cliff8/" "" }{TEXT -1 101 "\n\n($) Uni versit\"at Konstanz, Fachbereich Physik, Fach M678\n 78457 Konstan z, Germany\n E-mail: " }{URLLINK 17 "Bertfried.Fauser@uni-konstanz .de" 4 "mailto:Bertfried.Fauser@uni-konstanz.de" "" }{TEXT -1 11 "\n \+ URL: " }{URLLINK 17 "http://kaluza.physik.uni-konstanz.de/~fauser/ " 4 "http://kaluza.physik.uni-konstanz.de/~fauser/" "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "restart:with(code_support);" }} {PARA 8 "" 1 "" {TEXT -1 129 "Error, (in with) invalid input: with exp ects its 1st argument, pname, to be of type \{package, module\}, but r eceived code_support\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 174 "This help page shows various c ommands and their code of the supplementary package \"code_support\" t hat can be used to manipulate help pages for various packages, for exa mple, " }{HYPERLNK 17 "CLIFFORD" 2 "Clifford,intro" "" }{TEXT -1 32 ". \n\nThis package enables one to:" }}{PARA 0 "" 0 "" {TEXT -1 100 "\n- copy Maple worksheets from one directory to another and make certain string replacements using " }{TEXT 277 16 "change_helpfiles" }{TEXT -1 34 ",\n- change worksheet names using " }{TEXT 278 11 "change_name " }{TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 50 "- copy files from on e directory to another using " }{TEXT 275 9 "copy_file" }{TEXT -1 42 " ,\n- read a Maple worksheet as text using " }{TEXT 279 8 "get_TEXT" } {TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 84 "- read and return names of Maple worksheets located in a specified directory using " }{TEXT 276 7 "get_dir" }{TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 126 "- tak e a list of file names with help topics and insert them automatically \+ into Maple browser and HDB database entries using " }{TEXT 280 16 "ins ert_helppages" }{TEXT -1 54 ",\n- make an automatic list of data entr ies needed by " }{TEXT 285 16 "insert_helppages" }{TEXT -1 7 " using \+ " }{TEXT 281 8 "makeLIST" }{TEXT -1 46 ",\n- modify a list of data en tries created by " }{TEXT 286 8 "makeLIST" }{TEXT -1 7 " using " } {TEXT 282 10 "modifyLIST" }{TEXT -1 55 ",\n- replace certain strings \+ in Maple worksheets using " }{TEXT 283 15 "replace_in_file" }{TEXT -1 55 ",\n- split file names into a sequence of strings using " }{TEXT 284 5 "split" }{TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 62 "- conver t directory names listed as symbols to strings using " }{TEXT 290 34 " `convert/symbol_dir_to_string_dir`" }{TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 77 "- convert back directory name from a string format to a \+ symbol format using " }{TEXT 291 34 "`convert/string_dir_to_symbol_dir `" }{TEXT -1 51 ".\n\nFor examples how these commands can be used see \+ " }{HYPERLNK 17 "examples of code_support" 2 "code_support,examples" " " }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 24 "\nLeipzig, July 22, 2 006\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 506 "################# ################################################################\n### \+ It is assumed that directories can be entered either as strings:\n### \+ (a) In Windows: \"C:\\\\Maple10\\\\Clifford\\\\Help_10_New\\\\\"\n## # (b) In Linux: \"/home/fauser/BIG_ALL/P10/Clifford/Help_10_New/\" \n###\n### or as symbols:\n### (c) In Windows: `D:\\\\Bigebra/Help_B igebra/`\n### (d) In Linux: `/home/fauser/BIG_ALL/Help_Bigebra/`\n ###################################################################### ########### \010 \n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 241 "code_support: =module()\nexport split,copy_file,get_dir,change_name,replace_in_file, change_helpfiles,get_TEXT,\n makeLIST,modifyLIST,insert_helppage s,NamesInLibrary; \nlocal setup;\noption package, load=setup:\n####### ######################\n" }}{PARA 0 "" 0 "" {TEXT -1 13 "1. Procedure \+ " }{TEXT 292 14 "NamesInLibrary" }{TEXT -1 101 " gives names of progra ms stored in the library specified as the argument. It gives names as \+ strings.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 399 "NamesInLibrary:=proc (lib) local e,L;\n###############################################\nopt ions `Copyright (c) 2002-2006 by Rafal Ablamowicz and Bertfried Fauser . All rights reserved.`;\ndescription `Last revised: July 22, 2006`;\n ###############################################\n L:=march('list',lib ):\n for e in L do \n if SearchText(\":\",e[1],1..1)=0 then print( e[1]); \n end if; \n end do:\nend proc:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 13 "2. Procedure " } {TEXT 264 5 "split" }{TEXT -1 188 " takes character pattern \"pat\" an d splits a string into a sequence of substrings remained after removin g \"pat\" from the string. If the pattern does not match, the string i s returned back.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 567 "split:=proc( pat,str)\n local a_seq,a1,x,pos,len,n;\n############################# ##################\noptions `Copyright (c) 2002-2006 by Rafal Ablamowi cz and Bertfried Fauser. All rights reserved.`;\ndescription `Last rev ised: July 22, 2006`;\n############################################### \n a_seq:=NULL;\n a1:=str;\n len:=length(a1);\n pos:=1;\n while(S earchText(pat,a1,pos..len) <>0) do\n n:=SearchText(pat,a1,pos..len) ;\n x:=substring(a1,pos..n-1);\n a_seq:=a_seq,x;\n a1:=substr ing(a1,n+length(pat)..len);\n len:=length(a1);\n od:\n a_seq:=a_s eq,a1;\nend:\n" }}{PARA 0 "" 0 "" {TEXT -1 13 "3. Procedure " }{TEXT 257 9 "copy_file" }{TEXT -1 262 " copies a single file named 'in_file' and located in the directory 'path' as another file called 'out_file' to the same directory.\nThe path can be specified as a symbol, e.g., \+ as `D:\\\\Bigebra/Help_Bigebra/` or as a \"string\", e.g., \"D:\\\\Big ebra\\\\Help_Bigebra\\\\\".\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1249 " copy_file:=proc(path::\{string,symbol\},in_file::\{string,symbol\},out _file::\{string,symbol\}) \n local OUT,line,n_lines,Text,path1,in_fil e1,out_file1;\n###############################################\n opti ons `Copyright (c) 2002-2006 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`;\n description `Last revised: July 22, 2006`; \n###############################################\nif type(path,symbol ) then\n path1:=path;\nelse\n path1:=convert(path,string_dir_to_sy mbol_dir);\nend if;\n###############################################\n if type(in_file,symbol) then\n in_file1:=in_file;\nelse\n in_file1 :=convert(in_file,name);\nend if:\n################################### ############\nif type(out_file,symbol) then\n out_file1:=out_file;\n else\n out_file1:=convert(out_file,name);\nend if:\n################ ###############################\n n_lines:=0;\n Text:=[];\n OUT:=fo pen(cat(path1,out_file1),WRITE,TEXT);\n while true do\n line:=read line(cat(path1,in_file1)); \n if line = 0 then break end if:\n T ext:=[op(Text),line];\n writeline(OUT,line);\n n_lines:=n_lines+ 1;\n end do:\n close(OUT);\nprintf(\"file %s containing %d lines has been copied as file %s in the directory %s\\n\",in_file1,n_lines,out_ file1,path1);\n return;\nend proc:\n" }}{PARA 0 "" 0 "" {TEXT -1 13 " 4. Procedure " }{TEXT 258 7 "get_dir" }{TEXT -1 260 " fetches the *.mw s files from a directory given as an argument and returns file names i n a list of strings. Note that the directory can be specified as a \"s tring\", for example, \"C:\\\\Maple10\\\\P10\\\\test1\\\\\", or as `sy mbol`, for example, `C:\\\\Maple10/P10/test1`.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1245 "get_dir:=proc(dir::\{string,symbol\})\n local wc_l ine,out_list,dir1;\n###############################################\n \+ options `Copyright (c) 2002-2006 by Rafal Ablamowicz and Bertfried Fa user. All rights reserved.`;\n description `Last revised: July 22, 20 06`;\n###############################################\nif type(dir,sym bol) then\n dir1:=convert(dir,symbol_dir_to_string_dir): \nelse\n \+ dir1:=dir:\nend if;\n###############################################\n out_list:=ssystem(cat(\"dir \",dir1));\nif out_list[1] <> 0 then error \"Could not read the directory\" end if:\n########################### ##########\nwc_line:=proc(line::string)\n local c,nw,out,List,item:\n nw := 0;\n out := true;\n List:=[]:\n item:=\"\":\n for c in lin e do\n if c = \" \" or c = \"\\t\" or c = \"\\n\" then\n out : = true;\n if SearchText(`.mws`,item)<>0 then\n List:=[op(L ist),item];\n end if:\n item:=\"\";\n elif out then\n \+ out := false;\n nw:=nw+1;\n item:=eval(cat(item,c));\n \+ else\n item:=eval(cat(item,c));\n end if:\n end do:\n if len gth(item) <> 0 and SearchText(`.mws`,item)<> 0 then \n List:=[op(Li st),item];\n end if:\n return List \nend proc:\n################### ########################\nreturn wc_line(out_list[2])\nend proc:\n" }} {PARA 0 "" 0 "" {TEXT -1 13 "5. Procedure " }{TEXT 259 11 "change_name " }{TEXT -1 355 " changes a name of a file \"filename\" specified as a string by replacing a substring \"substrout\" with a new substring \" substrin\". It returns the name of the new file as a string. If the st ring \"substrout\" is not found in the \"filename\" then it is appende d to the name of the file before \".mws\" extension. Note that \"subst rout\" could be an empty string \"\".\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1089 "change_name:=proc(filename::string,substrout::string,substri n::string) \n local N,fileext,filenamenew,n,nout,nb;\n#### ###########################################\noptions `Copyright (c) 20 02-2006 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved. `;\ndescription `Last revised: July 22, 2006`;\n###################### #########################\nN:=length(filename); ###leng th of the whole string\nnout:=length(substrout); ###length \+ of the string to be removed\nn:=SearchText(substrout,filename); ###lo cation of the string to be removed\n#return n,nout,N;\nif n+nout-1 " 0 "" {MPLTEXT 1 0 2624 "replace_in_file:=proc(in_fi le::\{string,name\},\n out_file::\{string,name\}, \n pat_list::list(string),\n \+ rep_list::list(string)) \nlocal N1,Np,OUT,i,j,pattern,replace_string, pos,str1,str2,line,n_repl,Text,repflag;\n############################# ##################\noptions `Copyright (c) 2002-2006 by Rafal Ablamowi cz and Bertfried Fauser. All rights reserved.`;\ndescription `Last rev ised: July 22, 2006`;\n############################################### \nif nops(pat_list) <> nops(rep_list) then \n error \"Need two list s of equal length, or two blank lists if no replacements are to be mad e!\" \nend if:\n###############################################\nif me mber(\"\",pat_list) then\n error \"first list cannot contain an empt y string\"\nend if;\n###############################################\n if evalb(nops(pat_list)>0 and pat_list<>rep_list) then\n n_repl:=[ seq(0,i=1..nops(pat_list))]; \n repflag:=true;\nelse \n n_repl :=[];\n repflag:=false;\nend if;\n############################### \n##Reading file in first \n###############################\nText:=[] ;\nwhile true do \n line:=readline(`in_file`);\n if line = 0 then br eak end if:\n Text:=[op(Text),line];\nend do:\n###################### #########\n##Make replacements if needed:\n########################### ####\nif repflag then\n for i from 1 to nops(Text)-1 do\n for j fr om 1 to nops(pat_list) do\n pattern:=pat_list[j];\n replace_ string:=rep_list[j];\n if not evalb(pattern=replace_string) then \n Np:=length(pattern);\n if abs(Np - length(replace_s tring)) > 5 then\n error \"Strings %1 and %2 ought to be of the same length or within 5 characters\", pattern,replace_string\n \+ end if: \n while true do\n N1:=length(Text[i]) ;\n line:=cat(Text[i],Text[i+1]);\n pos:=SearchTex t(pattern,line,1..length(line));\n #\n if pos = 0 \+ then break end if:\n #\n n_repl:=subsop(j=n_repl[j ]+1,n_repl);\n str1:=line[1..pos-1];\n if pos+Np < = length(line) then \n str2:=line[pos+Np..-1];\n \+ else \n str2:=\"\";\n end if:\n \+ line:=cat(str1,replace_string,str2); \n Text:=subsop(i =line[1..N1],Text);\n Text:=subsop(i+1=line[N1+1..-1],Text); \n end do:\n end if;\n end do:\n end do:\nend if;\n## ###################\n##Write new file with or without replacements:\n# ####################\nOUT:=fopen(out_file,WRITE,TEXT);\nfor i from 1 t o nops(Text) do\n writeline(OUT,Text[i]); \nend do:\nclose(OUT);\nr eturn n_repl;\nend proc:\n " }}{PARA 0 "" 0 "" {TEXT -1 13 "7. Pro cedure " }{TEXT 261 16 "change_helpfiles" }{TEXT -1 770 " automaticall y copies all Maple help pages *.mws from \"dir_in\" specified as strin g, for example, \"C:\\\\Maple10\\\\P10\\\\test1\\\\\", to a different \+ directory \"dir_out\" also specified as a string, for example, \"C:\\ \\Maple10\\\\P10\\\\test2\\\\\". It can replace string patterns specif ied as a list 'pat_list' of strings with strings listed in a list 'rep _list'. Both lists must be of equal length, or they can be empty. If t he lists are empty, no replacements are made. This procedure uses opti onal 5th and 6th argument, each of type \"string\". When used, the sub string specified as the 5th argument in the name of the file currently processed is replaced with string entered as the last 6th argument. T his way, replacements can be made at the same time that the file names are changed.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2140 "change_helpfil es:=proc(dir_in::\{string,name\},\n dir_out::\{s tring,name\},\n pat_list::list(\{string,name\}), \n rep_list::list(\{string,name\}))\nlocal dir1, dir2,N,dir_list,fileold,filenew,changenameflag,makerepflag,file:\n#### ###########################################\noptions `Copyright (c) 20 02-2006 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved. `;\ndescription `Last revised: July 22, 2006`;\n###################### #########################\ndir1,dir2:=dir_in,dir_out;\n############### #########################\nif nops(pat_list)<>nops(rep_list) then\n \+ error \"pattern and replacement lists must be of equal length\"\nend i f;\n########################################\nif nops(pat_list)>0 then makerepflag:=true else makerepflag:=false end if:\n################## ######################\nchangenameflag:=false:\nif nargs=6 then\n \+ if not type(args[5],string) or not type(args[6],string) then\n \+ error \"arguments 5 and 6, when used, must be strings, e.g., %1 and %2 \",\"_M5\",\"_M6\"\n end if;\nchangenameflag:=true:\nend if:\n#### ####################################\ndir_list:=get_dir(dir1);\n###### ##################################\nfor file in dir_list do\nfileold:= file:\nif changenameflag then filenew:=change_name(fileold,args[5],arg s[6])\n else filenew:=file\nend if; \nN:=repl ace_in_file(cat(dir1,fileold),cat(dir2,filenew),pat_list,rep_list):\nm akerepflag:=evalb(pat_list<>rep_list):\nif makerepflag and changenamef lag then\n printf(\"processing file %s renamed as %s with replacemen t(s): %a\\n\",fileold,filenew,N)\nelif makerepflag and not changenamef lag then\n printf(\"processing file %s without renaming but with rep lacement(s): %a\\n\",fileold,N);\nelif not makerepflag and changenamef lag then\n printf(\"processing file %s renamed as %s without replace ments\\n\",fileold,filenew)\nelse\nprintf(\"processing file %s without renaming and without replacements - just copying\\n\",fileold,filenew )\nend if;\nend do:\nprintf(\"***********************\\n\");\nprintf( \"finished processing %d files\\n\",nops(dir_list));\nprintf(\"******* ****************\\n\");\nNULL \nend proc:\n" }}{PARA 0 "" 0 "" {TEXT -1 13 "8. Procedure " }{TEXT 262 8 "get_TEXT" }{TEXT -1 97 " reads a f ile \"FILE\" and puts it into a TEXT(line1,line2,...) format needed b y INTERFACE_HELP. \n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 538 "get_TEXT:= proc(FILE)\n local textobject,line;\n################################ ###############\noptions `Copyright (c) 2002-2006 by Rafal Ablamowicz \+ and Bertfried Fauser. All rights reserved.`;\ndescription `Last revise d: July 22, 2006`;\n###############################################\n \+ textobject := NULL; \n line := readline(FILE); \n while line <> 0 \+ do \n if length(line) <= 10 then \n line := ``||line||` `: \+ \n fi;\n textobject := textobject, line:\n line := readline(F ILE):\n od; \n textobject := TEXT(textobject):\nend:\n" }}{PARA 0 " " 0 "" {TEXT -1 13 "9. Procedure " }{TEXT 265 8 "makeLIST" }{TEXT -1 40 " makes a list of data entries needed by " }{TEXT 266 16 "insert_he lppages" }{TEXT -1 154 " to insert help pages into the HDB and the bro wser. In particular, it automatically creates a list of aliases that l ater can be modified by the procedure " }{TEXT 271 10 "modifyLIST" } {TEXT -1 536 ". It takes four arguments:\n\nmodulename - name of the m odule as a `symbol`\nparent - the name of the Parent as a `symbol`\ngr andparent - the name of the GrandParent as `symbol`\nLDIR - it is eith er a list of strings with topic entries such as, for example, [\"&cco \",\"&cco_d\"], or a directory where *._M8.mws files are stored\nversi on - it is a string that gives the current version of Maple, e.g., \"M 10\". It is expected that the file names *._M10.mws will contain the s ame string. If not, error message is returned and the process is stopp ed\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2955 "makeLIST:=proc(modname:: \{symbol,name\},\n parent::\{symbol,name\},\n \+ grandparent::\{symbol,name\},\n LDIR::\{list(string) ,name,string\},\n version::string) \n loca l modulename,mainmodulepage,i,N,L,datastring,dataentry,Toplevel,string list,mem;\n global typesLIST,convertsLIST;\n############ ###################################\noptions `Copyright (c) 2002-2006 \+ by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`;\ndesc ription `Last revised: July 22, 2006`;\n############################## #################\nif not assigned(typesLIST) then error \"global vari able `typesLIST` has not been assigned a list\" end if;\nif not assign ed(convertsLIST) then error \"global variable `convertsLIST` has not b een assigned a list\" end if;\nif nops(typesLIST)>0 then\n if not ty pe(typesLIST,list(string)) then\n error \"global list `typesLIST` must be either empty or it must contain strings\"\n end if\nend if; \nif nops(convertsLIST)>0 then\n if not type(convertsLIST,list(strin g)) then\n error \"global list `convertsLIST` must be either empt y or it must contain strings\"\n end if\nend if;\n################## #############################\nif type(LDIR,\{name,string\}) then\n \+ stringlist:=get_dir(LDIR);\n########################################## ###\n for datastring in stringlist do\n if evalb(SearchText(ve rsion,datastring)=0) then\n error \"filename %1 in the direct ory %2 does not match Maple version %3 - process is aborted!!!\",datas tring,LDIR,version;\n end if;\n end do:\n##################### ######################## \n stringlist:=map(change_name,stringlis t,cat(\"_\",version,\".mws\"),\"\");\n################################ #############\n ###########modify by adding \"type\"\n if nops(typ esLIST)>0 then\n for i from 1 to nops(stringlist) do\n m em:=stringlist[i]: \n if member(mem,typesLIST) then \n \+ stringlist:=subsop(i=cat(\"type\",\",\",mem),stringlist);\n \+ end if;\n end do;\n end if;\n ###########modify by addin g \"convert\"\n if nops(convertsLIST)>0 then\n for i from 1 to \+ nops(stringlist) do\n mem:=stringlist[i]: \n if memb er(mem,convertsLIST) then \n stringlist:=subsop(i=cat(\"co nvert\",\",\",mem),stringlist);\n end if;\n end do;\n \+ end if;\n#############################################\nelse\n strin glist:=LDIR;\nend if:\n#############################################\n modulename,mainmodulepage:=split(`,`,Parent);\nmodulename:=modname;\n# ############################################\nL:=[]:\nfor datastring i n stringlist do\n if convert(datastring,name)=mainmodulepage then\n Toplevel:=grandparent\n else\n Toplevel:=parent\n e nd if;\n dataentry:=convert(datastring,name);\n L:=[op(L),[cat(m odulename,`,`,convert(dataentry,name)),\n Toplevel,\n \+ [cat(convert(modulename,string),\",\",datastring),datastrin g]]]\nend do;\nreturn L;\nend proc:" }}{PARA 0 "" 0 "" {TEXT -1 14 "10 . Procedure " }{TEXT 267 10 "modifyLIST" }{TEXT -1 84 " can be used to replace \"aliases\" that are automatically generated by the procedure " }{TEXT 268 8 "makeLIST" }{TEXT -1 232 " for each help topic to be i nserted into the browser. In the data entry for each help topic, the t hird entry is a list of aliases [\"alias1\",\"alias2\",...]. This list is then replaced with the third argument of type 'list(string)' to " }{TEXT 269 11 "modifyLIST " }{TEXT -1 83 "and the procedure returns a \+ new complete list. The original list remains unchanged." }{TEXT 270 1 "\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 637 "modifyLIST:=proc(Lp::listli st,topic::symbol,newaliases::list(string)) \n local item,fl ag,i,newentryp,L,newitem;\n########################################### ####\noptions `Copyright (c) 2002-2006 by Rafal Ablamowicz and Bertfri ed Fauser. All rights reserved.`;\ndescription `Last revised: July 22, 2006`;\n###############################################\nL:=Lp:\nflag :=false:\nfor i from 1 to nops(L) while not flag do\n flag:=evalb(o p(1,L[i])=topic);\nend do;\nif flag=false then \n error \"topic %1 h as not been found in the entered list\",topic;\nend if;\nnewitem:=subs op(3=newaliases,L[i-1]);\nreturn subsop(i-1=newitem,L); \nend proc:\n " }}{PARA 0 "" 0 "" {TEXT -1 14 "11. Procedure " }{TEXT 263 17 "insert _help pages" }{TEXT -1 108 " takes a list of file names with help topi cs and inserts them into Maple browser and HDB Database entries. \n" } }{PARA 15 "" 0 "" {TEXT -1 219 "This procedure puts the below listed h elp pages into a maple.hdb help-page-database. These are the official \+ help pages for the CLIFFORD, Bigebra, Cliplus, GTP, Octonion modules. \+ It uses the following global path names:\n" }}{PARA 15 "" 0 "" {TEXT -1 234 "HDB_LIB_PATH : The path to a directory in the Maple search pa th (not the path of the Maple.hdb database in .../lib This pathname is here taken from libname, and has to be added to libname in any case t o be able to use the help pages." }}{PARA 15 "" 0 "" {TEXT -1 49 "HELP _FILE_PATH : The location of the help pages. " }}{PARA 15 "" 0 "" {TEXT -1 100 "BROWSER_PATH: The location in the Maple Help Page Brows er at which the Package should be 'mounted'." }}{PARA 15 "" 0 "" {TEXT -1 42 "Parent: The Package name or any help topic" }}{PARA 15 " " 0 "" {TEXT -1 66 "GrandParent: The Clifford package, (location in th e Help Browser)\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2638 "insert_helpp ages:=proc(LIST)\n local Text,delim,x,lst,name,topic,browser_path,Fil e,MODULE;\n global HDB_LIB_PATH, HELP_FILE_PATH, BROWSER_PATH;\n##### ##########################################\noptions `Copyright (c) 200 2-2006 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.` ;\ndescription `Last revised: July 22, 2006`;\n####################### ########################\nfor x in LIST do\n#printf(\"Inserting topic \+ %s and reading file:\",x[1]);\n if (SearchText(`/`,x[1],1..length(x [1])) <> 0 ) then\n lst:=[split(`/`,x[1])];\n name :=lst[-1. .-1];\n topic := ``;\n delim := ``; \n while(lst <> []) do\n topic := cat(topic,cat(delim,lst[1]));\n lst:=lst[ 2..-1];\n delim:=`,`;\n od; \n browser_path:=cat(BROW SER_PATH,x[1]);\n elif (SearchText(`,`,x[1],1..length(x[1])) <> 0 ) then\n lst:=[split(`,`,x[1])];\n name :=lst[-1..-1];\n \+ topic:=x[1];\n browser_path:=BROWSER_PATH;\n delim:=``;\n \+ while(lst <> []) do\n browser_path:=cat(browser_path,cat(de lim,lst[1]));\n lst:=lst[2..-1];\n delim:=`/`;\n od ; \n else\n topic:=x[1];\n name :=x[1];\n browser_pa th:=cat(BROWSER_PATH,topic);\n fi;\n name:=op(name);\n########## ##################################\nif nargs=1 then \n File:=cat( HELP_FILE_PATH,cat(name,\".mws\")):\nelif nargs=2 then\n if not type (args[2],string) then \n error \"second optional argument must be a string giving Maple version included in file names, e.g. %1\",\"M6 \"\n else \n File:=cat(HELP_FILE_PATH,cat(name,\"_\",args[2],\".mw s\")):\n end if;\nend if;\n######################################### ###\n###HELP_FILE = cat(HELP_FILE_PATH,cat(name,\".mws\")),\n####### #####################################\n MODULE[x[1]]:=table( [\n \+ NAME = name,\n PARENT = x[2],\n TOPIC = topic,\n \+ HELP_FILE = File,\n ALIASES= x[3],\n ACTIVE = `true`,\n \+ BROWSER_LOC = browser_path,\n LIB = HDB_LIB_PATH\n \+ ]);\n ##\n ## get TEXT\n printf(\"Trying to read file %s...\\ n\",File); ###for testing\n Text:=get_TEXT(File); \n ##\n ## put into DB\n####################################################\npr intf(\"Success... inserting topic %s from the file:\",x[1]);\nprint(MO DULE[x[1]][HELP_FILE]);\nprint(INTERFACE_HELP('insert','topic'=topic,' text'=Text,helpfile=HDB_LIB_PATH,'aliases'=x[3],'active'=false) );\npr int(INTERFACE_HELP('insert','topic'=topic,'browser'=browser_path,helpf ile=HDB_LIB_PATH) );\nod:\nprintf(\"***********************\\n\");\npr intf(\"Finished inserting %d file topics into the HDB and Browser\\n\" ,nops(LIST));\nprintf(\"***********************\\n\");\nNULL \n \nend :\n" }}{PARA 0 "" 0 "" {TEXT -1 13 "1. Procedure " }{TEXT 272 5 "setup " }{TEXT -1 16 " for the module " }{TEXT 273 12 "code_support" }{TEXT -1 128 " defines two conversion functions that convert directory names from \"string\" form to `name` (or `symbol`) form, and vice versa.\n " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1619 "setup:=proc()\nglobal `conver t/string_dir_to_symbol_dir`,`convert/symbol_dir_to_string_dir`;\n##### ##########################################\noptions `Copyright (c) 200 2-2006 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.` ;\ndescription `Last revised: July 22, 2006`;\n####################### ########################\n`convert/symbol_dir_to_string_dir`:=proc(dir ::\{symbol,string\}) local T,i,dir1,linuxflag;\nif type(dir,string) th en return dir end if;\nlinuxflag:=evalb(SearchText(`\\\\`,dir)=0);\nif linuxflag then return convert(dir,string) end if;\nT:=remove(member,[ split(\"/\",convert(dir,string))],\{\"\"\});\ndir1:=cat(T[1],\"\\\\\") :\nif nops(T) >1 then\n for i from 2 to nops(T) do dir1:=cat(dir1 ,T[i],\"\\\\\") end do:\nend if;\nreturn dir1;\nend proc:\n########### ####################################\n`convert/string_dir_to_symbol_di r`:=proc(dir::\{symbol,string\}) local T,i,dir1,linuxflag;\nif type(di r,symbol) then return dir end if;\nlinuxflag:=evalb(SearchText(`\\\\`, dir)=0);\nif linuxflag then return convert(dir,symbol) end if;\nT:=rem ove(member,[split(\"\\\\\",convert(dir,string))],\{\"\"\});\ndir1:=cat (T[1],\"\\\\\",T[2],\"\\\\\"):\nif nops(T)>2 then\n for i from 3 \+ to nops(T) do dir1:=cat(dir1,T[i],\"/\") end do:\nend if;\nreturn conv ert(dir1,name);\nend proc:\n########################################## #####\nprint(``);\nprint(`Module code_cupport ver. 1.03 for CLIFFORD e t al. for Maple 10`);\nprint(`Copyright (c) 2002-2006 by Rafal Ablamow icz and Bertfried Fauser. All rights reserved.`);\nprint(`Last revised : July 22, 2006`);\nprint(``);\n###################################### #########\nend proc:\n\nend module:\nsavelib(code_support);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%!G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%inMo dule~code_cupport~ver.~1.03~for~CLIFFORD~et~al.~for~Maple~10G" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#%apCopyright~(c)~2002-2006~by~Rafal~Ab lamowicz~and~Bertfried~Fauser.~All~rights~reserved.G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#% " 0 "" {MPLTEXT 1 0 27 "resta rt:with(code_support);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%!G" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#%inModule~code_cupport~ver.~1.03~for~C LIFFORD~et~al.~for~Maple~10G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%apCop yright~(c)~2002-2006~by~Rafal~Ablamowicz~and~Bertfried~Fauser.~All~rig hts~reserved.G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#% " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 0 {PARA 0 "" 0 "" {TEXT 287 9 "See Also:" }{TEXT 288 1 " " }{HYPERLNK 17 "code_support, examples" 2 "code_support,examples " "" }{TEXT 289 1 "\n" }{TEXT -1 0 "" }}{PARA 258 "" 0 "" {TEXT -1 122 "(c) Copyright 2002-2006, by Rafal Ablamowicz & Bertfried Fauser, \+ all rights reserved.\nLast modified: July 22, 2006, RA/BF." }}}}{MARK "8 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }