tipster222
Technical User
This is from a sample script in Procomm that I modify. After storing the information in each array, I like to use the values with using Transmit of each value in the array. Something like:
Transmit clli[1] and Transmit Tgrp[1]. This do not work, what is the correct format or do you know any other way to get around with this? Thanks in advance.
string Clli[13] ; Declare string array with 10 elements.
proc main
string FName
integer Tgrp[13] ; Declare integer array with 10 elements.
integer Count = 0 ; Variable subscript used to reference our
; arrays.
string szLine ; Variable to store line from file.
string szTemp ; Temporary variable used for Age.
if isfile FName
if fopen 0 "NAMES.LST" READ
; Open Clli file for read only.
while not feof 0 ; Loop while we’re not at end of the file.
fgets 0 szLine ; Get a line from the file and extract the
; Clli and Tgrp.
strtok Clli[Count] szLine "," 1
strtok szTemp szLine "," 1
atoi szTemp Tgrp[Count]
; Convert Tgrp to integer and put
; it into our Tgrp array.
if (Count += 1) == 13
; Increment array subscript and make
exitwhile ; sure that we don’t increment past the
endif ; last elements in the two arrays .
endwhile
fclose 0 ; Close our file of Clli and Tgrp.
else ; Display a message if an error occurred.
errormsg "Couldn’t open NAMES.LST for input!"
endif
endif
endproc
Transmit clli[1] and Transmit Tgrp[1]. This do not work, what is the correct format or do you know any other way to get around with this? Thanks in advance.
string Clli[13] ; Declare string array with 10 elements.
proc main
string FName
integer Tgrp[13] ; Declare integer array with 10 elements.
integer Count = 0 ; Variable subscript used to reference our
; arrays.
string szLine ; Variable to store line from file.
string szTemp ; Temporary variable used for Age.
if isfile FName
if fopen 0 "NAMES.LST" READ
; Open Clli file for read only.
while not feof 0 ; Loop while we’re not at end of the file.
fgets 0 szLine ; Get a line from the file and extract the
; Clli and Tgrp.
strtok Clli[Count] szLine "," 1
strtok szTemp szLine "," 1
atoi szTemp Tgrp[Count]
; Convert Tgrp to integer and put
; it into our Tgrp array.
if (Count += 1) == 13
; Increment array subscript and make
exitwhile ; sure that we don’t increment past the
endif ; last elements in the two arrays .
endwhile
fclose 0 ; Close our file of Clli and Tgrp.
else ; Display a message if an error occurred.
errormsg "Couldn’t open NAMES.LST for input!"
endif
endif
endproc