Skip to content

Instantly share code, notes, and snippets.

@rauljrz
Last active November 13, 2018 00:37
Show Gist options
  • Save rauljrz/121f8024d63328b611c8ce6183b3f1f3 to your computer and use it in GitHub Desktop.
Save rauljrz/121f8024d63328b611c8ce6183b3f1f3 to your computer and use it in GitHub Desktop.
Averiguar cuantos Sábados tiene un mes.
*[ http://rinconfox.com ]
*[ https://chat.whatsapp.com/579n13MRO2j7eiuw4xcVOC ]
*[ [email protected] ]
*- Input
lcPeriodo = '10.2018'
*- Black Box
ldStart = CTOD('01.'+lcPeriodo)
ldEnd = GOMONTH(ldStart,1)-1
lnCntSatur = 0
FOR lnInd = 1 TO ldEnd - ldStart +1
lnCntSatur = lnCntSatur ;
+ IIF(DOW(ldStart + lnInd -1) = 7, 1, 0)
ENDFOR
*- Output
?' El mes tiene '+lcPeriodo+' tiene: ';
+TRANSFORM(lnCntSatur);
+' Sábados'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment