[Info-vax] date comparison format from a program
gérard Calliet
gerard.calliet at pia-sofer.fr
Mon May 20 12:58:58 EDT 2019
Le 20/05/2019 à 18:14, VAXman- at SendSpamHere.ORG a écrit :
> In article <gkg09mFspdnU1 at mid.individual.net>, =?UTF-8?Q?g=c3=a9rard_Calliet?= <gerard.calliet at pia-sofer.fr> writes:
>> Le 20/05/2019 à 16:53, VAXman- at SendSpamHere.ORG a écrit :
>>> In article <gkfsr0Fs1fbU1 at mid.individual.net>, =?UTF-8?Q?g=c3=a9rard_Calliet?= <gerard.calliet at pia-sofer.fr> writes:
>>>> Le 20/05/2019 à16:19, VAXman- at SendSpamHere.ORG a écrit :
>>>>> In article <gkfoamFr2t2U1 at mid.individual.net>, =?UTF-8?Q?g=c3=a9rard_Calliet?= <gerard.calliet at pia-sofer.fr> writes:
>>>>>> Hello,
>>>>>>
>>>>>> Is there a way to do from a compiled program (in C, for example)
>>>>>> something as simple as done by the lexical f$cvtime with "comparison"
>>>>>> parameter in DCL to get date strings which can easyly sorted? Pure VMS
>>>>>> realm whished.
>>>>>>
>>>>>> (I have to write program examples in C with VMS dates format and
>>>>>> associated routines and compare with RtlC usages).
>>>>>>
>>>>>> Gérard Calliet
>>>>>
>>>>> SYS$NUMTIM
>>>>>
>>>> Thanks. Same question for f$integer, f$string (the simplest solution)
>>>
>>> You're looking for the DCL equivalent of expression evaluating and returning
>>> an integer or string?
>>>
>> My question was why using a f$integer, f$string, f$cvtime is so simple
>> in DCL and why I don't find at the same time something similar and
>> simple from compiled programs.
>
> Well, there is a great deal of code behind those lexical functions to make
> them appear so simple. If you'd supply a simple DCL snippet of that which
> you want to achieve from a compiled language might help.
>
A stupid snippet:
$ time = f$time ()
$ comptime = f$cvtime (time)
$ sho symb comptime
$ read/prompt="year " sys$command year
$ sho symb year
$ next_year = f$integer (year) + 1
$ next_year_s = f$string (next_year)
$ write sys$output "next year is : " + next_year_s
How doing something as simple as that in C, and not using the basic C
rtl (atoi,...) , because the idea is introducing normal young people
(who don't know anything but C and Java) to the way something can be
done with (very old) VAX C and VMS run-time, and also introducting The
difference between C strings and string descriptors.
Gérard Calliet
More information about the Info-vax
mailing list