Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.forth    |    Forth programmers eat a lot of Bratwurst    |    117,927 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 117,824 of 117,927    |
|    sjack to All    |
|    Re: toad (figforth) ipc demo    |
|    24 Dec 25 04:01:23    |
   
   From: sjack@dontemail.me   
      
   fload job --> IPC up and Running   
   WRK DEFINITIONS   
   -- EXPR ( s1 s2 -- * )   
   -- Apply REGEX string s1 to subject string s2.   
   : EXPR   
    SMPAD \ start counted string construction   
    "(P1=$(expr " +S \ P1, Bash EXPR command   
    ROT +S \ subject string   
    " : " +S \ Middle separator   
    ROT +S \ REGEX string   
    ") P0=$?;" +S \ P0, command status   
    "echo $P0 $P1)" +S \ return status and result   
    SM MPAD C! \ set counted string size   
    MPAD DUP COUNT + MPADV .SET \ fence the string   
    IPC ./TRX \ ipc transmit/receive   
      
      
   : IPC_EXPR_PRINT   
    BL SPLIT G" 0" COMPARE   
    DUP IF ." Bash error #" . 2DROP ELSE DROP TYPE ENDIF ;   
      
   ' IPC_EXPR_PRINT IPC .IS_ACTION   
   i. S( ".*") S( "Now IS the time") WA EXPR --> 15   
      
   -- === FYI   
   CR i. MPAD TELL   
    --> (P1=$(expr "Now IS the time" : ".*") P0=$?;echo $P0 $P1)>${IPC0}   
   i. MPAD /SYS IPC .GET --> 15   
   -- ===   
      
   i. S( ".*\([A-Z][A-Z]\).*") &WA EXPR --> IS   
      
   i. S( "PLUGH") &WA EXPR --> Bash error #1   
      
   -fin-   
      
   Note:   
   &WA ( -- s ) String-variable   
   WA ( s -- sv ) Copy string to &WA string-variable   
   i. Print "-->"   
      
   --   
   me   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca