{VERSION 5 0 "IBM INTEL NT" "5.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 }{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 "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 "Norm al" -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 81 "\"code_support' for CLI FFORD, Bigebra, Octonion, GTP, Cliplus, Octonion in Maple 8" }{TEXT -1 242 "\n\n`Copyright 1995-2003 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 11 "" 1 "" {XPPMATH 20 "6#%!G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6 #%hnModule~code_cupport~ver.~1.03~for~CLIFFORD~et~al.~for~Maple~8G" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#%apCopyright~(c)~2002-2003~by~Rafal~Ab lamowicz~and~Bertfried~Fauser.~All~rights~reserved.G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%>Last~revised:~January~5,~2003G" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#%!G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7,%1change_hel pfilesG%,change_nameG%*copy_fileG%)get_TEXTG%(get_dirG%1insert_helppag esG%)makeLISTG%+modifyLISTG%0replace_in_fileG%&splitG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 174 "This help page shows various commands and their code of the su pplementary package \"code_support\" that can be used to manipulate he lp pages for various packages, for example, " }{HYPERLNK 17 "CLIFFORD " 2 "Clifford,intro" "" }{TEXT -1 32 ". \n\nThis package enables one t o:" }}{PARA 0 "" 0 "" {TEXT -1 100 "\n- copy Maple worksheets from on e directory to another and make certain string replacements using " } {TEXT 277 16 "change_helpfiles" }{TEXT -1 34 ",\n- change worksheet n ames using " }{TEXT 278 11 "change_name" }{TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 50 "- copy files from one 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 "- take a list of file names with help topics and insert them automatically into Maple browser and HDB datab ase entries using " }{TEXT 280 16 "insert_helppages" }{TEXT -1 54 ",\n - make an automatic list of data entries needed by " }{TEXT 285 16 "i nsert_helppages" }{TEXT -1 7 " using " }{TEXT 281 8 "makeLIST" }{TEXT -1 46 ",\n- modify a list of data entries 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 s equence of strings using " }{TEXT 284 5 "split" }{TEXT -1 1 "," }} {PARA 0 "" 0 "" {TEXT -1 62 "- convert directory names listed as symb ols to strings using " }{TEXT 290 34 "`convert/symbol_dir_to_string_di r`" }{TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 77 "- convert back dir ectory name from a string format to a symbol format using " }{TEXT 291 34 "`convert/string_dir_to_symbol_dir`" }{TEXT -1 51 ".\n\nFor exa mples 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 30 "\nCookeville, January 5, 2003.\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 502 "######################################## #########################################\n### It is assumed that dire ctories can be entered either as strings:\n### (a) In Windows: \"C: \\\\Maple8\\\\Clifford\\\\Help_8_New\\\\\"\n### (b) In Linux: \"/h ome/fauser/BIG_ALL/P8/Clifford/Help_8_New/\"\n###\n### or as symbols: \n### (c) In Windows: `D:\\\\Bigebra/Help_Bigebra/`\n### (d) In Linu x: `/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 226 "code_support:=module()\nexport spl it,copy_file,get_dir,change_name,replace_in_file,change_helpfiles,get_ TEXT,\n makeLIST,modifyLIST,insert_helppages; \nlocal setup;\nop tion package, load=setup:\n#############################\n" }}{PARA 0 "" 0 "" {TEXT -1 13 "2. Procedure " }{TEXT 264 5 "split" }{TEXT -1 188 " takes character pattern \"pat\" and splits a string into a seque nce of substrings remained after removing \"pat\" from the string. If \+ the pattern does not match, the string is returned back.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 569 "split:=proc(pat,str)\n local a_seq,a1,x,p os,len,n;\n###############################################\noptions `C opyright (c) 2002-2003 by Rafal Ablamowicz and Bertfried Fauser. All r ights reserved.`;\ndescription `Last revised: January 5, 2003`;\n##### ##########################################\n a_seq:=NULL;\n a1:=str; \n len:=length(a1);\n pos:=1;\n while(SearchText(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:=substring(a1,n+length(pat)..len); \n len:=length(a1);\n od:\n a_seq:=a_seq,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 director y '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_Bigeb ra/` or as a \"string\", e.g., \"D:\\\\Bigebra\\\\Help_Bigebra\\\\\". \n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1251 "copy_file:=proc(path::\{str ing,symbol\},in_file::\{string,symbol\},out_file::\{string,symbol\}) \+ \n local OUT,line,n_lines,Text,path1,in_file1,out_file1;\n########### ####################################\n options `Copyright (c) 2002-20 03 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`;\n \+ description `Last revised: January 5, 2003`;\n####################### ########################\nif type(path,symbol) then\n path1:=path;\n else\n path1:=convert(path,string_dir_to_symbol_dir);\nend if;\n#### ###########################################\nif type(in_file,symbol) t hen\n in_file1:=in_file;\nelse\n in_file1:=convert(in_file,name); \nend if:\n###############################################\nif type(ou t_file,symbol) then\n out_file1:=out_file;\nelse\n out_file1:=conv ert(out_file,name);\nend if:\n######################################## #######\n n_lines:=0;\n Text:=[];\n OUT:=fopen(cat(path1,out_file1) ,WRITE,TEXT);\n while true do\n line:=readline(cat(path1,in_file1) ); \n if line = 0 then break end if:\n Text:=[op(Text),line];\n \+ writeline(OUT,line);\n n_lines:=n_lines+1;\n end do:\n close(O UT);\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 256 " fetches the *.mws files from a directo ry given as an argument and returns file names in a list of strings. N ote that the directory can be specified as a \"string\", for example, \+ \"C:\\\\Maple8\\\\P8\\\\test1\\\\\", or as `symbol`, for example, `C: \\\\Maple8/P8/test1`.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1247 "get_di r:=proc(dir::\{string,symbol\})\n local wc_line,out_list,dir1;\n##### ##########################################\n options `Copyright (c) 2 002-2003 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved .`;\n description `Last revised: January 5, 2003`;\n################# ##############################\nif type(dir,symbol) then\n dir1:=con vert(dir,symbol_dir_to_string_dir): \nelse\n dir1:=dir:\nend if;\n## #############################################\nout_list:=ssystem(cat( \"dir \",dir1));\nif out_list[1] <> 0 then error \"Could not read the \+ directory\" end if:\n#####################################\nwc_line:=p roc(line::string)\n local c,nw,out,List,item:\n nw := 0;\n out := t rue;\n List:=[]:\n item:=\"\":\n for c in line do\n if c = \" \" or c = \"\\t\" or c = \"\\n\" then\n out := true;\n if Sear chText(`.mws`,item)<>0 then\n List:=[op(List),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 length(item) <> 0 and Sea rchText(`.mws`,item)<> 0 then \n List:=[op(List),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 repla cing a substring \"substrout\" with a new substring \"substrin\". It r eturns the name of the new file as a string. If the string \"substrout \" is not found in the \"filename\" then it is appended to the name of the file before \".mws\" extension. Note that \"substrout\" could be \+ an empty string \"\".\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1091 "change _name:=proc(filename::string,substrout::string,substrin::string) \n \+ local N,fileext,filenamenew,n,nout,nb;\n#################### ###########################\noptions `Copyright (c) 2002-2003 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`;\ndescription \+ `Last revised: January 5, 2003`;\n#################################### ###########\nN:=length(filename); ###length of the whol e string\nnout:=length(substrout); ###length of the string \+ to be removed\nn:=SearchText(substrout,filename); ###location of the \+ string to be removed\n#return n,nout,N;\nif n+nout-1 " 0 "" {MPLTEXT 1 0 2626 "replace_in_file:=proc(in_file::\{ string,name\},\n out_file::\{string,name\},\n \+ pat_list::list(string),\n rep_l ist::list(string)) \nlocal N1,Np,OUT,i,j,pattern,replace_string,pos,st r1,str2,line,n_repl,Text,repflag;\n################################### ############\noptions `Copyright (c) 2002-2003 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`;\ndescription `Last revised: \+ January 5, 2003`;\n###############################################\nif nops(pat_list) <> nops(rep_list) then \n error \"Need two lists of equal length, or two blank lists if no replacements are to be made!\" \nend if:\n###############################################\nif member (\"\",pat_list) then\n error \"first list cannot contain an empty st ring\"\nend if;\n###############################################\nif e valb(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##R eading file in first \n###############################\nText:=[];\nwh ile true do \n line:=readline(`in_file`);\n if line = 0 then break e nd 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 from 1 to nops(pat_list) do\n pattern:=pat_list[j];\n replace_stri ng:=rep_list[j];\n if not evalb(pattern=replace_string) then\n \+ Np:=length(pattern);\n if abs(Np - length(replace_string )) > 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:=SearchText(pat tern,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 <= len gth(line) then \n str2:=line[pos+Np..-1];\n \+ else \n str2:=\"\";\n end if:\n l ine:=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 to nop s(Text) do\n writeline(OUT,Text[i]); \nend do:\nclose(OUT);\nreturn n_repl;\nend proc:\n " }}{PARA 0 "" 0 "" {TEXT -1 13 "7. Procedur e " }{TEXT 261 16 "change_helpfiles" }{TEXT -1 766 " automatically cop ies all Maple help pages *.mws from \"dir_in\" specified as string, fo r example, \"C:\\\\Maple8\\\\P8\\\\test1\\\\\", to a different directo ry \"dir_out\" also specified as a string, for example, \"C:\\\\Maple9 \\\\P9\\\\test2\\\\\". It can replace string patterns specified as a l ist 'pat_list' of strings with strings listed in a list 'rep_list'. Bo th lists must be of equal length, or they can be empty. If the lists a re empty, no replacements are made. This procedure uses optional 5th a nd 6th argument, each of type \"string\". When used, the substring spe cified as the 5th argument in the name of the file currently processed is replaced with string entered as the last 6th argument. This way, r eplacements can be made at the same time that the file names are chang ed.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2142 "change_helpfiles:=proc(d ir_in::\{string,name\},\n dir_out::\{string,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) 2002-2003 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`;\ndescri ption `Last revised: January 5, 2003`;\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 if;\n#### ####################################\nif nops(pat_list)>0 then makerep flag:=true else makerepflag:=false end if:\n########################## ##############\nchangenameflag:=false:\nif nargs=6 then\n if not t ype(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:\ni f changenameflag then filenew:=change_name(fileold,args[5],args[6])\n \+ else filenew:=file\nend if; \nN:=replace_in_f ile(cat(dir1,fileold),cat(dir2,filenew),pat_list,rep_list):\nmakerepfl ag:=evalb(pat_list<>rep_list):\nif makerepflag and changenameflag then \n printf(\"processing file %s renamed as %s with replacement(s): %a \\n\",fileold,filenew,N)\nelif makerepflag and not changenameflag then \n printf(\"processing file %s without renaming but with replacement (s): %a\\n\",fileold,N);\nelif not makerepflag and changenameflag then \n printf(\"processing file %s renamed as %s without replacements\\n \",fileold,filenew)\nelse\nprintf(\"processing file %s without renamin g and without replacements - just copying\\n\",fileold,filenew)\nend i f;\nend do:\nprintf(\"***********************\\n\");\nprintf(\"finishe d 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 file \"FILE \" and puts it into a TEXT(line1,line2,...) format needed by INTERFAC E_HELP. \n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 540 "get_TEXT:=proc(FILE) \n local textobject,line;\n########################################## #####\noptions `Copyright (c) 2002-2003 by Rafal Ablamowicz and Bertfr ied Fauser. All rights reserved.`;\ndescription `Last revised: January 5, 2003`;\n###############################################\n textobj ect := 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(FILE):\n \+ od; \n textobject := TEXT(textobject):\nend:\n" }}{PARA 0 "" 0 "" {TEXT -1 13 "9. Procedure " }{TEXT 265 8 "makeLIST" }{TEXT -1 40 " mak es a list of data entries needed by " }{TEXT 266 16 "insert_helppages " }{TEXT -1 154 " to insert help pages into the HDB and the browser. I n particular, it automatically creates a list of aliases that later ca n be modified by the procedure " }{TEXT 271 10 "modifyLIST" }{TEXT -1 534 ". It takes four arguments:\n\nmodulename - name of the module as \+ a `symbol`\nparent - the name of the Parent as a `symbol`\ngrandparent - the name of the GrandParent as `symbol`\nLDIR - it is either a list of strings with topic entries such as, for example, [\"&cco\",\"&cco_ d\"], or a directory where *._M8.mws files are stored\nversion - it is a string that gives the current version of Maple, e.g., \"M8\". It is expected that the file names *._M8.mws will contain the same string. \+ If not, error message is returned and the process is stopped\n" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 2957 "makeLIST:=proc(modname::\{symbol, name\},\n parent::\{symbol,name\},\n grand parent::\{symbol,name\},\n LDIR::\{list(string),name,str ing\},\n version::string) \n local modulen ame,mainmodulepage,i,N,L,datastring,dataentry,Toplevel,stringlist,mem; \n global typesLIST,convertsLIST;\n##################### ##########################\noptions `Copyright (c) 2002-2003 by Rafal \+ Ablamowicz and Bertfried Fauser. All rights reserved.`;\ndescription ` Last revised: January 5, 2003`;\n##################################### ##########\nif not assigned(typesLIST) then error \"global variable `t ypesLIST` has not been assigned a list\" end if;\nif not assigned(conv ertsLIST) then error \"global variable `convertsLIST` has not been ass igned a list\" end if;\nif nops(typesLIST)>0 then\n if not type(type sLIST,list(string)) then\n error \"global list `typesLIST` must b e either empty or it must contain strings\"\n end if\nend if;\nif no ps(convertsLIST)>0 then\n if not type(convertsLIST,list(string)) the n\n error \"global list `convertsLIST` must be either empty or it must contain strings\"\n end if\nend if;\n######################### ######################\nif type(LDIR,\{name,string\}) then\n stringl ist:=get_dir(LDIR);\n#############################################\n \+ for datastring in stringlist do\n if evalb(SearchText(version,d atastring)=0) then\n error \"filename %1 in the directory %2 \+ does not match Maple version %3 - process is aborted!!!\",datastring,L DIR,version;\n end if;\n end do:\n############################ ################# \n stringlist:=map(change_name,stringlist,cat( \"_\",version,\".mws\"),\"\");\n###################################### #######\n ###########modify by adding \"type\"\n if nops(typesLIST )>0 then\n for i from 1 to nops(stringlist) do\n mem:=st ringlist[i]: \n if member(mem,typesLIST) then \n \+ stringlist:=subsop(i=cat(\"type\",\",\",mem),stringlist);\n e nd if;\n end do;\n end if;\n ###########modify by adding \"co nvert\"\n if nops(convertsLIST)>0 then\n for i from 1 to nops(s tringlist) do\n mem:=stringlist[i]: \n if member(mem ,convertsLIST) then \n stringlist:=subsop(i=cat(\"convert \",\",\",mem),stringlist);\n end if;\n end do;\n end i f;\n#############################################\nelse\n stringlist :=LDIR;\nend if:\n#############################################\nmodul ename,mainmodulepage:=split(`,`,Parent);\nmodulename:=modname;\n###### #######################################\nL:=[]:\nfor datastring in str inglist do\n if convert(datastring,name)=mainmodulepage then\n \+ Toplevel:=grandparent\n else\n Toplevel:=parent\n end if ;\n dataentry:=convert(datastring,name);\n L:=[op(L),[cat(module name,`,`,convert(dataentry,name)),\n Toplevel,\n \+ [cat(convert(modulename,string),\",\",datastring),datastring]]] \nend do;\nreturn L;\nend proc:" }}{PARA 0 "" 0 "" {TEXT -1 14 "10. Pr ocedure " }{TEXT 267 10 "modifyLIST" }{TEXT -1 84 " can be used to rep lace \"aliases\" that are automatically generated by the procedure " } {TEXT 268 8 "makeLIST" }{TEXT -1 232 " for each help topic to be inser ted into the browser. In the data entry for each help topic, the third 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 n ew complete list. The original list remains unchanged." }{TEXT 270 1 " \n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 639 "modifyLIST:=proc(Lp::listlis t,topic::symbol,newaliases::list(string)) \n local item,fla g,i,newentryp,L,newitem;\n############################################ ###\noptions `Copyright (c) 2002-2003 by Rafal Ablamowicz and Bertfrie d Fauser. All rights reserved.`;\ndescription `Last revised: January 5 , 2003`;\n###############################################\nL:=Lp:\nfla g:=false:\nfor i from 1 to nops(L) while not flag do\n flag:=evalb( op(1,L[i])=topic);\nend do;\nif flag=false then \n error \"topic %1 \+ has not been found in the entered list\",topic;\nend if;\nnewitem:=sub sop(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 2640 "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-2003 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.` ;\ndescription `Last revised: January 5, 2003`;\n##################### ##########################\nfor x in LIST do\n#printf(\"Inserting topi c %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:=ls t[2..-1];\n delim:=`,`;\n od; \n browser_path:=cat(BR OWSER_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( delim,lst[1]));\n lst:=lst[2..-1];\n delim:=`/`;\n \+ od; \n else\n topic:=x[1];\n name :=x[1];\n browser_ path:=cat(BROWSER_PATH,topic);\n fi;\n name:=op(name);\n######## ####################################\nif nargs=1 then \n File:=ca t(HELP_FILE_PATH,cat(name,\".mws\")):\nelif nargs=2 then\n if not ty pe(args[2],string) then \n error \"second optional argument must \+ be a string giving Maple version included in file names, e.g. %1\",\"M 6\"\n else \n File:=cat(HELP_FILE_PATH,cat(name,\"_\",args[2],\".m ws\")):\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####################################################\n printf(\"Success... inserting topic %s from the file:\",x[1]);\nprint( MODULE[x[1]][HELP_FILE]);\nprint(INTERFACE_HELP('insert','topic'=topic ,'text'=Text,helpfile=HDB_LIB_PATH,'aliases'=x[3],'active'=false) );\n print(INTERFACE_HELP('insert','topic'=topic,'browser'=browser_path,hel pfile=HDB_LIB_PATH) );\nod:\nprintf(\"***********************\\n\");\n printf(\"Finished inserting %d file topics into the HDB and Browser\\n \",nops(LIST));\nprintf(\"***********************\\n\");\nNULL \n \ne nd:\n" }}{PARA 0 "" 0 "" {TEXT -1 13 "1. Procedure " }{TEXT 272 5 "set up" }{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 ver sa.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1622 "setup:=proc()\nglobal `c onvert/string_dir_to_symbol_dir`,`convert/symbol_dir_to_string_dir`;\n ###############################################\noptions `Copyright (c ) 2002-2003 by Rafal Ablamowicz and Bertfried Fauser. All rights reser ved.`;\ndescription `Last revised: January 5, 2003`;\n################ ###############################\n`convert/symbol_dir_to_string_dir`:=p roc(dir::\{symbol,string\}) local T,i,dir1,linuxflag;\nif type(dir,str ing) then return dir end if;\nlinuxflag:=evalb(SearchText(`\\\\`,dir)= 0);\nif linuxflag then return convert(dir,string) end if;\nT:=remove(m ember,[split(\"/\",convert(dir,string))],\{\"\"\});\ndir1:=cat(T[1],\" \\\\\"):\nif nops(T) >1 then\n for i from 2 to nops(T) do dir1:=c at(dir1,T[i],\"\\\\\") end do:\nend if;\nreturn dir1;\nend proc:\n#### ###########################################\n`convert/string_dir_to_sy mbol_dir`:=proc(dir::\{symbol,string\}) local T,i,dir1,linuxflag;\nif \+ type(dir,symbol) then return dir end if;\nlinuxflag:=evalb(SearchText( `\\\\`,dir)=0);\nif linuxflag then return convert(dir,symbol) end if; \nT:=remove(member,[split(\"\\\\\",convert(dir,string))],\{\"\"\});\nd ir1:=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;\nret urn convert(dir1,name);\nend proc:\n################################## #############\nprint(``);\nprint(`Module code_cupport ver. 1.03 for CL IFFORD et al. for Maple 8`);\nprint(`Copyright (c) 2002-2003 by Rafal \+ Ablamowicz and Bertfried Fauser. All rights reserved.`);\nprint(`Last \+ revised: January 5, 2003`);\nprint(``);\n############################# ##################\nend proc:\n\nend module:\nsavelib(code_support);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%!G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%hnModule~code_cupport~ver.~1.03~for~CLIFFORD~et~al.~for~Maple~8G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%apCopyright~(c)~2002-2003~by~Rafal~ Ablamowicz~and~Bertfried~Fauser.~All~rights~reserved.G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%>Last~revised:~January~5,~2003G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%!G" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "re start:with(code_support);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%!G" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#%hnModule~code_cupport~ver.~1.03~for~C LIFFORD~et~al.~for~Maple~8G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%apCopy right~(c)~2002-2003~by~Rafal~Ablamowicz~and~Bertfried~Fauser.~All~righ ts~reserved.G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%>Last~revised:~Janua ry~5,~2003G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%!G" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#7,%1change_helpfilesG%,change_nameG%*copy_fileG%)get_ TEXTG%(get_dirG%1insert_helppagesG%)makeLISTG%+modifyLISTG%0replace_in _fileG%&splitG" }}}{EXCHG {PARA 0 "> " 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 124 "(c) \+ Copyright 2002-2003, by Rafal Ablamowicz & Bertfried Fauser, all right s reserved.\nLast modified: January 5, 2003, 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 }