 |
|
BaselScript |
Beschreibung
File functions
Exist file
#return = $file.exist(directory name, file name)
if file exist then #return = 1 else 0
Example:
#e = $file.exist(/APPDIR/files/zzz, autos)
if #e == 1
message "file exist"
endif
Get counter of records in file
#counter = $file.records(file name)
Used only after “read file…”!!
Example:
read file=person
#counter = $file.records(person)
Exist value of field in file
#e = $file.exist_in_file(table,field, value)
Note: The function should only be used after the "read file"
Example:
#e = $file.exist_in_file(themes, #theme,"sport")
if #e == 1
message "value sport exist in the file themes"
endif
Summe of one field values in file
#e = $file.sum_field(#field_name, file name)
Note: The function should only be used after the "read file"
Example:
#SUM = $file.sum_field(#menge, person)
Average value of one field in file
#e = $file.average_field(#field_name, file name)
Note: The function should only be used after the "read file"
Example:
#average = $file.average_field(#volume, person)
Min value of one field in file
#e = $file.min_field(#field_name, file name)
Note: The function should only be used after the "read file"
Example:
#min = $file.min_field(#volume, person)
Max value of one field in file
#e = $file.max_field(#field_name, file name)
Note: The function should only be used after the "read file"
Example:
#max = $file.max_field(#volume, person)
File creation time
#dt = $creation_time(file, directory)
if file not exist then #_error = 1 else #_error = 0
Example:
#dt = $creation_time("email.csv, #_directory_files)
#dt = "2019-07-07 12:13:00"
File last access time
#dt = $file.last_access_time(file, directory)
if file not exist then #_error = 1 else #_error = 0
Example:
#dt = $file.last_access_time(email.csv, #_directory_files)
#dt = "2019-07-07 12:13:00"
File last write time
#dt = $file.last_write_time(file, directory)
if file not exist then #_error = 1 else #_error = 0
Example:
#dt = $file.last_write_time(email.csv, #_directory_files)
#dt = "2019-09-05 19:10:00"
Get fields counter from file record
#counter=$file.fields_counter(directory,file)
Example:
#counter=$file.fields_counter(#_directory_files_examples,cars)
#counter=4
Get fields counter from file description
#counter=$tables.fields_counter(file)
Example:
#counter=$tables.fields_counter(cars)
#counter=4
Get field name from record description
#field = $tables.field_name(file,number)
Example:
#f=$tables.field_name(cars,1)
#f=#price
Get field user name from record description
#name = $tables.field_user_name(file,number)
Example:
#name=$tables.field_name(cars,1)
#name=Price