B4A.BASE.JOBI.CONFIG-READ-PROMPTSET

Summary

Object type
JOBI
Object Folder
PACKAGES/BEST4AUTOMIC/B4A.BASE/SOURCE/CONFIGURATION
Title
Read promptsets and stores settings in a VARA
Archive Key 1
-
Archive Key 2
-
Created
WRITER/B4A am: 2022-03-24 08:01:43
Last Modified
WRITER/B4A am: 2024-01-09 10:09:58 14 x
Last Used
-

Description

The include reads a promptset and creates a configuration file from the entries. The name of the option is reads from the field parameter “custom value”

Parameter

Input

Output

Example

:include B4A.BASE.JOBI.CONFIG_READ_PROMPTSET

Process

:inc B4A.BASE.JOBI.CONFIG-CREATE

:set &hnd# = prep_process_promptset( "PRPT" )
:process &hnd#
:  set &var# = get_process_line( &hnd#, 1 )
:  set &custom# = get_process_line( &hnd#, 2 )
:  set &type# = get_process_line( &hnd#, 4 )
:  set &ref# = get_process_line( &hnd#, 5 )
:  if &type# <> "label"
:    set &value# = get_script_var( "&var#" )
:  endif
:  p "field: &var#"
:  p "  type: &type#"
:  p "  value: &value#"
:  if &type# = "dyncheckgroup"
:    if &custom# <> ""
:      inc B4A.BASE.JOBI.CONFIG-ADD $ENTRY$ = "&custom#=&value#"
:    else
:      define &array#, string, 20
:      fill &array#[] = str_split( &value#, ";" )
:      set &hnd2# = prep_process_var( "&ref#" )
:      process &hnd2#
:        set &key# = get_process_line( &hnd2#, 1 )
:        set &val# = get_process_line( &hnd2#, 2 )
:        set &found# = find( &array#[], &val# )
:        p "add &key#"
:        if &found# <> 0
:          inc B4A.BASE.JOBI.CONFIG-ADD $ENTRY$ = "&key#=true"
:        else
:          inc B4A.BASE.JOBI.CONFIG-ADD $ENTRY$ = "&key#=false"
:        endif
:      endprocess
:      close_process &hnd2#
:      endif
:  else
:    if &custom# <> ""
:      inc B4A.BASE.JOBI.CONFIG-ADD $ENTRY$ = "&custom#=&value#"
:    endif
:  endif
:endprocess
:close_process &hnd#