Announcement

Collapse

Forum Guidelines

This forum is for finished source code that is working properly. If you have questions about this or any other source code, please post it in one of the Discussion Forums, not here.
See more
See less

Very simple command sequencer.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Very simple command sequencer.

    These are the things you do when you are waiting for a board and memory to arrive. The attached example is a very simple command sequencer, something like a simple batch file but without the console. To test it, run "cmdseq.exe" with the included script.txt file. It runs OK on my Win10 64 bit and with additions of labels with a matching GOTO and some comparison logic, it could even end up useful.
    Code:
    ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
    
    '   BUILD WITH PBWIN 10
    
    ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
    
        #compile exe "cmdseq.exe"
    
    FUNCTION PBmain as LONG
    
        LOCAL lcnt as DWORD                             ' source line count
        LOCAL indx as DWORD                             ' array index
        LOCAL acnt as DWORD
    
        Open command$ for Binary as #1
          Get$ #1,lof(1),src$                           ' load the source file
        Close #1
    
        lcnt = ParseCount(src$,$CRLF)                   ' get the line count
        DIM sarr(lcnt) as STRING
        Parse src$,sarr(),$CRLF                         ' parse it into a string array
    
        indx = 0                                        ' zero the index
    
      mainloop:
        Shell sarr(indx)                                ' synchronously execute commands
        indx = indx + 1
        If indx < lcnt Then                             ' loop while more commands available
          goto mainloop
        End If
    
        Erase sarr()                                    ' delete the array
    
    End FUNCTION
    
    ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
    Attached Files
    hutch at movsd dot com
    The MASM Forum - SLL Modules and PB Libraries

    http://www.masm32.com/board/index.php?board=69.0
Working...
X
😀
🥰
🤢
😎
😡
👍
👎