Skip to content

GET_ALL_DATES_OF_LAST_CHANGE

GET_ALL_DATES_OF_LAST_CHANGE returns the dates of last change of all existing models. As the database is accessed directly here, models do not have to be loaded and the model list does not have to be up-to-date. So this command is heplful for cache implementations.

Syntax

leo-grammar
CC "DB" GET_ALL_DATES_OF_LAST_CHANGE [ as-map ] [ accuracy: "min" | "sec" ]

#--> RESULT ecode:intValue 
			dates:strOrMapValue
CC "DB" GET_ALL_DATES_OF_LAST_CHANGE [ as-map ] [ accuracy: "min" | "sec" ]

#--> RESULT ecode:intValue 
			dates:strOrMapValue

Parameters

  • as-map (modifier) - if specified, the result will be a map, otherwise it will be a token string. A map is more convenient and more efficient for further processing in AdoScript. For a result of a WebSercice call working with a token string might be the better alternative.
  • accuracy (strValue) - "min" | "sec"

Returns

  • ecode (intValue) -
  • dates (strValue) - OrMapValue; If the result is a map, the map's keys are the model IDs while the map's values are the related dates. If the result is a token string, for each existing model the dates string contains one pair (model ID, date) whose elements are separated by a tab character ("\t"). These pairs are separated by newline ("\n"). So the complete string has the form "<modelid-1>\t<date-1>\n<modelid-2>\t<date-2>\n...\n<modelid-n>\t<date-n>".

Details

See Also

Example 1 (Map):

leo-grammar
CC "Modeling" GET_ACT_MODEL  #--> modelid
CC "DB" GET_ALL_DATES_OF_LAST_CHANGE as-map  #--> dates
SET curdate:(dates[modelid])
CC "AdoScript" INFOBOX ("Last change of current model:" + curdate)
CC "Modeling" GET_ACT_MODEL  #--> modelid
CC "DB" GET_ALL_DATES_OF_LAST_CHANGE as-map  #--> dates
SET curdate:(dates[modelid])
CC "AdoScript" INFOBOX ("Last change of current model:" + curdate)

Example 2 (Token string):

leo-grammar
CC "Modeling" GET_ACT_MODEL  #--> modelid
CC "DB" GET_ALL_DATES_OF_LAST_CHANGE  #--> dates
SET curdate:(fortok(t, dates, "\n",
                    cond(VAL token(t, 0, "\t") = modelid,
                         set(r, token(t, 1, "\t")), 0)), r)
CC "AdoScript" INFOBOX ("Last change of current model: " + curdate)
CC "Modeling" GET_ACT_MODEL  #--> modelid
CC "DB" GET_ALL_DATES_OF_LAST_CHANGE  #--> dates
SET curdate:(fortok(t, dates, "\n",
                    cond(VAL token(t, 0, "\t") = modelid,
                         set(r, token(t, 1, "\t")), 0)), r)
CC "AdoScript" INFOBOX ("Last change of current model: " + curdate)

Versions and Changes

Available since ADOxx 1.3