/**************************************************************************/
/*                              DumpCfg.urbx                              */
/*                                                                        */
/*                    Copyright ©1998 by Dick Whiting                     */
/*                                                                        */
/*------------------------------------------------------------------------*/
/*     Example script for URBCONFIG to dump all the values to a file      */
/**************************************************************************/
/*
$VER: 1.0 Copyright ©1998 by Dick Whiting
$AUTHOR: Dick Whiting
$DESCRIPTION: Example script for URBCONFIG to dump all the values to a file
*/

parse arg fn

options results
address URBCONFIG

/**************************************************************************/
/*                 Arrays to convert type values to text                  */
/**************************************************************************/
textbtype.0='Text'
textbtype.1='Image'

textback.0='Default'
textback.1='Custom'


textrun.0='Label'
textrun.1='Arexx'
textrun.2='CLI'
textrun.3='Execute'
textrun.4='WBrun'
textrun.5='Start'

/**************************************************************************/
/*                     Get number of possible entries                     */
/**************************************************************************/
'GET MAX'
entries=result

/**************************************************************************/
/*                            Open output file                            */
/**************************************************************************/

if ~open('OUT',fn,'W') then do
   say "Unable to open output file: "fn
   exit
end

/**************************************************************************/
/*          Loop through...notice entries are numbered from ZERO          */
/**************************************************************************/
do i=0 to entries-1

   'SET POS' i

   'GET BUTTONTYPE'
   ubtype=result

   'GET LABEL'
   ulabel=result

   'GET BACKGROUND'
   uback=result

   'GET IMAGE'
   uimage=result

   'GET RUNTYPE'
   urun=result

   'GET COMMAND'
   ucmd=result

   'GET COLOR'
   ucolor=result

   'GET STACK'
   ustack=result 

   lineout=ubtype'|'ulabel'|'uback'|'uimage'|'urun'|'ucmd'|'ucolor'|'ustack
   writeln('OUT',lineout)
end

call close('OUT')

exit   
      
   
   
      
   
   
      
   
