1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Help!! Procomm Plus Script for reading & cap text

Discussion in 'Software Development' started by testeng, Feb 16, 2007.

Thread Status:
Not open for further replies.
  1. testeng

    testeng Thread Starter

    Joined:
    Feb 16, 2007
    Messages:
    2
    I have a PC that has an existing Procom Plus 4.8 program that uses Aspect Scripts.
    What I need to do is create a simple test for the Procomm Plus program of this PC.

    I am having trouble reading an entire text file and checking for a specific word, before sending a user message


    These are the steps I need to work.

    A.) I need to read the entire text file (I am only reading the first string to the CR/LF.)

    B.) I need to check for the word "DENY"

    C.) If I see the word "DENY", then print Match Found!.

    The A.) step is not working. I am only reading the first string to the CR/LF.



    The code:

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAPTURE TEXT 1

    proc setupProc
    delfile "c:\Temp\temp.txt"
    set txpace 10
    set capture path "c:\Temp"
    set capture file "temp.txt"
    waitfor "RTRV-EQPT::ALL:;" 5
    capture on
    transmit "^M"
    waitfor ";" 5
    capture off
    endproc

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;READ TEXT 1

    proc checkcomplete
    string sLine

    fopen 0 "c:\Temp\temp.txt" read text ;Read the temp textfile
    while not feof 0
    fgets 0 sLine ;Read the first string of the text
    if strfind sLine "DENY" ;See if the text has the word "DENY"
    usermsg "Match found!" ;If the word "DENY" exists print Match Found
    else
    usermsg "No matches!" ;Else print No matches!
    return
    endif
    endwhile
    fclose 0
    endproc
     
  2. testeng

    testeng Thread Starter

    Joined:
    Feb 16, 2007
    Messages:
    2
    I got the fix with the following setup:

    string sLine
    integer Loops=0

    fopen 0 "c:\Temp\temp.txt" read text
    while (Loops) < 100
    fgets 0 sLine
    if strfind sLine "DENY"
    usermsg "UNIT FAILED!"
    endif
    Loops++
    endwhile
    fclose 0
    endproc
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/544574

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice