Futilities/v0.6/clade/Kiosk/WUIDL/@fx/ReadInput

From Woozle Writes Code
< Futilities‎ | v0.6‎ | clade‎ | Kiosk‎ | WUIDL
Revision as of 00:50, 19 November 2025 by Woozle (talk | contribs) (Created page with "{{page/fx}} ==About== * '''Action''': match the input arguments up against the available (app) parameters, and turn them into an Action sequence * '''Defined by''' {{l/ver/fx|p=ferreteria|{{SUBPAGENAME}}|Ferreteria}} ==Code== ''as of {{fmt/date|2025|11|18}}:'' {{fmt/php/block|1=# public function ReadInput() { // + OBJECTS $oScrn = self::Screen(); $osDex = $this->QInDadex(); // object encapsulating the input command // - OBJECTS...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About

  • Action: match the input arguments up against the available (app) parameters, and turn them into an Action sequence
  • Defined by Ferreteria

Code

as of 2025-11-18:

#
    public function ReadInput() {
        // + OBJECTS
        $oScrn = self::Screen();
        $osDex = $this->QInDadex();  // object encapsulating the input command
        // - OBJECTS

        // Iterate through the input command/request and add InReqs to the Actions() list:

        if ($osDex->HasIt()) {
            #self::GotToHere();
            $oDex = $osDex->GetIt();
            $oaActs = $this->Actions();
            while ($oDex->HasData()) {
                $oPair = $oDex->FirstPairPull();  // get the next argument
                $sArgKey = $oPair->Name();  // key for input argument
                #$this->AmHere("ArgKey=[$sArgKey]");

                $oTInst = $this->MainTag();
                $oCues = $oTInst->GetFTags()->InputCues();
                // search Cues for input commandlet ($sArgKey)
                $osTDCue = $oCues->QryIt($sArgKey);
                if ($osTDCue->HasIt()) {
                    $oTDCue = $osTDCue->GetIt();  // [WF]Sys\Data\tree\XML\tags\cue\cFound
                    $oTDItem = $oTDCue->GetOuter();

                    #$this->AmHere('$oTDItem class: '.get_class($oTDItem));

                    // create an Action for this option-tag
                    $scAct = $this->ItemInReqClass($oTDItem);             // look up Action class for the reqItem holding this cue
                    $sArgVal = $oPair->HasValue() ? $oPair->Value() : ''; // input argument value, if any

                    //+DEBUG
                    #$oTTItem = $oTDItem->Type();
                    #echo $oTTItem->ReflectThis()->Report(); // DEBUG
                    #$sTag = $oTTItem->Name(); // name of tag-type
                    #$this->AmHere(" -- ArgName=[".$oPair->Name()."] tag=[$sTag] ArgVal=[$sArgVal]");
                    //-DEBUG

                    $oAct = ($scAct)::FromItemPiece($oTDItem,$oPair);  // create Action-object for it
                    $oaActs->Append($oAct);                    // add Action to the sequence
                } else {
                    $oErr = new ErrorClass("input argument [$sArgKey] not recognized.");
                    $this->Errors()->AddMsgObject($oErr);
                }
            }
        }
    }