Fieldpine Logo Documentation Home   DESIGN NOTES

This information is a technical design note. Use extreme caution if relying on this information, it may be outdated or incomplete

Design Note: System Quickcode PosCommand


Source Code: ProgramSet.cpp See also system() PosCommand

Execution

Source Ref: ProgramSet::ExecuteUserCode()

  1. If the setting QuickCodeAllowRemote is set (default yes) and the quickcode value matches the pattern Fnnnn, then call ExecuteRemoteCode first. Remote quickcodes are reserved for Fieldpine Support. Quickcodes are defined on Fieldpine servers in the file Gds2\RmWebQuickCodes\main.txt
    1. A call packet is built to call retailmaxweb.rmpos.quickcode Various pieces of system identifying information are included (licence#, version, MAC etc)
    2. If the code is a known code (f5001 etc), details about DLL and EXE files is included in the call.
    3. The call packet is sent to the remote server and we wait for the response.
    4. The response packet is processed. The server can provide the following types of commands
      • PosCommands (executed immediately). Sent as "150"
      • PosScript. (buffered to end). Sent as "151"
      • FdlCommands. (executed immediately). Sent as "152". FdlCommands are a restricted subset of commands, see source for details.
      • Values to append to fpos.ctl. (buffered to end). Sent as "153"
      • Remote "C" code. (executes "161" lines immediately). Sent as "160"
      • Remote "C" code define. (buffered to "160" received). Sent as "161"
      • Open browser to Raw HTML. (executes "171" lines now). Sent as "170"
      • Raw HTML define. (buffered until "170" received). Sent as "171"

    You can manually see the response sent for a quickcode by browsing to

    http://www.fieldpine.com/gnap/M/buck?3=retailmaxweb.rmpos.quickcode&100=f123

  2. The files posmetadef.txt, fieldpine-support.txt, posmetadef_user.txt and customer-support.txt are processed in turn until the first file executes the code.
    1. The file is read and the command extracted. This involves searching for lines starting with
      QUICKC(xxx) command
      and matching xxx to the requested quickcode.
    2. Security checking is disabled briefly while the quickcode is executed. This is reasonably safe as only commands inside the files will be executed.
    3. The command string is passed to the general PosCommands execution processor.
  3. A quickcode executed event is logged
  4. If the quickcode was not executed, the user is given an error message.