BBC.SHARED.JOBI.TEMPFILE-VARA

Summary

Object type
JOBI
Object Folder
PACKAGES/BEST-BLU/BBC.SHARED/SOURCE/TEMPFILES
Title
Retrieves the content for a temporary file from a VARA
Archive Key 1
-
Archive Key 2
-
Created
WRITER/B4A am: 2022-02-28 14:47:21
Last Modified
WRITER/B4A am: 2024-01-09 09:57:42 18 x
Last Used
-

Description

This include adds one column of a variable object to a temporary file

Requirements

  • Unix: bash
  • Windows: Powershell 7.0

Parameter

$VARACOL$
defines the variable object and the column to use

Input

Output

Unix

$bbcs_vara_file
script variable containing the name of the temporary file

Windows

$bbcs_vara_file
powershell variable containing the name of the temporary file

Example

:include BBC.SHARED.JOBI.TEMPFILE-VARA $ENTRY$ = "<variable>[:<col1>]"

If no column has been specified the column 1 is used.

:include BBC.SHARED.JOBI.TEMPFILE-VARA $ENTRY$ = "<variable>"

Process

:set &vara_data# = "$VARACOL$"
:set &colon# = str_find( &vara_data#, ":" )
:if &colon# < 1
:  set &variable# = &vara_data#
:  set &column# = 1
:else
:  set &colon# = &colon# - 1
:  set &variable# = str_cut( &vara_data#, 1, &colon# )
:  set &colon# = &colon# + 2
:  set &column# = str_cut( &vara_data#, &colon# )
:endif

:set &hnd# = prep_process_var( &variable# )
:inc BBC.SHARED.JOBI.TEMPFILE-START
:process &hnd#
:  set &value# = get_process_line( &hnd#, &column# )
:  set &value# = str_substitute_var( &value# )
:  set &value# = resolve_var( &value# )
&value#
:endprocess
:inc BBC.SHARED.JOBI.TEMPFILE-END
:close_process &hnd#

:switch &$PLATFORM#
:  case "UNIX"
bbcs_vara_file=$bbcs_temp_file
:  case "WINDOWS"
$bbcs_vara_file = $bbcs_temp_file
:endswitch