{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 }{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 75 "\"code_support' for CLI FFORD, Bigebra, Octonion, GTP, and Cliplus in Maple 9" }{TEXT -1 242 " \n\n`Copyright 1995-2004 by Rafal Ablamowicz (*) and Bertfried Fauser \+ ($)\n\n(*) Department of Mathematics, Box 5054\n Tennessee Technol ogical University, Cookeville, TN 38505\n Tel: USA (931) 372-3569, fax: USA (931) 372-6353\n E-mail: " }{URLLINK 17 "rablamowicz@tnt ech.edu" 4 "mailto:rablamowicz@tntech.edu" "" }{TEXT -1 16 " \n \+ URL: " }{URLLINK 17 "http://math.tntech.edu/rafal/Cliff9/" 4 "http:/ /math.tntech.edu/rafal/Cliff9/" "" }{TEXT -1 101 "\n\n($) Universit\"a t Konstanz, Fachbereich Physik, Fach M678\n 78457 Konstanz, German y\n E-mail: " }{URLLINK 17 "Bertfried.Fauser@uni-konstanz.de" 4 "m ailto:Bertfried.Fauser@uni-konstanz.de" "" }{TEXT -1 11 "\n URL: \+ " }{URLLINK 17 "http://kaluza.physik.uni-konstanz.de/~fauser/\n" 4 "ht tp://kaluza.physik.uni-konstanz.de/~fauser/" "" }}{PARA 0 "" 0 "" {TEXT -1 174 "This help page shows various commands and their code of \+ the supplementary package \"code_support\" that can be used to manipul ate help pages for various packages, for example, " }{HYPERLNK 17 "CLI FFORD" 2 "Clifford,intro" "" }{TEXT -1 32 ". \n\nThis package enables \+ one to:" }}{PARA 0 "" 0 "" {TEXT -1 100 "\n- copy Maple worksheets fr om one directory to another and make certain string replacements usin g " }{TEXT 277 16 "change_helpfiles" }{TEXT -1 34 ",\n- change worksh eet names using " }{TEXT 278 11 "change_name" }{TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 50 "- copy files from one directory to another usi ng " }{TEXT 275 9 "copy_file" }{TEXT -1 42 ",\n- read a Maple workshe et as text using " }{TEXT 279 8 "get_TEXT" }{TEXT -1 1 "," }}{PARA 0 " " 0 "" {TEXT -1 84 "- read and return names of Maple worksheets locat ed 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 wit h help topics and insert them automatically into Maple browser and HDB database entries using " }{TEXT 280 16 "insert_helppages" }{TEXT -1 54 ",\n- make an automatic list of data entries needed by " }{TEXT 285 16 "insert_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 usin g " }{TEXT 283 15 "replace_in_file" }{TEXT -1 55 ",\n- split file nam es into a sequence of strings using " }{TEXT 284 5 "split" }{TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 62 "- convert directory names listed as symbols to strings using " }{TEXT 290 34 "`convert/symbol_dir_to_s tring_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\nF or examples how these commands can be used see " }{HYPERLNK 17 "exampl es of code_support" 2 "code_support,examples" "" }{TEXT -1 1 "." }} {PARA 0 "" 0 "" {TEXT -1 31 "\nCookeville, December 1, 2003.\n" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 502 "########################### ######################################################\n### It is assu med that directories can be entered either as strings:\n### (a) In Win dows: \"C:\\\\Maple9\\\\Clifford\\\\Help_9_New\\\\\"\n### (b) In Lin ux: \"/home/fauser/BIG_ALL/P9/Clifford/Help_9_New/\"\n###\n### or \+ as symbols:\n### (c) In Windows: `D:\\\\Bigebra/Help_Bigebra/`\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 226 "code_support:=module()\nexp ort split,copy_file,get_dir,change_name,replace_in_file,change_helpfil es,get_TEXT,\n makeLIST,modifyLIST,insert_helppages; \nlocal set up;\noption 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 int o a sequence of substrings remained after removing \"pat\" from the st ring. If the pattern does not match, the string is returned back.\n" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 570 "split:=proc(pat,str)\n local a_s eq,a1,x,pos,len,n;\n###############################################\no ptions `Copyright (c) 2002-2004 by Rafal Ablamowicz and Bertfried Faus er. All rights reserved.`;\ndescription `Last revised: December 1, 200 3`;\n###############################################\n a_seq:=NULL;\n a1:=str;\n len:=length(a1);\n pos:=1;\n while(SearchText(pat,a1,p os..len) <>0) do\n n:=SearchText(pat,a1,pos..len);\n x:=substrin g(a1,pos..n-1);\n a_seq:=a_seq,x;\n a1:=substring(a1,n+length(pa t)..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 directory 'path' as another file called 'out_file' to the same direct ory.\nThe path can be specified as a symbol, e.g., as `D:\\\\Bigebra/H elp_Bigebra/` or as a \"string\", e.g., \"D:\\\\Bigebra\\\\Help_Bigebr a\\\\\".\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1252 "copy_file:=proc(pat h::\{string,symbol\},in_file::\{string,symbol\},out_file::\{string,sym bol\}) \n local OUT,line,n_lines,Text,path1,in_file1,out_file1;\n#### ###########################################\n options `Copyright (c) \+ 2002-2004 by Rafal Ablamowicz and Bertfried Fauser. All rights reserve d.`;\n description `Last revised: December 1, 2003`;\n############### ################################\nif type(path,symbol) then\n path1: =path;\nelse\n path1:=convert(path,string_dir_to_symbol_dir);\nend i f;\n###############################################\nif type(in_file,s ymbol) 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;\nelse\n out_file 1:=convert(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),li ne];\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 f ile %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 d irectory given as an argument and returns file names in a list of stri ngs. Note that the directory can be specified as a \"string\", for exa mple, \"C:\\\\Maple9\\\\P9\\\\test1\\\\\", or as `symbol`, for example , `C:\\\\Maple9/P9/test1`.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1248 "g et_dir:=proc(dir::\{string,symbol\})\n local wc_line,out_list,dir1;\n ###############################################\n options `Copyright \+ (c) 2002-2004 by Rafal Ablamowicz and Bertfried Fauser. All rights res erved.`;\n description `Last revised: December 1, 2003`;\n########### ####################################\nif type(dir,symbol) then\n dir 1:=convert(dir,symbol_dir_to_string_dir): \nelse\n dir1:=dir:\nend i f;\n###############################################\nout_list:=ssystem (cat(\"dir \",dir1));\nif out_list[1] <> 0 then error \"Could not read the directory\" end if:\n#####################################\nwc_li ne:=proc(line::string)\n local c,nw,out,List,item:\n nw := 0;\n out := true;\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 SearchText(`.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 an d SearchText(`.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 1092 "change _name:=proc(filename::string,substrout::string,substrin::string) \n \+ local N,fileext,filenamenew,n,nout,nb;\n#################### ###########################\noptions `Copyright (c) 2002-2004 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`;\ndescription \+ `Last revised: December 1, 2003`;\n################################### ############\nN:=length(filename); ###length of the who le 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 2627 "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-2004 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`;\ndescription `Last revised: \+ December 1, 2003`;\n###############################################\ni f nops(pat_list) <> nops(rep_list) then \n error \"Need two lists o f equal length, or two blank lists if no replacements are to be made! \" \nend if:\n###############################################\nif memb er(\"\",pat_list) then\n error \"first list cannot contain an empty \+ string\"\nend if;\n###############################################\nif evalb(nops(pat_list)>0 and pat_list<>rep_list) then\n n_repl:=[se q(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:=[];\n while true do \n line:=readline(`in_file`);\n if line = 0 then break 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 from \+ 1 to nops(pat_list) do\n pattern:=pat_list[j];\n replace_str ing:=rep_list[j];\n if not evalb(pattern=replace_string) then\n \+ Np:=length(pattern);\n if abs(Np - length(replace_strin g)) > 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(pa ttern,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 <= le ngth(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=lin e[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 no ps(Text) do\n writeline(OUT,Text[i]); \nend do:\nclose(OUT);\nretur n n_repl;\nend proc:\n " }}{PARA 0 "" 0 "" {TEXT -1 13 "7. Procedu re " }{TEXT 261 16 "change_helpfiles" }{TEXT -1 766 " automatically co pies all Maple help pages *.mws from \"dir_in\" specified as string, f or example, \"C:\\\\Maple8\\\\P8\\\\test1\\\\\", to a different direct ory \"dir_out\" also specified as a string, for example, \"C:\\\\Maple 9\\\\P9\\\\test2\\\\\". It can replace string patterns specified as a \+ list 'pat_list' of strings with strings listed in a list 'rep_list'. B oth lists must be of equal length, or they can be empty. If the lists \+ are empty, no replacements are made. This procedure uses optional 5th \+ and 6th argument, each of type \"string\". When used, the substring sp ecified as the 5th argument in the name of the file currently processe d is replaced with string entered as the last 6th argument. This way, \+ replacements can be made at the same time that the file names are chan ged.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2143 "change_helpfiles:=proc( dir_in::\{string,name\},\n dir_out::\{string,nam e\},\n pat_list::list(\{string,name\}),\n \+ rep_list::list(\{string,name\}))\nlocal dir1,dir2,N,di r_list,fileold,filenew,changenameflag,makerepflag,file:\n############# ##################################\noptions `Copyright (c) 2002-2004 b y Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`;\ndescr iption `Last revised: December 1, 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 maker epflag:=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],args[6]) \n else filenew:=file\nend if; \nN:=replace_i n_file(cat(dir1,fileold),cat(dir2,filenew),pat_list,rep_list):\nmakere pflag:=evalb(pat_list<>rep_list):\nif makerepflag and changenameflag t hen\n printf(\"processing file %s renamed as %s with replacement(s): %a\\n\",fileold,filenew,N)\nelif makerepflag and not changenameflag t hen\n printf(\"processing file %s without renaming but with replacem ent(s): %a\\n\",fileold,N);\nelif not makerepflag and changenameflag t hen\n printf(\"processing file %s renamed as %s without replacements \\n\",fileold,filenew)\nelse\nprintf(\"processing file %s without rena ming and without replacements - just copying\\n\",fileold,filenew)\nen d if;\nend do:\nprintf(\"***********************\\n\");\nprintf(\"fini shed 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 \"F ILE\" and puts it into a TEXT(line1,line2,...) format needed by INTER FACE_HELP. \n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 541 "get_TEXT:=proc(FI LE)\n local textobject,line;\n####################################### ########\noptions `Copyright (c) 2002-2004 by Rafal Ablamowicz and Ber tfried Fauser. All rights reserved.`;\ndescription `Last revised: Dece mber 1, 2003`;\n###############################################\n tex tobject := 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 " m akes a list of data entries needed by " }{TEXT 266 16 "insert_helppage s" }{TEXT -1 154 " to insert help pages into the HDB and the browser. \+ In particular, it automatically creates a list of aliases that later c an 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`\ngrandpar ent - the name of the GrandParent as `symbol`\nLDIR - it is either a l ist of strings with topic entries such as, for example, [\"&cco\",\"&c co_d\"], or a directory where *._M9.mws files are stored\nversion - it is a string that gives the current version of Maple, e.g., \"M9\". It is expected that the file names *._M9.mws will contain the same strin g. If not, error message is returned and the process is stopped\n" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 2958 "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-2004 by Rafal \+ Ablamowicz and Bertfried Fauser. All rights reserved.`;\ndescription ` Last revised: December 1, 2003`;\n#################################### ###########\nif not assigned(typesLIST) then error \"global variable ` typesLIST` has not been assigned a list\" end if;\nif not assigned(con vertsLIST) then error \"global variable `convertsLIST` has not been as signed a list\" end if;\nif nops(typesLIST)>0 then\n if not type(typ esLIST,list(string)) then\n error \"global list `typesLIST` must \+ be either empty or it must contain strings\"\n end if\nend if;\nif n ops(convertsLIST)>0 then\n if not type(convertsLIST,list(string)) th en\n error \"global list `convertsLIST` must be either empty or i t must contain strings\"\n end if\nend if;\n######################## #######################\nif type(LDIR,\{name,string\}) then\n string list:=get_dir(LDIR);\n#############################################\n \+ for datastring in stringlist do\n if evalb(SearchText(version, datastring)=0) then\n error \"filename %1 in the directory %2 does not match Maple version %3 - process is aborted!!!\",datastring, LDIR,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 640 "modifyLIST:=proc(Lp::listlis t,topic::symbol,newaliases::list(string)) \n local item,fla g,i,newentryp,L,newitem;\n############################################ ###\noptions `Copyright (c) 2002-2004 by Rafal Ablamowicz and Bertfrie d Fauser. All rights reserved.`;\ndescription `Last revised: December \+ 1, 2003`;\n###############################################\nL:=Lp:\nfl ag:=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:=su bsop(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 "inse rt_help pages" }{TEXT -1 108 " takes a list of file names with help to pics and inserts them into Maple browser and HDB Database entries. \n " }}{PARA 15 "" 0 "" {TEXT -1 218 "This procedure puts the below liste d help pages into a maple.hdb help-page-database. These are the offici al help pages for the CLIFFORD, Bigebra, Cliplus, GTP, Octonion module s. It uses the following global path names:" }}{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 2641 "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-2004 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.` ;\ndescription `Last revised: December 1, 2003`;\n#################### ###########################\nfor x in LIST do\n#printf(\"Inserting top ic %s and reading file:\",x[1]);\n if (SearchText(`/`,x[1],1..lengt h(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:=l st[2..-1];\n delim:=`,`;\n od; \n browser_path:=cat(B ROWSER_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,ca t(delim,lst[1]));\n lst:=lst[2..-1];\n delim:=`/`;\n \+ od; \n else\n topic:=x[1];\n name :=x[1];\n browse r_path:=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 mus t 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], \".mws\")):\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################################################## ##\nprintf(\"Success... inserting topic %s from the file:\",x[1]);\npr int(MODULE[x[1]][HELP_FILE]);\nprint(INTERFACE_HELP('insert','topic'=t opic,'text'=Text,helpfile=HDB_LIB_PATH,'aliases'=x[3],'active'=false) \+ );\nprint(INTERFACE_HELP('insert','topic'=topic,'browser'=browser_path ,helpfile=HDB_LIB_PATH) );\nod:\nprintf(\"***********************\\n\" );\nprintf(\"Finished inserting %d file topics into the HDB and Browse r\\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 ver sa.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1705 "setup:=proc()\nglobal `c onvert/string_dir_to_symbol_dir`,`convert/symbol_dir_to_string_dir`;\n ###############################################\noptions `Copyright (c ) 2002-2004 by Rafal Ablamowicz and Bertfried Fauser. All rights reser ved.`;\ndescription `Last revised: December 1, 2003`;\n############### ################################\n`convert/symbol_dir_to_string_dir`:= proc(dir::\{symbol,string\}) local T,i,dir1,linuxflag;\nif type(dir,st ring) then 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_dir`:=proc(dir::\{symbol,string\}) local T,i,dir1,linuxflag;\ni f type(dir,symbol) then return dir end if;\nlinuxflag:=evalb(SearchTex t(`\\\\`,dir)=0);\nif linuxflag then return convert(dir,symbol) end if ;\nT:=remove(member,[split(\"\\\\\",convert(dir,string))],\{\"\"\});\n dir1:=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;\nre turn convert(dir1,name);\nend proc:\n################################# ##############\nprint(``);\nprint(`Module code_cupport ver. 1.03 for C LIFFORD et al. for Maple 9`);\nprint(`Copyright (c) 2002-2004 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`);\nprint(`Last revised: December 1, 2003`);\nprint(``);\n########################### ####################\nend proc:\n\nend module:\n#march('create',saveli bname, 100); ##Needed the first time code_support is saved\nsavelib(co de_support);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "restart:wit h(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~9G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%apCopyright~(c)~ 2002-2004~by~Rafal~Ablamowicz~and~Bertfried~Fauser.~All~rights~reserve d.G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%?Last~revised:~December~1,~200 3G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%!G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7,%1change_helpfilesG%,change_nameG%*copy_fileG%)get_TE XTG%(get_dirG%1insert_helppagesG%)makeLISTG%+modifyLISTG%0replace_in_f ileG%&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 125 "(c) Copyright 20 02-2004, by Rafal Ablamowicz & Bertfried Fauser, all rights reserved. \nLast modified: December 1, 2003, RA/BF." }}}}{MARK "5 0 0" 0 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }