├── .gitignore ├── includes ├── include-lib │ └── empty └── include │ ├── ole.ch │ ├── set.ch │ ├── aplrd.ch │ ├── aprpm.ch │ ├── apweb.ch │ ├── dwver.ch │ ├── error.ch │ ├── font.ch │ ├── fwcss.ch │ ├── fwstr.ch │ ├── jpeg.ch │ ├── mpdic.ch │ ├── msole.ch │ ├── print.ch │ ├── shell.ch │ ├── stilo.ch │ ├── style.ch │ ├── totvs.ch │ ├── vkey.ch │ ├── ap5mail.ch │ ├── ap5sdu.ch │ ├── apevent.ch │ ├── apvisio.ch │ ├── apwebex.ch │ ├── apwebsrv.ch │ ├── apwizard.ch │ ├── avprint.ch │ ├── avutils.ch │ ├── axsdef.ch │ ├── colors.ch │ ├── common.ch │ ├── constant.ch │ ├── dbfcdxax.ch │ ├── dbinfo.ch │ ├── dbstruct.ch │ ├── dbtree.ch │ ├── dialog.ch │ ├── dwacts.ch │ ├── dwconst.ch │ ├── dwdefs.ch │ ├── dwerror.ch │ ├── dwincs.ch │ ├── dwtable.ch │ ├── dwtconst.ch │ ├── eicconst.ch │ ├── fileio.ch │ ├── filterex.ch │ ├── folder.ch │ ├── fwbrowse.ch │ ├── fwfilter.ch │ ├── fwmvcdef.ch │ ├── fwportal.ch │ ├── fwstyle.ch │ ├── fwticket.ch │ ├── hbutton.ch │ ├── initvars.ch │ ├── mexcel.ch │ ├── mproject.ch │ ├── mscolors.ch │ ├── msexcel.ch │ ├── msgraphi.ch │ ├── msmgadd.ch │ ├── msmgetpr.ch │ ├── msobject.ch │ ├── mspj010.ch │ ├── mspj020.ch │ ├── mspj030.ch │ ├── mspj040.ch │ ├── mspj050.ch │ ├── mspj060.ch │ ├── mspj070.ch │ ├── mspj080.ch │ ├── msserial.ch │ ├── msxl010.ch │ ├── msxl020.ch │ ├── msxl030.ch │ ├── msxl040.ch │ ├── msxl060.ch │ ├── msxl070.ch │ ├── olecont.ch │ ├── parmtype.ch │ ├── poscss.ch │ ├── prbtvdef.ch │ ├── prconst.ch │ ├── prctrdef.ch │ ├── protdef.ch │ ├── protheus.ch │ ├── prtopdef.ch │ ├── ptmenu.ch │ ├── report.ch │ ├── restful.ch │ ├── rptdef.ch │ ├── rwmake.ch │ ├── scrollbx.ch │ ├── sigawin.ch │ ├── stdwin.ch │ ├── tbicode.ch │ ├── tbiconn.ch │ ├── tcbrowse.ch │ ├── tdsbirt.ch │ ├── topconn.ch │ ├── totvstws.ch │ ├── winapi.ch │ ├── xmlxfun.ch │ ├── fwballoon.ch │ ├── fwcommand.ch │ ├── fwmbrowse.ch │ ├── fwmenudrop.ch │ ├── fwmiledef.ch │ ├── fwschedule.ch │ ├── fwstyocean.ch │ ├── fwstystand.ch │ ├── fwstysunse.ch │ ├── msproject.ch │ ├── parmtypech.ch │ ├── tcfilterex.ch │ ├── totvsparam.ch │ ├── birtdataset.ch │ ├── commonstrings.ch │ ├── fwadaptereai.ch │ ├── fweditpanel.ch │ ├── fwfilterask.ch │ ├── fwiconmessage.ch │ ├── fwprintsetup.ch │ ├── fwsourcestack.ch │ ├── fwtableattach.ch │ ├── mpsysimportdb.ch │ ├── panelonline.ch │ ├── quicksearch.ch │ ├── fwadvplexpression.ch │ ├── fwcalendarwidget.ch │ ├── fweventviewconsts.ch │ └── fwsmallapplication.ch ├── README.md ├── src ├── exercises │ ├── array │ │ └── analisePessoas.prw │ ├── repetition-structure │ │ └── cangurus.prw │ ├── helloWorld.prw │ └── decision-struct │ │ └── maiorValor.prw └── example │ ├── object-oriented │ └── example-oo.prw │ ├── decision-structure │ ├── example-case.prw │ ├── example-elseif.prw │ ├── example-if-else.prw │ └── example-if-simple.prw │ ├── handling -arrays │ ├── example-arrays.prw │ ├── example-del-array.prw │ └── example-array-dinamico.prw │ ├── repetition-structure │ ├── example-for.prw │ ├── example-for-step.prw │ ├── example-while-exit.prw │ ├── example-while-loop.prw │ ├── example-for-tabuada.prw │ └── example-while.prw │ ├── codeblock │ ├── example-aEval.prw │ └── example-cb-simples.prw │ └── repetition-using-array │ └── for-array.prw ├── tests ├── repetition-structure │ └── cangurusTestCase.prw ├── helloWorldTestCase.prw ├── decision-struct │ └── maiorValorTestCase.prw └── array │ └── analisePessoasTestCase.prw ├── Dockerfile ├── .vscode └── launch.json └── docker-compose.yml /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode -------------------------------------------------------------------------------- /includes/include-lib/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/README.md -------------------------------------------------------------------------------- /includes/include/ole.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/ole.ch -------------------------------------------------------------------------------- /includes/include/set.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/set.ch -------------------------------------------------------------------------------- /includes/include/aplrd.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/aplrd.ch -------------------------------------------------------------------------------- /includes/include/aprpm.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/aprpm.ch -------------------------------------------------------------------------------- /includes/include/apweb.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/apweb.ch -------------------------------------------------------------------------------- /includes/include/dwver.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/dwver.ch -------------------------------------------------------------------------------- /includes/include/error.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/error.ch -------------------------------------------------------------------------------- /includes/include/font.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/font.ch -------------------------------------------------------------------------------- /includes/include/fwcss.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwcss.ch -------------------------------------------------------------------------------- /includes/include/fwstr.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwstr.ch -------------------------------------------------------------------------------- /includes/include/jpeg.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/jpeg.ch -------------------------------------------------------------------------------- /includes/include/mpdic.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/mpdic.ch -------------------------------------------------------------------------------- /includes/include/msole.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/msole.ch -------------------------------------------------------------------------------- /includes/include/print.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/print.ch -------------------------------------------------------------------------------- /includes/include/shell.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/shell.ch -------------------------------------------------------------------------------- /includes/include/stilo.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/stilo.ch -------------------------------------------------------------------------------- /includes/include/style.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/style.ch -------------------------------------------------------------------------------- /includes/include/totvs.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/totvs.ch -------------------------------------------------------------------------------- /includes/include/vkey.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/vkey.ch -------------------------------------------------------------------------------- /includes/include/ap5mail.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/ap5mail.ch -------------------------------------------------------------------------------- /includes/include/ap5sdu.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/ap5sdu.ch -------------------------------------------------------------------------------- /includes/include/apevent.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/apevent.ch -------------------------------------------------------------------------------- /includes/include/apvisio.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/apvisio.ch -------------------------------------------------------------------------------- /includes/include/apwebex.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/apwebex.ch -------------------------------------------------------------------------------- /includes/include/apwebsrv.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/apwebsrv.ch -------------------------------------------------------------------------------- /includes/include/apwizard.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/apwizard.ch -------------------------------------------------------------------------------- /includes/include/avprint.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/avprint.ch -------------------------------------------------------------------------------- /includes/include/avutils.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/avutils.ch -------------------------------------------------------------------------------- /includes/include/axsdef.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/axsdef.ch -------------------------------------------------------------------------------- /includes/include/colors.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/colors.ch -------------------------------------------------------------------------------- /includes/include/common.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/common.ch -------------------------------------------------------------------------------- /includes/include/constant.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/constant.ch -------------------------------------------------------------------------------- /includes/include/dbfcdxax.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/dbfcdxax.ch -------------------------------------------------------------------------------- /includes/include/dbinfo.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/dbinfo.ch -------------------------------------------------------------------------------- /includes/include/dbstruct.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/dbstruct.ch -------------------------------------------------------------------------------- /includes/include/dbtree.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/dbtree.ch -------------------------------------------------------------------------------- /includes/include/dialog.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/dialog.ch -------------------------------------------------------------------------------- /includes/include/dwacts.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/dwacts.ch -------------------------------------------------------------------------------- /includes/include/dwconst.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/dwconst.ch -------------------------------------------------------------------------------- /includes/include/dwdefs.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/dwdefs.ch -------------------------------------------------------------------------------- /includes/include/dwerror.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/dwerror.ch -------------------------------------------------------------------------------- /includes/include/dwincs.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/dwincs.ch -------------------------------------------------------------------------------- /includes/include/dwtable.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/dwtable.ch -------------------------------------------------------------------------------- /includes/include/dwtconst.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/dwtconst.ch -------------------------------------------------------------------------------- /includes/include/eicconst.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/eicconst.ch -------------------------------------------------------------------------------- /includes/include/fileio.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fileio.ch -------------------------------------------------------------------------------- /includes/include/filterex.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/filterex.ch -------------------------------------------------------------------------------- /includes/include/folder.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/folder.ch -------------------------------------------------------------------------------- /includes/include/fwbrowse.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwbrowse.ch -------------------------------------------------------------------------------- /includes/include/fwfilter.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwfilter.ch -------------------------------------------------------------------------------- /includes/include/fwmvcdef.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwmvcdef.ch -------------------------------------------------------------------------------- /includes/include/fwportal.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwportal.ch -------------------------------------------------------------------------------- /includes/include/fwstyle.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwstyle.ch -------------------------------------------------------------------------------- /includes/include/fwticket.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwticket.ch -------------------------------------------------------------------------------- /includes/include/hbutton.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/hbutton.ch -------------------------------------------------------------------------------- /includes/include/initvars.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/initvars.ch -------------------------------------------------------------------------------- /includes/include/mexcel.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/mexcel.ch -------------------------------------------------------------------------------- /includes/include/mproject.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/mproject.ch -------------------------------------------------------------------------------- /includes/include/mscolors.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/mscolors.ch -------------------------------------------------------------------------------- /includes/include/msexcel.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/msexcel.ch -------------------------------------------------------------------------------- /includes/include/msgraphi.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/msgraphi.ch -------------------------------------------------------------------------------- /includes/include/msmgadd.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/msmgadd.ch -------------------------------------------------------------------------------- /includes/include/msmgetpr.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/msmgetpr.ch -------------------------------------------------------------------------------- /includes/include/msobject.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/msobject.ch -------------------------------------------------------------------------------- /includes/include/mspj010.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/mspj010.ch -------------------------------------------------------------------------------- /includes/include/mspj020.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/mspj020.ch -------------------------------------------------------------------------------- /includes/include/mspj030.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/mspj030.ch -------------------------------------------------------------------------------- /includes/include/mspj040.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/mspj040.ch -------------------------------------------------------------------------------- /includes/include/mspj050.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/mspj050.ch -------------------------------------------------------------------------------- /includes/include/mspj060.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/mspj060.ch -------------------------------------------------------------------------------- /includes/include/mspj070.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/mspj070.ch -------------------------------------------------------------------------------- /includes/include/mspj080.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/mspj080.ch -------------------------------------------------------------------------------- /includes/include/msserial.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/msserial.ch -------------------------------------------------------------------------------- /includes/include/msxl010.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/msxl010.ch -------------------------------------------------------------------------------- /includes/include/msxl020.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/msxl020.ch -------------------------------------------------------------------------------- /includes/include/msxl030.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/msxl030.ch -------------------------------------------------------------------------------- /includes/include/msxl040.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/msxl040.ch -------------------------------------------------------------------------------- /includes/include/msxl060.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/msxl060.ch -------------------------------------------------------------------------------- /includes/include/msxl070.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/msxl070.ch -------------------------------------------------------------------------------- /includes/include/olecont.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/olecont.ch -------------------------------------------------------------------------------- /includes/include/parmtype.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/parmtype.ch -------------------------------------------------------------------------------- /includes/include/poscss.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/poscss.ch -------------------------------------------------------------------------------- /includes/include/prbtvdef.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/prbtvdef.ch -------------------------------------------------------------------------------- /includes/include/prconst.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/prconst.ch -------------------------------------------------------------------------------- /includes/include/prctrdef.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/prctrdef.ch -------------------------------------------------------------------------------- /includes/include/protdef.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/protdef.ch -------------------------------------------------------------------------------- /includes/include/protheus.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/protheus.ch -------------------------------------------------------------------------------- /includes/include/prtopdef.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/prtopdef.ch -------------------------------------------------------------------------------- /includes/include/ptmenu.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/ptmenu.ch -------------------------------------------------------------------------------- /includes/include/report.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/report.ch -------------------------------------------------------------------------------- /includes/include/restful.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/restful.ch -------------------------------------------------------------------------------- /includes/include/rptdef.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/rptdef.ch -------------------------------------------------------------------------------- /includes/include/rwmake.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/rwmake.ch -------------------------------------------------------------------------------- /includes/include/scrollbx.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/scrollbx.ch -------------------------------------------------------------------------------- /includes/include/sigawin.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/sigawin.ch -------------------------------------------------------------------------------- /includes/include/stdwin.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/stdwin.ch -------------------------------------------------------------------------------- /includes/include/tbicode.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/tbicode.ch -------------------------------------------------------------------------------- /includes/include/tbiconn.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/tbiconn.ch -------------------------------------------------------------------------------- /includes/include/tcbrowse.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/tcbrowse.ch -------------------------------------------------------------------------------- /includes/include/tdsbirt.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/tdsbirt.ch -------------------------------------------------------------------------------- /includes/include/topconn.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/topconn.ch -------------------------------------------------------------------------------- /includes/include/totvstws.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/totvstws.ch -------------------------------------------------------------------------------- /includes/include/winapi.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/winapi.ch -------------------------------------------------------------------------------- /includes/include/xmlxfun.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/xmlxfun.ch -------------------------------------------------------------------------------- /includes/include/fwballoon.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwballoon.ch -------------------------------------------------------------------------------- /includes/include/fwcommand.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwcommand.ch -------------------------------------------------------------------------------- /includes/include/fwmbrowse.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwmbrowse.ch -------------------------------------------------------------------------------- /includes/include/fwmenudrop.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwmenudrop.ch -------------------------------------------------------------------------------- /includes/include/fwmiledef.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwmiledef.ch -------------------------------------------------------------------------------- /includes/include/fwschedule.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwschedule.ch -------------------------------------------------------------------------------- /includes/include/fwstyocean.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwstyocean.ch -------------------------------------------------------------------------------- /includes/include/fwstystand.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwstystand.ch -------------------------------------------------------------------------------- /includes/include/fwstysunse.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwstysunse.ch -------------------------------------------------------------------------------- /includes/include/msproject.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/msproject.ch -------------------------------------------------------------------------------- /includes/include/parmtypech.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/parmtypech.ch -------------------------------------------------------------------------------- /includes/include/tcfilterex.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/tcfilterex.ch -------------------------------------------------------------------------------- /includes/include/totvsparam.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/totvsparam.ch -------------------------------------------------------------------------------- /includes/include/birtdataset.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/birtdataset.ch -------------------------------------------------------------------------------- /includes/include/commonstrings.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/commonstrings.ch -------------------------------------------------------------------------------- /includes/include/fwadaptereai.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwadaptereai.ch -------------------------------------------------------------------------------- /includes/include/fweditpanel.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fweditpanel.ch -------------------------------------------------------------------------------- /includes/include/fwfilterask.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwfilterask.ch -------------------------------------------------------------------------------- /includes/include/fwiconmessage.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwiconmessage.ch -------------------------------------------------------------------------------- /includes/include/fwprintsetup.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwprintsetup.ch -------------------------------------------------------------------------------- /includes/include/fwsourcestack.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwsourcestack.ch -------------------------------------------------------------------------------- /includes/include/fwtableattach.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwtableattach.ch -------------------------------------------------------------------------------- /includes/include/mpsysimportdb.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/mpsysimportdb.ch -------------------------------------------------------------------------------- /includes/include/panelonline.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/panelonline.ch -------------------------------------------------------------------------------- /includes/include/quicksearch.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/quicksearch.ch -------------------------------------------------------------------------------- /includes/include/fwadvplexpression.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwadvplexpression.ch -------------------------------------------------------------------------------- /includes/include/fwcalendarwidget.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwcalendarwidget.ch -------------------------------------------------------------------------------- /includes/include/fweventviewconsts.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fweventviewconsts.ch -------------------------------------------------------------------------------- /includes/include/fwsmallapplication.ch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/includes/include/fwsmallapplication.ch -------------------------------------------------------------------------------- /src/exercises/array/analisePessoas.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/src/exercises/array/analisePessoas.prw -------------------------------------------------------------------------------- /src/example/object-oriented/example-oo.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/src/example/object-oriented/example-oo.prw -------------------------------------------------------------------------------- /src/example/decision-structure/example-case.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/src/example/decision-structure/example-case.prw -------------------------------------------------------------------------------- /src/example/handling -arrays/example-arrays.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/src/example/handling -arrays/example-arrays.prw -------------------------------------------------------------------------------- /src/example/repetition-structure/example-for.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/src/example/repetition-structure/example-for.prw -------------------------------------------------------------------------------- /src/exercises/repetition-structure/cangurus.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/src/exercises/repetition-structure/cangurus.prw -------------------------------------------------------------------------------- /tests/repetition-structure/cangurusTestCase.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/tests/repetition-structure/cangurusTestCase.prw -------------------------------------------------------------------------------- /src/example/decision-structure/example-elseif.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/src/example/decision-structure/example-elseif.prw -------------------------------------------------------------------------------- /src/example/decision-structure/example-if-else.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/src/example/decision-structure/example-if-else.prw -------------------------------------------------------------------------------- /src/example/handling -arrays/example-del-array.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/src/example/handling -arrays/example-del-array.prw -------------------------------------------------------------------------------- /src/example/decision-structure/example-if-simple.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/src/example/decision-structure/example-if-simple.prw -------------------------------------------------------------------------------- /src/example/repetition-structure/example-for-step.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/src/example/repetition-structure/example-for-step.prw -------------------------------------------------------------------------------- /src/example/handling -arrays/example-array-dinamico.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/src/example/handling -arrays/example-array-dinamico.prw -------------------------------------------------------------------------------- /src/example/repetition-structure/example-while-exit.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/src/example/repetition-structure/example-while-exit.prw -------------------------------------------------------------------------------- /src/example/repetition-structure/example-while-loop.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/src/example/repetition-structure/example-while-loop.prw -------------------------------------------------------------------------------- /src/example/repetition-structure/example-for-tabuada.prw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianeventeu/advpl-first-steps/HEAD/src/example/repetition-structure/example-for-tabuada.prw -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM docker.totvs.io/ios/loboguara:17.3.0.8 3 | 4 | ADD src /src 5 | ADD includes /includes 6 | ADD tests /tests 7 | ADD build /build 8 | 9 | WORKDIR /src 10 | -------------------------------------------------------------------------------- /src/exercises/helloWorld.prw: -------------------------------------------------------------------------------- 1 | #include "protheus.ch" 2 | 3 | //------------------------------------------------------------------- 4 | /*/{Protheus.doc} helloWorld 5 | @goal Esse algoritmo deve retornar uma string com o texto I S2 AdvPL 6 | 7 | @author Juliane Venteu 8 | /*/ 9 | //------------------------------------------------------------------- 10 | User Function helloWorld() 11 | Local cTexto := "" 12 | Return cTexto -------------------------------------------------------------------------------- /src/example/repetition-structure/example-while.prw: -------------------------------------------------------------------------------- 1 | #include "protheus.ch" 2 | 3 | //------------------------------------------------------------------- 4 | /*/{Protheus.doc} myWhile 5 | Exemplo de while para criar um array com 10 numeros 6 | 7 | @author author 8 | @since date 9 | @version version 10 | /*/ 11 | //------------------------------------------------------------------- 12 | User Function myWhile() 13 | Local nNum := 1 14 | Local aNumeros := {} 15 | 16 | While nNum >= 1 .And. nNum <= 10 17 | aAdd(aNumeros, nNum) 18 | nNum++ 19 | End Do 20 | 21 | VarInfo("Lista", aNumeros) 22 | Return -------------------------------------------------------------------------------- /src/example/codeblock/example-aEval.prw: -------------------------------------------------------------------------------- 1 | User Function SumCodeB() 2 | Local aValores := {} 3 | Local nSoma := 0 4 | Local bSoma := {| nArrVal , nPosicao | nSoma += nArrVal } 5 | //Local nCont := 0 6 | 7 | aadd(aValores,2) 8 | aadd(aValores,5) 9 | aadd(aValores,61) 10 | aadd(aValores,100) 11 | aEval(aValores,bSoma) //O bloco de código será executado para cada posição do array 12 | 13 | /* 14 | O Exemplo poderia ser executado da maneira abaixo também 15 | For nCont := 1 to Len(aValores) 16 | Eval(bSoma, aValores[nCont]) 17 | Next 18 | */ 19 | MsgInfo(nSoma,"Valores Somados") 20 | Return -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use o IntelliSense para aprender sobre possíveis atributos. 3 | // Passe o mouse para ver as descrições dos atributos existentes. 4 | // Para obter mais informações, visite: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Advpl Debug", 9 | "type": "advpl", 10 | "request": "launch", 11 | "args": [], 12 | "cwd": "${workspaceRoot}", 13 | "programRun": "${command:AskForProgramName}", 14 | "stopOnEntry": false, 15 | "enviromentInfo": "${command:GetEnvInfos}", 16 | "workspace": "${workspaceFolder}/" 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /src/exercises/decision-struct/maiorValor.prw: -------------------------------------------------------------------------------- 1 | #include "protheus.ch" 2 | #include "parmtype.ch" 3 | 4 | //------------------------------------------------------------------- 5 | /*/{Protheus.doc} maiorValor 6 | @goal Esse algoritmo deve receber 3 valores e retornar a soma dos 7 | 2 maiores 8 | 9 | @param nValor1 Valor do primeiro numero 10 | @param nValor2 Valor do segundo numero 11 | @param nValor3 Valor do terceiro numero 12 | 13 | @return nSoma Soma dos dois maiores numeros recebidos 14 | 15 | @author Juliane Venteu 16 | /*/ 17 | //------------------------------------------------------------------- 18 | User Function maiorValor(nValor1, nValor2, nValor3) 19 | Local nSoma := 0 20 | 21 | PARAMTYPE 0 VAR nValor1 AS NUMERIC 22 | PARAMTYPE 1 VAR nValor2 AS NUMERIC 23 | PARAMTYPE 2 VAR nValor3 AS NUMERIC 24 | 25 | Return nSoma 26 | -------------------------------------------------------------------------------- /tests/helloWorldTestCase.prw: -------------------------------------------------------------------------------- 1 | #include "protheus.ch" 2 | 3 | //------------------------------------------------------------------- 4 | /*/{Protheus.doc} helloWorldTestCase 5 | Casos de teste para o exercicio helloWorld 6 | 7 | @author Juliane Venteu 8 | /*/ 9 | //------------------------------------------------------------------- 10 | class helloWorldTestCase from FWDefaultTestCase 11 | method helloWorldTestCase() 12 | method testCase1() 13 | end class 14 | 15 | method helloWorldTestCase() class helloWorldTestCase 16 | _Super:FWDefaultTestCase() 17 | 18 | self:addTestMethod('testCase1',,'Deve retornar I S2 AdvPL') 19 | return 20 | 21 | method testCase1() class helloWorldTestCase 22 | Local oResult := FWTestResult():FWTestResult() 23 | Local cTeste 24 | 25 | cTeste := u_helloWorld() 26 | oResult:AssertEqual(cTeste, "I S2 AdvPL") 27 | 28 | return oResult -------------------------------------------------------------------------------- /src/example/codeblock/example-cb-simples.prw: -------------------------------------------------------------------------------- 1 | #include "Protheus.ch" 2 | 3 | User Function BlocoCodigoExemplo(cEntrada) 4 | Local bOk 5 | Local bCancel 6 | Local cOperacao := "" 7 | Local cTexto := FwInputBox("Digite seu texto") 8 | Local cInclusao := "" 9 | 10 | bOK := { |cInclusao| Confirma(cInclusao), alert("Inclusão efetuada!") } 11 | bCancel := { |cEntrada, cOperacao| alert(i18n("#1 #2", {cEntrada, cOperacao})) } 12 | 13 | IF MSGYESNO("Deseja confirmar a inclusão?") 14 | If Empty(cTexto) 15 | Eval(bCancel,/*Sem parâmetro mesmo ;) */,"O texto não foi digitado.") 16 | Else 17 | Eval(bOK, cTexto) 18 | EndIf 19 | Else 20 | Eval(bCancel, cEntrada, "Operação Cancelada!!") 21 | EndIf 22 | Return 23 | 24 | Static Function Confirma(cNewText) 25 | Alert(cNewText) 26 | Return 27 | 28 | User Function teste_bloco() 29 | u_BlocoCodigoExemplo("Aula de Bloco de Código. ") 30 | return -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.6' 2 | services: 3 | appserver: 4 | image: docker.totvs.io/framesp_ci/loboguara:17.3.0.8 5 | environment: 6 | - "APPSERVER_GENERAL_BUILDKILLUSERS=1" 7 | - "APPSERVER_HTTP_ENABLE=0" 8 | - "APPSERVER_LICENSECLIENT_SERVER=10.171.67.183" 9 | - "APPSERVER_LICENSECLIENT_PORT=5555" 10 | - "APPSERVER_ENVIRONMENT_STARTPATH=/system/" 11 | - "APPSERVER_ENVIRONMENT_ROOTPATH=/tmp/" 12 | - "APPSERVER_ENVIRONMENT_SOURCEPATH=/tmp/apo/" 13 | - "APPSERVER_LOCKSERVER_ENABLE=1" 14 | - "APPSERVER_LOCKSERVER_SERVER=appserver" 15 | - "APPSERVER_LOCKSERVER_PORT=1234" 16 | ports: 17 | - 1234:1234 18 | volumes: 19 | - /opt/build/:/tmp/apo/ 20 | compile: 21 | image: imagetocompile:latest 22 | depends_on: 23 | - appserver 24 | links: 25 | - appserver 26 | # entrypoint: 27 | # /usr/local/FastCompile 28 | # --compileID=ZZZZ-ZZZZ 29 | # --passwordEmpty 30 | # --build=170117A 31 | # --port=1234 32 | # --compileFolder=/src/ 33 | # --include=/includes/include/;/includes/include-lib/ 34 | # --enviroment=ENVIRONMENT 35 | # --server=appserver -------------------------------------------------------------------------------- /tests/decision-struct/maiorValorTestCase.prw: -------------------------------------------------------------------------------- 1 | #include "protheus.ch" 2 | 3 | //------------------------------------------------------------------- 4 | /*/{Protheus.doc} maiorValorTestCase 5 | Casos de teste para o exercicio maiorValor 6 | 7 | @author Juliane Venteu 8 | /*/ 9 | //------------------------------------------------------------------- 10 | class maiorValorTestCase from FWDefaultTestCase 11 | method maiorValorTestCase() 12 | method testCase1() 13 | method testCase2() 14 | method testCase3() 15 | end class 16 | 17 | method maiorValorTestCase() class maiorValorTestCase 18 | _Super:FWDefaultTestCase() 19 | 20 | self:addTestMethod('testCase1',,'') 21 | self:addTestMethod('testCase2',,'') 22 | self:addTestMethod('testCase3',,'') 23 | return 24 | 25 | method testCase1() class maiorValorTestCase 26 | Local oResult := FWTestResult():FWTestResult() 27 | Local nTeste 28 | 29 | nTeste := u_maiorValor(1,2,3) 30 | oResult:AssertEqual(nTeste, 5) 31 | 32 | return oResult 33 | 34 | method testCase2() class maiorValorTestCase 35 | Local oResult := FWTestResult():FWTestResult() 36 | Local nTeste 37 | 38 | nTeste := u_maiorValor(1,1,1) 39 | oResult:AssertEqual(nTeste, 2) 40 | 41 | return oResult 42 | 43 | method testCase3() class maiorValorTestCase 44 | Local oResult := FWTestResult():FWTestResult() 45 | Local nTeste 46 | 47 | nTeste := u_maiorValor(20,30,10) 48 | oResult:AssertEqual(nTeste, 50) 49 | 50 | return oResult -------------------------------------------------------------------------------- /src/example/repetition-using-array/for-array.prw: -------------------------------------------------------------------------------- 1 | #include "protheus.ch" 2 | 3 | //------------------------------------------------------------------- 4 | /*/{Protheus.doc} mediaAlunos 5 | Esse programa tem por objetivo calcular a media das notas de uma turma. 6 | 7 | @param aAlunos Array multidimensional contendo o nome e as notas do aluno 8 | [n][1] cNome 9 | [n][2] aNotas 10 | 11 | @author Juliane Venteu 12 | /*/ 13 | //------------------------------------------------------------------- 14 | User Function mediaAlunos(aAlunos) 15 | Local nAluno 16 | Local nMedia 17 | Local aNotas 18 | Local nNota 19 | Local nMediaAluno 20 | Local nMediaGeral := 0 21 | 22 | For nAluno:=1 to Len(aAlunos) 23 | aNotas := aAlunos[nAluno][2] 24 | nMediaAluno := 0 25 | 26 | For nNota:=1 to Len(aNotas) 27 | nMediaAluno += aNotas[nNota] 28 | Next nNota 29 | 30 | nMediaALuno /= Len(aNotas) 31 | 32 | nMediaAluno /= Len(aAlunos) 33 | 34 | nMediaGeral += nMediaAluno 35 | Next nAluno 36 | 37 | Alert(i18n("A media geral dessa turma foi #1", {nMediaGeral})) 38 | 39 | Return 40 | 41 | User Function tst_mediaAlunos() 42 | Local aAlunos := {} 43 | 44 | aAdd(aAlunos, {"Maria", {5, 6, 8, 2, 9, 2} } ) 45 | aAdd(aAlunos, {"Joao", {5, 6, 8, 2} } ) 46 | aAdd(aAlunos, {"Joaquina", {5, 6, 8, 2} } ) 47 | aAdd(aAlunos, {"Zezinho", {6, 6, 8, 2, 5} } ) 48 | aAdd(aAlunos, {"Marcia", {5, 8, 8, 6} } ) 49 | aAdd(aAlunos, {"Alice", {4, 6, 8, 10, 3, 5, 6} } ) 50 | aAdd(aAlunos, {"Barbara", {5, 6, 8, 2} } ) 51 | aAdd(aAlunos, {"Cassio", {5, 6, 7, 2} } ) 52 | aAdd(aAlunos, {"Andre", {10, 10, 10, 2} } ) 53 | 54 | u_mediaAlunos(aAlunos) 55 | 56 | Return -------------------------------------------------------------------------------- /tests/array/analisePessoasTestCase.prw: -------------------------------------------------------------------------------- 1 | #include "protheus.ch" 2 | 3 | //------------------------------------------------------------------- 4 | /*/{Protheus.doc} analisePessoasTestCase 5 | Casos de teste para o exercicio analisePessoas 6 | 7 | @author Juliane Venteu 8 | /*/ 9 | //------------------------------------------------------------------- 10 | class analisePessoasTestCase from FWDefaultTestCase 11 | method analisePessoasTestCase() 12 | method testCase1() 13 | method testCase2() 14 | end class 15 | 16 | method analisePessoasTestCase() class analisePessoasTestCase 17 | _Super:FWDefaultTestCase() 18 | 19 | self:addTestMethod('testCase1',,'') 20 | self:addTestMethod('testCase2',,'') 21 | return 22 | 23 | method testCase1() class analisePessoasTestCase 24 | Local oResult := FWTestResult():FWTestResult() 25 | Local aTeste 26 | Local aPessoas := {} 27 | 28 | aAdd(aPessoas, {"F", 1.60} ) 29 | aAdd(aPessoas, {"M", 1.50} ) 30 | aAdd(aPessoas, {"F", 1.70} ) 31 | aAdd(aPessoas, {"F", 1.60} ) 32 | aAdd(aPessoas, {"M", 1.90} ) 33 | 34 | aTeste := u_analisePessoas(aPessoas) 35 | oResult:AssertEqual(aTeste[1], 1.50) 36 | oResult:AssertEqual(aTeste[2], 1.63) 37 | oResult:AssertEqual(aTeste[3], 2) 38 | oResult:AssertEqual(aTeste[4], "M") 39 | 40 | return oResult 41 | 42 | method testCase2() class analisePessoasTestCase 43 | Local oResult := FWTestResult():FWTestResult() 44 | Local aTeste 45 | Local aPessoas := {} 46 | 47 | aAdd(aPessoas, {"M", 1.60} ) 48 | aAdd(aPessoas, {"M", 1.50} ) 49 | aAdd(aPessoas, {"M", 1.70} ) 50 | aAdd(aPessoas, {"M", 1.60} ) 51 | aAdd(aPessoas, {"M", 1.90} ) 52 | 53 | aTeste := u_analisePessoas(aPessoas) 54 | oResult:AssertEqual(aTeste[1], 1.50) 55 | oResult:AssertEqual(aTeste[2], 0) 56 | oResult:AssertEqual(aTeste[3], 5) 57 | oResult:AssertEqual(aTeste[4], "M") 58 | 59 | return oResult 60 | --------------------------------------------------------------------------------