Announcement

Collapse
No announcement yet.

Translate scripts into commands on server

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

  • Joe Byrne
    replied
    Maybe its something in the water ....

    I'm not really following what you're after either Mike. Can you expound on the concept further?

    Leave a comment:


  • Mike Doty
    replied
    Why are you saying this? What benefit does this have to this posting?

    Leave a comment:


  • Michael Mattias
    replied
    I think you replied while I was finishing up after prematurely hitting 'post.'

    "Client/server" is it's own architecture; TCP is just one way of implementing that architecture. Its use is dictated by the application: access to a centralized repository of data, or some business rule implementation which is often revised and it's a lot easier to change one server than to change ALL the users (clients).... stuff like that.

    If an application is not ripe for a client/server architecture, making it "TCP Client server" is not going to be the best choice either.

    Leave a comment:


  • Mike Doty
    replied
    I don't know how many ways to state the same thing.
    It is good to have new ways of doing things available.
    So many command sets, why not a new one just for PowerBASIC TCP client/server programming? We have FTP, SMTP, NNTP, POP3 and so many more. Why not a CLASS? Contacted support if they have any mini or pre-compiler available. SQLite has an interesting byte code.
    How about TCP Tools?
    Last edited by Mike Doty; 3 Feb 2009, 11:02 AM.

    Leave a comment:


  • Michael Mattias
    replied
    I'm trying to have a standardized library of TCP requests. If a third-party library knows how to directly open a file in PowerBASIC and get records 198 through 209 and then close the file without using anything other than TCP is the goal.
    Then why didn't you say so?

    The key to this IMO is a design which supports this as an alternate service provided by your server software. (Yes, I know that is redundant, but bear with me a moment here).

    In this case it does not quite make sense to me why you'd call a server to open a file and get a certain set of records when you could just open the file and get those records directly from your program... what you say the client program can do.

    But if you mean THE SERVER calls the third-party library, then you could make up a 'generic' command to be sent via TCP, something like
    Code:
    EXECUTELIBRARYFUNCTION  Commandname  commandoptions
    For example, you might call the server with
    Code:
    EXECUTELIBRARYFUNCTION   GetRangeOfRecordsbyNumber  "198 209 myfile btrieve"
    ...Which tells the server to get records 198 thru 209 from file 'myfile' and that "myfile" is a Btrieve file. Your server then translates this into the requisite btreive calls and returns the records in some defined format.

    But if the client can do this himself, I don't know why the server even has a job.

    Or maybe you want to do something like
    Code:
    EXECUTEDLLFUNCTION  libname, procName, param [,param]..
    This would be a way to make some service not otherwise available to that client available... or to hide "how it's actually done" if that is desireable, as you could make your own translations for "libname" and "procname" and the client would be none the wiser.

    Maybe a little more specific example?

    MCM
    Last edited by Michael Mattias; 3 Feb 2009, 10:58 AM.

    Leave a comment:


  • Mike Doty
    replied
    I'm trying to have a standardized library of TCP requests. If a third-party library knows how to directly open a file in PowerBASIC and get records
    198 through 209 and then close the file without using anything other than TCP is the goal. The goal is to standardize this so SQL or third-party software is not required. I will continue to roll my own. No Java, no VBA, just PowerBASIC. I will contact support about this. Thank you.
    Last edited by Mike Doty; 3 Feb 2009, 10:40 AM.

    Leave a comment:


  • Michael Mattias
    replied
    I must still be missing something.

    The common command set *is* your 'script language of choice.'

    If you want to make that 'script language of choice' a BASIC dialect, you'll have to tell your server software what to do when it sees "FOR .. NEXT" or OPEN or any other keywords you choose to support.

    (This is exactly what ThinBasic does).

    If you are talking about a server-based PowerBASIC Compile/Execute, first thing I'd do is check with the people in Florida to see if you need a special license. (I think something akin to this has come up here before).

    MCM

    Leave a comment:


  • Mike Doty
    replied
    The point is to have a common syntax so everyone can easily write
    client/server applications without inventing their own command set.

    Leave a comment:


  • Michael Mattias
    replied
    Well, your way - whatever it is - is as good as the next way.

    Were I to undertake this type of project, I would just create my scripts in the syntax of my 'script language of choice' instead of another product's syntax.

    After all, to do this project assumes you know BOTH languages, does it not? So why even bother with a 'translation?'

    Eg instead of "FOR ..NEXT" I might use
    Code:
      ASSIGN I, 1  
      DO 
           Something (I) 
           I+
      ENDDO
    MCM

    Leave a comment:


  • Mike Doty
    replied
    You are missing the script executor code.
    What would the code be for:
    FOR X = 1 TO 10: GET #3, X: NEXT

    The server performs all I/O on the local files.
    The client only sends strings to the server.
    The client cannot directly execute anything on the server.
    If a client wants to get record 1 from file 1 that string must
    be translated by the server into a call like GET #1, 1.

    The original question is:
    How do you translate scripts passed in a client/server environment using "FOR/NEXT", "DO/WHILE" , "GET", "PUT", "OPEN", etc ... into code on a server? I have my own way of doing it and thought about a PB script compiler (dream.)
    This is for a TCP client/server.
    Last edited by Mike Doty; 3 Feb 2009, 09:30 AM.

    Leave a comment:


  • Michael Mattias
    replied
    >No, I wrote the client and the server using TCP.

    Ok, so your client creates and sends your script file to the server using TCP, and the server then calls the appropriate 'script executer' program.

    What am I missing here?

    --------------------------------
    Still confused in America's Dairyland

    Leave a comment:


  • Mike Doty
    replied
    No, I wrote the client and the server using TCP.

    Leave a comment:


  • Michael Mattias
    replied
    >PB script compiler (dream.)

    ThinBasic is a 'script interpreter'

    VBA is a 'script interpreter'

    Java is a 'script interpreter'

    All these can execute "programming commands organized as a procedure or group of procedures" - 'mini applications programs' if you will.

    Is that what you want to do, send a 'script' to some 'server' for execution?

    That said, I think you have to select your 'script language of choice' and create your scripts in that language before sending for execution.

    ???

    Leave a comment:


  • Mike Doty
    started a topic Translate scripts into commands on server

    Translate scripts into commands on server

    How do you translate scripts passed in a client/server environment using "FOR/NEXT", "DO/WHILE" , "GET", "PUT", "OPEN", etc ... into code on a server? I have my own way of doing it and thought about a PB script compiler (dream.)


    Added this after Michael's posting below.
    This is for TCP client/server so the TCP server can perform tasks for the client.
    Last edited by Mike Doty; 3 Feb 2009, 09:19 AM. Reason: Added this is for a TCP Client/Server
Working...
X
😀
🥰
🤢
😎
😡
👍
👎