home *** CD-ROM | disk | FTP | other *** search
- /*
- @BProCalcTableUpdate @P@ICopyright Gold Disk Inc. January, 1993
-
- Update a table previously imported from Professional Calc.
- */
- options results
- address command
- call SafeEndEdit.rexx()
- call ppm_AutoUpdate(0)
-
- if ~show(l, "gdarexxsupport.library") then
- do
- if ~addlib("gdarexxsupport.library", 0, -30) then
- exit_msg("Please install the gdarexxsupport.library in your libs: directory before running this Genie.")
- end
-
- if ~show(p, "PCALC") then exit_msg("Please start Professional Calc and select a range before running this Genie.")
-
- prefix = ppm_GetFileName("Load Table Link Data", "",".data")
- if prefix = '' then call exit_msg()
-
- if ~open(file, prefix, "r") then
- call exit_msg("Could not open file")
-
- prefix = fcomponent(prefix)
-
- range = strip(readln(file))
- start_cell = strip(readln(file))
- start_row = strip(readln(file))
- end_row = strip(readln(file))
- start_col = strip(readln(file))
- end_col = strip(readln(file))
-
- call close(file)
-
- if pos('PCALC', show('p')) = 0 then
- call exit_msg("Please start ProCalc and Open appropriate Document")
-
- address 'PCALC'
- 'Suppress'
- 'LockGUI'
-
- 'SelectCell' start_cell
-
- call ppm_ShowStatus("Working..")
-
- do row = start_row to end_row
-
- do col = start_col to end_col
-
- box = ppm_BoxNum(prefix" "col"-"row)
-
- if box = 0 then iterate col
-
- 'IsValue'
-
- if result = 1 then
- do
- 'GetValue'
- cell = result
- end
- else
- do
- 'GetLabel'
- cell = result
- end
-
- text = ppm_GetArticleText(box, 1)
- cell = left(text, skipcodes(text, 1) - 1)||cell
- call ppm_DeleteContents(box)
- call ppm_TextIntoBox(box, cell)
- 'Cursor' right
- end
-
- 'SelectCell' start_cell
- 'Cursor' down
- 'Current'
- start_cell = result
-
- end
-
- exit_msg("Done")
-
-
- exit_msg: procedure
- do
- parse arg message
-
- if show(p, "PCALC") then
- do
- address PCALC
- 'UnSuppress'
- 'UnLockGUI'
- end
-
- if message ~= '' then call ppm_Inform(1, message,)
- call ppm_ClearStatus()
- call ppm_AutoUpdate(1)
- exit
-
- end
-
- fcomponent: procedure
- do
- arg filename
-
- slash = max(lastpos('/', filename), lastpos(':', filename))
-
- if slash = 0 then return(filename)
- else return(substr(filename, slash + 1))
- end
-
-