Differenze tra le versioni di "Conoscere con le funzioni esterne del API di Glib-2.0 il numero di giorni posseduti da un mese"

Da Gambas-it.org - Wikipedia.
(Creata pagina con "Per conoscere con l'API di Glib-2.0 il numero di giorni posseduti da un mese, si farà uso della funzione esterna ''g_date_get_days_in_month()'' . Mostriamo di seguito un es...")
 
Riga 6: Riga 6:
 
   
 
   
 
  <FONT Color=gray>' ''guint8 g_date_get_days_in_month (GDateMonth month, GDateYear year)''
 
  <FONT Color=gray>' ''guint8 g_date_get_days_in_month (GDateMonth month, GDateYear year)''
  ' 'Returns the number of days in a month, taking leap years into account.''</font>
+
  ' Returns the number of days in a month, taking leap years into account.''</font>
 
  Private Extern g_date_get_days_in_month(GDmonth As Integer, GDyear As Integer) As Byte
 
  Private Extern g_date_get_days_in_month(GDmonth As Integer, GDyear As Integer) As Byte
 
   
 
   

Versione delle 16:28, 21 set 2017

Per conoscere con l'API di Glib-2.0 il numero di giorni posseduti da un mese, si farà uso della funzione esterna g_date_get_days_in_month() .


Mostriamo di seguito un esempio pratico:

Library "libglib-2.0"

' guint8 g_date_get_days_in_month (GDateMonth month, GDateYear year)
' Returns the number of days in a month, taking leap years into account.
Private Extern g_date_get_days_in_month(GDmonth As Integer, GDyear As Integer) As Byte


Public Sub Main()
 
 Dim num As Byte
 Dim mese As String
 Dim mesi As String[] = [Null, "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno",
                         "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"]
 
  mese = "Febbraio"      ' ...oppure anche: mese = mesi[2]
 
  num = g_date_get_days_in_month(mesi.Find(mese), 2016)
   
  Print "Il mese di "; mese; " contiene "; num; " giorni."
  
End