NewsArchive
10-10-2012, 02:07 AM
SB 7.7
I need lists created within my loop to be unique and usable after my
loop wizard process. The code below is executed before my loop wizard
so I can show them how many file and the size (in KBS) they will be
backing up. In the loop wizard, I make sure they select a folder that
has enough free space. If they do, I want to create zip files from each
list without using the Handle File Listing function.
Code:
Set Variable %LOOP_COUNTER% to FUNCTION:Get INI Value("NbrOfClients")
from "%TTG_FOLDER_TO_BACKUP%\ADMIN\PDStempID.ini"
If %LOOP_COUNTER% Greater Than "0" Then
Set Variable %INI_NBR% to "0"
Loop (%LOOP_COUNTER% Times)
Set Variable %INI_NBR% to (Increment by 1)
Set Variable %CLIENT_NBR% to "Client"
Set Variable %CLIENT_NBR% to "%INI_NBR%" [Append Value]
Set Variable %CLIENT_ID% to FUNCTION:Get INI Value("ClientID")
from "%TTG_FOLDER_TO_BACKUP%\ADMIN\PDStempID.ini"
Set Variable %CLIENT_NAME% to FUNCTION:Get INI Value("ClientName")
from "%TTG_FOLDER_TO_BACKUP%\ADMIN\PDStempID.ini"
Set Variable %CLIENT_PATH% to FUNCTION:Get INI Value("ClientPath")
from "%TTG_FOLDER_TO_BACKUP%\ADMIN\PDStempID.ini"
If %CLIENT_PATH% Equals (Ignore Case) "%TTG_FOLDER_TO_BACKUP%\DATA
\" Then
Set Variable %CHECK_TTG_DATA_FOLDER% to "No"
End
! Get data files
Set Variable %CLIENT_QUEUE% to FUNCTION:Handle File Listing(Load
File List, 1) of "%CLIENT_PATH%\*.DAT;*.TPS;*.DDF"
Set Variable %NO_OF_FILES% to FUNCTION:Handle File Listing(Count
File List Items)
Set Variable %CLIENT_SIZE% to FUNCTION:Handle File Listing
(Calculate Cumulative File Size (in KB))
Set Variable %TOTAL_KBS% to %TOTAL_KBS%+%CLIENT_SIZE% (Arithmetic
& Bitwise Operation)
Set Variable %TOTAL_FILES% to %TOTAL_FILES%+%NO_OF_FILES%
(Arithmetic & Bitwise Operation)
! Create list of files to zip
Set Variable %ZIP_SPEC% to ""
Set Variable %FIRST_TIME% to "Yes"
Loop (%NO_OF_FILES% Times)
Set Variable %FILE_LIST_ITEM% to FUNCTION:Handle File Listing
(Get Next List Item)
If %FIRST_TIME% Equals (Ignore Case) "Yes" Then
Set Variable %FIRST_TIME% to "No"
Set VariableEx %ZIP_SPEC% to "%FILE_LIST_ITEM%"
Else
Set VariableEx %ZIP_SPEC% to "|%FILE_LIST_ITEM%" [Append
Value]
End
End
Set VariableEx %ZIP_FILE_CLIENT% to "%ZIP_SPEC%"
! Get letters
Set Variable %CLIENT_QUEUE% to FUNCTION:Handle File Listing(Load
File List, 1) of "%CLIENT_PATH%\LETTERS\*.RTF"
Set Variable %NO_OF_FILES% to FUNCTION:Handle File Listing(Count
File List Items)
Set Variable %CLIENT_SIZE% to FUNCTION:Handle File Listing
(Calculate Cumulative File Size (in KB))
Set Variable %TOTAL_KBS% to %TOTAL_KBS%+%CLIENT_SIZE% (Arithmetic
& Bitwise Operation)
Set Variable %TOTAL_FILES% to %TOTAL_FILES%+%NO_OF_FILES%
(Arithmetic & Bitwise Operation)
! Create list of files to zip
Set Variable %ZIP_SPEC% to ""
Set Variable %FIRST_TIME% to "Yes"
Loop (%NO_OF_FILES% Times)
Set Variable %FILE_LIST_ITEM% to FUNCTION:Handle File Listing
(Get Next List Item)
If %FIRST_TIME% Equals (Ignore Case) "Yes" Then
Set Variable %FIRST_TIME% to "No"
Set VariableEx %ZIP_SPEC% to "%FILE_LIST_ITEM%"
Else
Set VariableEx %ZIP_SPEC% to "|%FILE_LIST_ITEM%" [Append
Value]
End
End
Set VariableEx %ZIP_FILE_LETTER% to "%ZIP_SPEC%"
End
End
%ZIP_FILE_CLIENT% and %ZIP_FILE_LETTER% needs to qualified so they are
unique and usable further down in my project. I cannot continue to add
to these variables since I have well over 10000 characters for each
folder.
Hope this sense. TIA
--
Darrel (Dee) Witham
Professional Data Services, Inc
I need lists created within my loop to be unique and usable after my
loop wizard process. The code below is executed before my loop wizard
so I can show them how many file and the size (in KBS) they will be
backing up. In the loop wizard, I make sure they select a folder that
has enough free space. If they do, I want to create zip files from each
list without using the Handle File Listing function.
Code:
Set Variable %LOOP_COUNTER% to FUNCTION:Get INI Value("NbrOfClients")
from "%TTG_FOLDER_TO_BACKUP%\ADMIN\PDStempID.ini"
If %LOOP_COUNTER% Greater Than "0" Then
Set Variable %INI_NBR% to "0"
Loop (%LOOP_COUNTER% Times)
Set Variable %INI_NBR% to (Increment by 1)
Set Variable %CLIENT_NBR% to "Client"
Set Variable %CLIENT_NBR% to "%INI_NBR%" [Append Value]
Set Variable %CLIENT_ID% to FUNCTION:Get INI Value("ClientID")
from "%TTG_FOLDER_TO_BACKUP%\ADMIN\PDStempID.ini"
Set Variable %CLIENT_NAME% to FUNCTION:Get INI Value("ClientName")
from "%TTG_FOLDER_TO_BACKUP%\ADMIN\PDStempID.ini"
Set Variable %CLIENT_PATH% to FUNCTION:Get INI Value("ClientPath")
from "%TTG_FOLDER_TO_BACKUP%\ADMIN\PDStempID.ini"
If %CLIENT_PATH% Equals (Ignore Case) "%TTG_FOLDER_TO_BACKUP%\DATA
\" Then
Set Variable %CHECK_TTG_DATA_FOLDER% to "No"
End
! Get data files
Set Variable %CLIENT_QUEUE% to FUNCTION:Handle File Listing(Load
File List, 1) of "%CLIENT_PATH%\*.DAT;*.TPS;*.DDF"
Set Variable %NO_OF_FILES% to FUNCTION:Handle File Listing(Count
File List Items)
Set Variable %CLIENT_SIZE% to FUNCTION:Handle File Listing
(Calculate Cumulative File Size (in KB))
Set Variable %TOTAL_KBS% to %TOTAL_KBS%+%CLIENT_SIZE% (Arithmetic
& Bitwise Operation)
Set Variable %TOTAL_FILES% to %TOTAL_FILES%+%NO_OF_FILES%
(Arithmetic & Bitwise Operation)
! Create list of files to zip
Set Variable %ZIP_SPEC% to ""
Set Variable %FIRST_TIME% to "Yes"
Loop (%NO_OF_FILES% Times)
Set Variable %FILE_LIST_ITEM% to FUNCTION:Handle File Listing
(Get Next List Item)
If %FIRST_TIME% Equals (Ignore Case) "Yes" Then
Set Variable %FIRST_TIME% to "No"
Set VariableEx %ZIP_SPEC% to "%FILE_LIST_ITEM%"
Else
Set VariableEx %ZIP_SPEC% to "|%FILE_LIST_ITEM%" [Append
Value]
End
End
Set VariableEx %ZIP_FILE_CLIENT% to "%ZIP_SPEC%"
! Get letters
Set Variable %CLIENT_QUEUE% to FUNCTION:Handle File Listing(Load
File List, 1) of "%CLIENT_PATH%\LETTERS\*.RTF"
Set Variable %NO_OF_FILES% to FUNCTION:Handle File Listing(Count
File List Items)
Set Variable %CLIENT_SIZE% to FUNCTION:Handle File Listing
(Calculate Cumulative File Size (in KB))
Set Variable %TOTAL_KBS% to %TOTAL_KBS%+%CLIENT_SIZE% (Arithmetic
& Bitwise Operation)
Set Variable %TOTAL_FILES% to %TOTAL_FILES%+%NO_OF_FILES%
(Arithmetic & Bitwise Operation)
! Create list of files to zip
Set Variable %ZIP_SPEC% to ""
Set Variable %FIRST_TIME% to "Yes"
Loop (%NO_OF_FILES% Times)
Set Variable %FILE_LIST_ITEM% to FUNCTION:Handle File Listing
(Get Next List Item)
If %FIRST_TIME% Equals (Ignore Case) "Yes" Then
Set Variable %FIRST_TIME% to "No"
Set VariableEx %ZIP_SPEC% to "%FILE_LIST_ITEM%"
Else
Set VariableEx %ZIP_SPEC% to "|%FILE_LIST_ITEM%" [Append
Value]
End
End
Set VariableEx %ZIP_FILE_LETTER% to "%ZIP_SPEC%"
End
End
%ZIP_FILE_CLIENT% and %ZIP_FILE_LETTER% needs to qualified so they are
unique and usable further down in my project. I cannot continue to add
to these variables since I have well over 10000 characters for each
folder.
Hope this sense. TIA
--
Darrel (Dee) Witham
Professional Data Services, Inc