07-16-2013, 05:30 AM
I have the following code:
Macro Macro4
string_dates is build using the array arr_dates (the array contains the variables)
The output of string_dates would be exactly like this:
It also needs to work in compiled exe, is this possible? (If it is possible, then what is written below can be skipped).
If it is not possible maybe I am approaching my problem in a wrong way:
There are 3 parameters "c" , "a" and "m" that are passed in a string "get_date" like this
I use 'tok' to create an array that contains the split "get_date" string.
The problem is, the arguments can be passed in different sequence order: "a;m;c" , "m;a;c" or less then 3 parameters "a;c" , "c" ...etc. I must keep the sequence in which the c,a,m -paramaters are passed.
That's why I use 'arr_nt3' , it contains the parameters in correct order.
"a", "c" and "m" are also string variables, to avoid confusion:
I want to put "a","c","m" in "string_dates" which could look like this:
or
etc...
How can I build "string_dates" based on the passed argument "c;a;m" (or "a;c" , "m;a;c", etc...)?
Macro Macro4
str c="created"
str a="accessed"
str m="modified"
ARRAY(str) arr_dates
arr_dates.create(3)
arr_dates[0]="c"
arr_dates[1]="a"
arr_dates[2]="m"
str string_dates
;Desired format for "string_dates", using the array "arr_dates"
;Does not have to look exactly this. Most important is, "string_dates" uses arr_dates"
;string_dates=F"{c};{a};{m}"
;desired "string_dates" output, exactly like this:
;,created;accessed;modified
string_dates is build using the array arr_dates (the array contains the variables)
The output of string_dates would be exactly like this:
It also needs to work in compiled exe, is this possible? (If it is possible, then what is written below can be skipped).
If it is not possible maybe I am approaching my problem in a wrong way:
There are 3 parameters "c" , "a" and "m" that are passed in a string "get_date" like this
I use 'tok' to create an array that contains the split "get_date" string.
The problem is, the arguments can be passed in different sequence order: "a;m;c" , "m;a;c" or less then 3 parameters "a;c" , "c" ...etc. I must keep the sequence in which the c,a,m -paramaters are passed.
That's why I use 'arr_nt3' , it contains the parameters in correct order.
"a", "c" and "m" are also string variables, to avoid confusion:
I want to put "a","c","m" in "string_dates" which could look like this:
or
etc...
How can I build "string_dates" based on the passed argument "c;a;m" (or "a;c" , "m;a;c", etc...)?