Re: XForms: problems with fl_get_choice_text

Bjoern Fuerst (fuerst@kph.uni-mainz.de)
Thu, 06 Nov 1997 15:02:26 +0100 (CET)

To subscribers of the xforms list from Bjoern Fuerst <fuerst@kph.uni-mainz.de> :

On 06-Nov-97 Ivan Powis wrote:
>To subscribers of the xforms list from Ivan Powis
><pczip@chemistry.nottingham.ac.uk> :
>
>>
>> To subscribers of the xforms list from Bjoern Fuerst
><fuerst@kph.uni-mainz.de> :
>>
>> sscanf((char *)datum(),"%*s %s %d %s %d",monat,&tag,time_string,&jahr);
>>
>> int tag;
>> char monat[6];
>> int jahr;
>> char *time_string;
>>
>> /* (tag=day, monat=month, jahr=year)
>>
>> datum() returns something like "Thu Nov 6 11:12:34 1997"
>>
>> and the sscanf should get the things into the different variables
>>
>> %*s omits the first (Thu)
>> %s writes "Nov" into monat (=char monat[6])
>> %d writes 6 into tag
>> %s writes "11:12:34" into time_string
>> %d writes 1997 into jahr
>>
>
>time_string is a pointer, is it set to point to allocated storage?
>or should it be char time_string[6] ??

thanks for the comment but it is allocated via

time_string=(char *)malloc(sizeof(char)*10);

so, there should be no problem.

Bjoern
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/